Skip to content

Commit

Permalink
mm: memcg: move legacy memcg event code into memcontrol-v1.c
Browse files Browse the repository at this point in the history
Cgroup v1's memory controller contains a pretty complicated event
notifications mechanism which is not used on cgroup v2.  Let's move the
corresponding code into memcontrol-v1.c.

Please, note, that mem_cgroup_event_ratelimit() remains in memcontrol.c,
otherwise it would require exporting too many details on memcg stats
outside of memcontrol.c.

Link: https://lkml.kernel.org/r/20240625005906.106920-7-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
rgushchin authored and akpm00 committed Jul 5, 2024
1 parent b9eaacb commit 66d60c4
Show file tree
Hide file tree
Showing 4 changed files with 709 additions and 694 deletions.
12 changes: 0 additions & 12 deletions include/linux/memcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ struct mem_cgroup_id {
refcount_t ref;
};

/*
* Per memcg event counter is incremented at every pagein/pageout. With THP,
* it will be incremented by the number of pages. This counter is used
* to trigger some periodic events. This is straightforward and better
* than using jiffies etc. to handle periodic memcg event.
*/
enum mem_cgroup_events_target {
MEM_CGROUP_TARGET_THRESH,
MEM_CGROUP_TARGET_SOFTLIMIT,
MEM_CGROUP_NTARGETS,
};

struct memcg_vmstats_percpu;
struct memcg_vmstats;
struct lruvec_stats_percpu;
Expand Down
Loading

0 comments on commit 66d60c4

Please sign in to comment.