From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, Paul Menage <menage@google.com>,
Li Zefan <lizf@cn.fujitsu.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: [PATCH] mm/cgroup.c add error check
Date: Tue, 06 May 2008 20:02:44 +0900 [thread overview]
Message-ID: <20080506195216.4A6D.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
on heavy workload, call_usermodehelper() may failure
because it use kzmalloc(GFP_ATOMIC).
but userland want receive release notificcation even heavy workload.
thus, We should retry if -ENOMEM happend.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: "Paul Menage" <menage@google.com>
CC: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/cgroup.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Index: b/kernel/cgroup.c
===================================================================
--- a/kernel/cgroup.c 2008-04-29 18:00:53.000000000 +0900
+++ b/kernel/cgroup.c 2008-05-06 20:28:23.000000000 +0900
@@ -3072,6 +3072,8 @@ void __css_put(struct cgroup_subsys_stat
*/
static void cgroup_release_agent(struct work_struct *work)
{
+ int err;
+
BUG_ON(work != &release_agent_work);
mutex_lock(&cgroup_mutex);
spin_lock(&release_list_lock);
@@ -3111,7 +3113,13 @@ static void cgroup_release_agent(struct
* since the exec could involve hitting disk and hence
* be a slow process */
mutex_unlock(&cgroup_mutex);
- call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
+
+retry:
+ err = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
+ if (err == -ENOMEM) {
+ schedule();
+ goto retry;
+ }
kfree(pathbuf);
mutex_lock(&cgroup_mutex);
spin_lock(&release_list_lock);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2008-05-06 11:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-06 11:02 KOSAKI Motohiro [this message]
2008-05-06 12:43 ` Andi Kleen
2008-05-06 13:02 ` KOSAKI Motohiro
2008-05-06 18:32 ` Andi Kleen
2008-05-06 20:19 ` KOSAKI Motohiro
2008-05-07 5:08 ` Paul Menage
2008-05-07 7:45 ` KAMEZAWA Hiroyuki
2008-05-07 7:43 ` Paul Menage
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080506195216.4A6D.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox