diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2022-03-23 09:58:40 +0100 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2022-03-23 09:58:40 +0100 | 
| commit | b690490d6d466972ade172ee2e7f6ffa49e7e910 (patch) | |
| tree | 50a93da28c9128e19eb7a3038aecf75dab6b36e1 /include/linux/memcontrol.h | |
| parent | f97ec5d75e9261a5da78dc28a8955b7cc0c4468b (diff) | |
| parent | 0f203948230720e849ad50d158adac1cd32c282f (diff) | |
Merge branch 'for-5.18/amd-sfh' into for-linus
- dead code elimination (Christophe JAILLET)
Diffstat (limited to 'include/linux/memcontrol.h')
| -rw-r--r-- | include/linux/memcontrol.h | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e34112f6a369..b72d75141e12 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -33,6 +33,7 @@ enum memcg_stat_item {  	MEMCG_SWAP = NR_VM_NODE_STAT_ITEMS,  	MEMCG_SOCK,  	MEMCG_PERCPU_B, +	MEMCG_VMALLOC,  	MEMCG_NR_STAT,  }; @@ -42,6 +43,7 @@ enum memcg_memory_event {  	MEMCG_MAX,  	MEMCG_OOM,  	MEMCG_OOM_KILL, +	MEMCG_OOM_GROUP_KILL,  	MEMCG_SWAP_HIGH,  	MEMCG_SWAP_MAX,  	MEMCG_SWAP_FAIL, @@ -943,6 +945,21 @@ static inline void mod_memcg_state(struct mem_cgroup *memcg,  	local_irq_restore(flags);  } +static inline void mod_memcg_page_state(struct page *page, +					int idx, int val) +{ +	struct mem_cgroup *memcg; + +	if (mem_cgroup_disabled()) +		return; + +	rcu_read_lock(); +	memcg = page_memcg(page); +	if (memcg) +		mod_memcg_state(memcg, idx, val); +	rcu_read_unlock(); +} +  static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx)  {  	return READ_ONCE(memcg->vmstats.state[idx]); @@ -1398,6 +1415,11 @@ static inline void mod_memcg_state(struct mem_cgroup *memcg,  {  } +static inline void mod_memcg_page_state(struct page *page, +					int idx, int val) +{ +} +  static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx)  {  	return 0;  | 
