diff options
| author | Yosry Ahmed <[email protected]> | 2023-11-29 03:21:52 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-12-20 14:48:11 -0800 |
| commit | b006847222623ac3cda8589d15379eac86a2bcb7 (patch) | |
| tree | deebe707726541eef618f2662b3f9d1b4fce4f0a /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 8d59d2214c2362e7a9d185d80b613e632581af7b (diff) | |
mm: workingset: move the stats flush into workingset_test_recent()
The workingset code flushes the stats in workingset_refault() to get
accurate stats of the eviction memcg. In preparation for more scoped
flushed and passing the eviction memcg to the flush call, move the call to
workingset_test_recent() where we have a pointer to the eviction memcg.
The flush call is sleepable, and cannot be made in an rcu read section.
Hence, minimize the rcu read section by also moving it into
workingset_test_recent(). Furthermore, instead of holding the rcu read
lock throughout workingset_test_recent(), only hold it briefly to get a
ref on the eviction memcg. This allows us to make the flush call after we
get the eviction memcg.
As for workingset_refault(), nothing else there appears to be protected by
rcu. The memcg of the faulted folio (which is not necessarily the same as
the eviction memcg) is protected by the folio lock, which is held from all
callsites. Add a VM_BUG_ON() to make sure this doesn't change from under
us.
No functional change intended.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yosry Ahmed <[email protected]>
Tested-by: Domenico Cerasuolo <[email protected]>
Acked-by: Shakeel Butt <[email protected]>
Cc: Chris Li <[email protected]>
Cc: Greg Thelen <[email protected]>
Cc: Ivan Babrou <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Michal Koutny <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Wei Xu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions