diff options
| author | SeongJae Park <[email protected]> | 2022-12-28 17:59:42 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-01-19 01:12:50 +0000 |
| commit | 01b5022f0a8a2911bb8f2bc3f0c9b9b2c21c3316 (patch) | |
| tree | 5b358fd606e1fe2fbb9adad9ef52d7fdecc97ad1 /fs/jbd2/commit.c | |
| parent | mm: fix comment of page table counter (diff) | |
| download | kernel-01b5022f0a8a2911bb8f2bc3f0c9b9b2c21c3316.tar.gz kernel-01b5022f0a8a2911bb8f2bc3f0c9b9b2c21c3316.zip | |
mm/page_reporting: replace rcu_access_pointer() with rcu_dereference_protected()
Page reporting fetches pr_dev_info using rcu_access_pointer(), which is
for safely fetching a pointer that will not be dereferenced but could
concurrently updated. The code indeed does not dereference pr_dev_info
after fetching it using rcu_access_pointer(), but it fetches the pointer
while concurrent updates to the pointer is avoided by holding the update
side lock, page_reporting_mutex.
In the case, rcu_dereference_protected() should be used instead because it
provides better readability and performance on some cases, as
rcu_dereference_protected() avoids use of READ_ONCE(). Replace the
rcu_access_pointer() calls with rcu_dereference_protected().
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 36e66c554b5c ("mm: introduce Reported pages")
Signed-off-by: SeongJae Park <[email protected]>
Cc: Alexander Duyck <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Miaohe Lin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions
