mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ANDROID: mm: export mem_cgroup_move_account
Export mem_cgroup_move_account to migrate folios between different memcgs. This is to achieve more accurate memory reclamation. Bug: 373540729 Change-Id: I77ac12fdc25bae90f37f725be1a168da52f02abd Signed-off-by: Jianan Huang <huangjianan@xiaomi.com> (cherry picked from commit c031476ae982c66d0f0674eb0a5c1ee03e825fd7)
This commit is contained in:
@@ -357,6 +357,11 @@ enum page_memcg_data_flags {
|
|||||||
|
|
||||||
static inline bool folio_memcg_kmem(struct folio *folio);
|
static inline bool folio_memcg_kmem(struct folio *folio);
|
||||||
|
|
||||||
|
int mem_cgroup_move_account(struct page *page,
|
||||||
|
bool compound,
|
||||||
|
struct mem_cgroup *from,
|
||||||
|
struct mem_cgroup *to);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* After the initialization objcg->memcg is always pointing at
|
* After the initialization objcg->memcg is always pointing at
|
||||||
* a valid memcg, but can be atomically swapped to the parent memcg.
|
* a valid memcg, but can be atomically swapped to the parent memcg.
|
||||||
@@ -1188,6 +1193,14 @@ static inline bool PageMemcgKmem(struct page *page)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int mem_cgroup_move_account(struct page *page,
|
||||||
|
bool compound,
|
||||||
|
struct mem_cgroup *from,
|
||||||
|
struct mem_cgroup *to)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
|
static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -5750,7 +5750,7 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,
|
|||||||
* This function doesn't do "charge" to new cgroup and doesn't do "uncharge"
|
* This function doesn't do "charge" to new cgroup and doesn't do "uncharge"
|
||||||
* from old cgroup.
|
* from old cgroup.
|
||||||
*/
|
*/
|
||||||
static int mem_cgroup_move_account(struct page *page,
|
int mem_cgroup_move_account(struct page *page,
|
||||||
bool compound,
|
bool compound,
|
||||||
struct mem_cgroup *from,
|
struct mem_cgroup *from,
|
||||||
struct mem_cgroup *to)
|
struct mem_cgroup *to)
|
||||||
@@ -5861,6 +5861,7 @@ out_unlock:
|
|||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(mem_cgroup_move_account);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get_mctgt_type - get target type of moving charge
|
* get_mctgt_type - get target type of moving charge
|
||||||
|
|||||||
Reference in New Issue
Block a user