aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmpressure.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-11-22 18:20:43 -0500
committerTejun Heo <tj@kernel.org>2013-11-22 18:20:43 -0500
commit59b6f87344ab5eb3057e5844b8cd8a39e668f477 (patch)
tree889411e1dd5023e63dfbd723e770669824c5072d /mm/vmpressure.c
parent347c4a8747104a945ecced358944e42879176ca5 (diff)
memcg: make cgroup_event deal with mem_cgroup instead of cgroup_subsys_state
cgroup_event is now memcg specific. Replace cgroup_event->css with ->memcg and convert [un]register_event() callbacks to take mem_cgroup pointer instead of cgroup_subsys_state one. This simplifies the code slightly and makes css_to_vmpressure() unnecessary which is removed. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Michal Hocko <mhocko@suse.cz>
Diffstat (limited to 'mm/vmpressure.c')
-rw-r--r--mm/vmpressure.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index 0f25a996d150..196970a4541f 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -278,7 +278,7 @@ void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio)
278 278
279/** 279/**
280 * vmpressure_register_event() - Bind vmpressure notifications to an eventfd 280 * vmpressure_register_event() - Bind vmpressure notifications to an eventfd
281 * @css: css that is interested in vmpressure notifications 281 * @memcg: memcg that is interested in vmpressure notifications
282 * @eventfd: eventfd context to link notifications with 282 * @eventfd: eventfd context to link notifications with
283 * @args: event arguments (used to set up a pressure level threshold) 283 * @args: event arguments (used to set up a pressure level threshold)
284 * 284 *
@@ -290,10 +290,10 @@ void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio)
290 * 290 *
291 * To be used as memcg event method. 291 * To be used as memcg event method.
292 */ 292 */
293int vmpressure_register_event(struct cgroup_subsys_state *css, 293int vmpressure_register_event(struct mem_cgroup *memcg,
294 struct eventfd_ctx *eventfd, const char *args) 294 struct eventfd_ctx *eventfd, const char *args)
295{ 295{
296 struct vmpressure *vmpr = css_to_vmpressure(css); 296 struct vmpressure *vmpr = memcg_to_vmpressure(memcg);
297 struct vmpressure_event *ev; 297 struct vmpressure_event *ev;
298 int level; 298 int level;
299 299
@@ -321,7 +321,7 @@ int vmpressure_register_event(struct cgroup_subsys_state *css,
321 321
322/** 322/**
323 * vmpressure_unregister_event() - Unbind eventfd from vmpressure 323 * vmpressure_unregister_event() - Unbind eventfd from vmpressure
324 * @css: css handle 324 * @memcg: memcg handle
325 * @eventfd: eventfd context that was used to link vmpressure with the @cg 325 * @eventfd: eventfd context that was used to link vmpressure with the @cg
326 * 326 *
327 * This function does internal manipulations to detach the @eventfd from 327 * This function does internal manipulations to detach the @eventfd from
@@ -330,10 +330,10 @@ int vmpressure_register_event(struct cgroup_subsys_state *css,
330 * 330 *
331 * To be used as memcg event method. 331 * To be used as memcg event method.
332 */ 332 */
333void vmpressure_unregister_event(struct cgroup_subsys_state *css, 333void vmpressure_unregister_event(struct mem_cgroup *memcg,
334 struct eventfd_ctx *eventfd) 334 struct eventfd_ctx *eventfd)
335{ 335{
336 struct vmpressure *vmpr = css_to_vmpressure(css); 336 struct vmpressure *vmpr = memcg_to_vmpressure(memcg);
337 struct vmpressure_event *ev; 337 struct vmpressure_event *ev;
338 338
339 mutex_lock(&vmpr->events_lock); 339 mutex_lock(&vmpr->events_lock);