diff options
author | Tejun Heo <tj@kernel.org> | 2015-09-18 18:01:59 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-09-21 15:14:47 -0400 |
commit | 472912a2b5e2027efd58aa47f78acb2373675187 (patch) | |
tree | a555fffaffdd8b19c530c722770016092997f111 /include/linux/memcontrol.h | |
parent | 6f60eade2433cb3a38687d5f8a4f44b92c6c51bf (diff) |
memcg: generate file modified notifications on "memory.events"
cgroup core only recently grew generic notification support. Wire up
"memory.events" so that it triggers a file modified event whenever its
content changes.
v2: Refreshed on top of mem_cgroup relocation.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Michal Hocko <mhocko@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9aa7820c2177..c83c699a6605 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -213,6 +213,9 @@ struct mem_cgroup { | |||
213 | /* OOM-Killer disable */ | 213 | /* OOM-Killer disable */ |
214 | int oom_kill_disable; | 214 | int oom_kill_disable; |
215 | 215 | ||
216 | /* handle for "memory.events" */ | ||
217 | struct cgroup_file events_file; | ||
218 | |||
216 | /* protect arrays of thresholds */ | 219 | /* protect arrays of thresholds */ |
217 | struct mutex thresholds_lock; | 220 | struct mutex thresholds_lock; |
218 | 221 | ||
@@ -286,6 +289,7 @@ static inline void mem_cgroup_events(struct mem_cgroup *memcg, | |||
286 | unsigned int nr) | 289 | unsigned int nr) |
287 | { | 290 | { |
288 | this_cpu_add(memcg->stat->events[idx], nr); | 291 | this_cpu_add(memcg->stat->events[idx], nr); |
292 | cgroup_file_notify(&memcg->events_file); | ||
289 | } | 293 | } |
290 | 294 | ||
291 | bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg); | 295 | bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg); |