The patch titled memrlimit handle attach_task() failure, add can_attach() callback (update) has been removed from the -mm tree. Its filename was memrlimit-handle-attach_task-failure-add-can_attach-callback-update.patch This patch was dropped because it was folded into memrlimit-handle-attach_task-failure-add-can_attach-callback.patch The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: memrlimit handle attach_task() failure, add can_attach() callback (update) From: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> Changelog v2->v1 1. Rename res_counter_add_check() to res_counter_can_add() Making the first argument (struct res_counter *) a constant pointer causes the compiler to spew out warnings in spin_(un)lock_irq* routines, since we now pass address from a constant pointer to the lock routines. This patch fixes a task migration problem reported by Kamezawa-San. This patch should fix all issues with migraiton, except for a rare condition documented in memrlimit_cgroup_move_task(). To fix that problem, we would need to add transaction properties to cgroups. The problem reported was that migrating to a group that did not have sufficient limits to accept an incoming task caused a kernel warning. Steps to reproduce % mkdir /dev/cgroup/memrlimit/group_01 % mkdir /dev/cgroup/memrlimit/group_02 % echo 1G > /dev/cgroup/memrlimit/group_01/memrlimit.limit_in_bytes % echo 0 > /dev/cgroup/memrlimit/group_02/memrlimit.limit_in_bytes % echo $$ > /dev/cgroup/memrlimit/group_01/tasks % echo $$ > /dev/cgroup/memrlimit/group_02/tasks % exit memrlimit does the right thing by not moving the charges to group_02, but the task is still put into g2 (since we did not use can_attach to fail migration). Once in g2, when we echo the task to the root cgroup, it tries to uncharge the cost of the task from g2. g2 does not have any charge associated with the task, hence we get a warning. Reviewed-by: <kamezawa.hiroyu@xxxxxxxxxxxxxx> Signed-off-by: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> Cc: Pavel Emelyanov <xemul@xxxxxxxxxx> Cc: Sudhir Kumar <skumar@xxxxxxxxxxxxxxxxxx> Cc: YAMAMOTO Takashi <yamamoto@xxxxxxxxxxxxx> Cc: Paul Menage <menage@xxxxxxxxxx> Cc: Li Zefan <lizf@xxxxxxxxxxxxxx> Cc: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx> Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/res_counter.h | 2 +- mm/memrlimitcgroup.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff -puN include/linux/res_counter.h~memrlimit-handle-attach_task-failure-add-can_attach-callback-update include/linux/res_counter.h --- a/include/linux/res_counter.h~memrlimit-handle-attach_task-failure-add-can_attach-callback-update +++ a/include/linux/res_counter.h @@ -178,7 +178,7 @@ static inline int res_counter_set_limit( * Add the value val to the resource counter and check if we are * still under the limit. */ -static inline bool res_counter_add_check(struct res_counter *cnt, +static inline bool res_counter_can_add(struct res_counter *cnt, unsigned long val) { bool ret = false; diff -puN mm/memrlimitcgroup.c~memrlimit-handle-attach_task-failure-add-can_attach-callback-update mm/memrlimitcgroup.c --- a/mm/memrlimitcgroup.c~memrlimit-handle-attach_task-failure-add-can_attach-callback-update +++ a/mm/memrlimitcgroup.c @@ -176,8 +176,7 @@ static int memrlimit_cgroup_can_move_tas memrcg = memrlimit_cgroup_from_cgrp(cgrp); - if (!res_counter_add_check(&memrcg->as_res, - (mm->total_vm << PAGE_SHIFT))) + if (!res_counter_can_add(&memrcg->as_res, (mm->total_vm << PAGE_SHIFT))) ret = -ENOMEM; out: rcu_read_unlock(); _ Patches currently in -mm which might be from balbir@xxxxxxxxxxxxxxxxxx are cgroup-use-read-lock-to-guard-find_existing_css_set.patch mark-res_counter_charge_locked-with-__must_check.patch memcg-make-global-var-read_mostly.patch memcg-avoid-unnecessary-initialization.patch memcg-clean-up-checking-of-the-disabled-flag.patch res_counter-limit-change-support-ebusy.patch memcg-limit-change-shrink-usage.patch memrlimit-add-memrlimit-controller-documentation.patch memrlimit-setup-the-memrlimit-controller.patch memrlimit-cgroup-mm-owner-callback-changes-to-add-task-info.patch memrlimit-add-memrlimit-controller-accounting-and-control.patch memrlimit-improve-error-handling.patch memrlimit-improve-error-handling-update.patch memrlimit-handle-attach_task-failure-add-can_attach-callback.patch memrlimit-handle-attach_task-failure-add-can_attach-callback-update.patch distinct-tgid-tid-i-o-statistics.patch per-task-delay-accounting-add-memory-reclaim-delay.patch per-task-delay-accounting-update-document-and-getdelaysc-for-memory-reclaim.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html