Files
tegra-linux-noble/include/linux
Tejun Heo ad7fa852d3 memcg: implement mem_cgroup_css_from_page()
Implement mem_cgroup_css_from_page() which returns the
cgroup_subsys_state of the memcg associated with a given page on the
default hierarchy.  This will be used by cgroup writeback support.

This function assumes that page->mem_cgroup association doesn't change
until the page is released, which is true on the default hierarchy as
long as replace_page_cache_page() is not used.  As the only user of
replace_page_cache_page() is FUSE which won't support cgroup writeback
for the time being, this works for now, and replace_page_cache_page()
will soon be updated so that the invariant actually holds.

Note that the RCU protected page->mem_cgroup access is consistent with
other usages across memcg but ultimately incorrect.  These unlocked
accesses are missing required barriers.  page->mem_cgroup should be
made an RCU pointer and updated and accessed using RCU operations.

v4: Instead of triggering WARN, return the root css on the traditional
    hierarchies.  This makes the function a lot easier to deal with
    especially as there's no light way to synchronize against
    hierarchy rebinding.

v3: s/mem_cgroup_migrate()/mem_cgroup_css_from_page()/

v2: Trigger WARN if the function is used on the traditional
    hierarchies and add comment about the assumed invariant.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
2015-06-02 08:33:34 -06:00
..
2015-04-07 11:17:34 +02:00
2015-06-02 08:33:34 -06:00
2015-04-17 09:03:53 -04:00
2015-06-01 14:35:56 -06:00
2015-04-16 12:33:51 +09:30
2015-04-03 16:18:02 +02:00
2015-05-05 13:40:42 -06:00
2015-04-14 16:49:05 -07:00
2015-04-17 09:04:07 -04:00
2015-04-23 14:36:28 -04:00
2015-04-12 21:03:31 +02:00
2015-04-25 15:49:49 -04:00
2015-04-11 15:53:35 -04:00
2015-05-19 09:19:59 -06:00
2015-04-11 22:29:44 -04:00
2015-04-15 16:35:20 -07:00