aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
diff options
context:
space:
mode:
authorFilipe Manana <[email protected]>2024-07-08 14:42:45 +0000
committerDavid Sterba <[email protected]>2024-07-11 14:50:54 +0000
commit4484940514295b75389f94787f8e179ba6255353 (patch)
tree68de671f64cdfaa2309c83e3d76e358acaa481b9 /drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
parentbtrfs: stop extent map shrinker if reschedule is needed (diff)
downloadkernel-4484940514295b75389f94787f8e179ba6255353.tar.gz
kernel-4484940514295b75389f94787f8e179ba6255353.zip
btrfs: avoid races when tracking progress for extent map shrinking
We store the progress (root and inode numbers) of the extent map shrinker in fs_info without any synchronization but we can have multiple tasks calling into the shrinker during memory allocations when there's enough memory pressure for example. This can result in a task A reading fs_info->extent_map_shrinker_last_ino after another task B updates it, and task A reading fs_info->extent_map_shrinker_last_root before task B updates it, making task A see an odd state that isn't necessarily harmful but may make it skip certain inode ranges or do more work than necessary by going over the same inodes again. These unprotected accesses would also trigger warnings from tools like KCSAN. So add a lock to protect access to these progress fields. Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c')
0 files changed, 0 insertions, 0 deletions