mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
mm: memcg: move charge migration code to memcontrol-v1.c
Unlike the legacy cgroup v1 memory controller, cgroup v2 memory controller doesn't support moving charged pages between cgroups. It's a fairly large and complicated code which created a number of problems in the past. Let's move this code into memcontrol-v1.c. It shaves off 1k lines from memcontrol.c. It's also another step towards making the legacy memory controller code optionally compiled. Link: https://lkml.kernel.org/r/20240625005906.106920-5-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>
This commit is contained in:
parent
87024f5837
commit
e548ad4a7c
File diff suppressed because it is too large
Load Diff
@ -11,4 +11,34 @@ static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg)
|
||||
WRITE_ONCE(memcg->soft_limit, PAGE_COUNTER_MAX);
|
||||
}
|
||||
|
||||
void mem_cgroup_charge_statistics(struct mem_cgroup *memcg, int nr_pages);
|
||||
void memcg_check_events(struct mem_cgroup *memcg, int nid);
|
||||
void memcg_oom_recover(struct mem_cgroup *memcg);
|
||||
int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask,
|
||||
unsigned int nr_pages);
|
||||
|
||||
static inline int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
|
||||
unsigned int nr_pages)
|
||||
{
|
||||
if (mem_cgroup_is_root(memcg))
|
||||
return 0;
|
||||
|
||||
return try_charge_memcg(memcg, gfp_mask, nr_pages);
|
||||
}
|
||||
|
||||
void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n);
|
||||
void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n);
|
||||
|
||||
bool mem_cgroup_wait_acct_move(struct mem_cgroup *memcg);
|
||||
struct cgroup_taskset;
|
||||
int mem_cgroup_can_attach(struct cgroup_taskset *tset);
|
||||
void mem_cgroup_cancel_attach(struct cgroup_taskset *tset);
|
||||
void mem_cgroup_move_task(void);
|
||||
|
||||
struct cftype;
|
||||
u64 mem_cgroup_move_charge_read(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft);
|
||||
int mem_cgroup_move_charge_write(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft, u64 val);
|
||||
|
||||
#endif /* __MM_MEMCONTROL_V1_H */
|
||||
|
1004
mm/memcontrol.c
1004
mm/memcontrol.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user