From: Naohiro Ooiwa <nooiwa@miraclelinux.com>
To: akpm@linux-foundation.org, oleg@redhat.com, roland@redhat.com
Cc: LKML <linux-kernel@vger.kernel.org>, h-shimamoto@ct.jp.nec.com
Subject: [PATCH] show message when exceeded rlimit of pending signals
Date: Fri, 23 Oct 2009 19:07:06 +0900 [thread overview]
Message-ID: <4AE1804A.2050404@miraclelinux.com> (raw)
Hi Andrew,
I was glad to talk to you in Japan Linux Symposium.
I'm writing about it.
I'm working to support kernel.
Recently, I got a inquiry about unexpected system behavior.
I analyzed application of our customer includeing kernel.
Eventually, there was no bug in application or kernel.
I found the cause was the limit of pending signals.
I ran following command. and system behaved expectedly.
# ulimit -i unlimited
When system behaved unexpectedly, the timer_create() in application
had returned -EAGAIN value.
But we can't imagine the -EAGAIN means that it exceeded limit of
pending signals at all.
Then I thought kernel should at least show some message about it.
And I tried to create a patch.
I'm sure that system engineeres will not have to have the same experience as I did.
How do you think about this idea ?
Thank you
Naohiro Ooiwa.
Signed-off-by: Naohiro Ooiwa <nooiwa@miraclelinux.com>
---
kernel/signal.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 6705320..0bc4934 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -188,6 +188,9 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
return sig;
}
+#define MAX_RLIMIT_CAUTION 5
+static int rlimit_caution_count = 0;
+
/*
* allocate a new signal queue record
* - this may be called without locks if and only if t == current, otherwise an
@@ -211,6 +214,16 @@ static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags,
atomic_read(&user->sigpending) <=
t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur)
q = kmem_cache_alloc(sigqueue_cachep, flags);
+ else {
+ if (rlimit_caution_count <= MAX_RLIMIT_CAUTION ){
+ printk(KERN_WARNING "reached the limit of pending signalis on pid %d\n", current->pid);
+ /* Last time, show the advice */
+ if (rlimit_caution_count == MAX_RLIMIT_CAUTION)
+ printk(KERN_WARNING "If unexpected your system behavior, you can try ulimit -i unlimited\n");
+ rlimit_caution_count++;
+ }
+ }
+
if (unlikely(q == NULL)) {
atomic_dec(&user->sigpending);
free_uid(user);
--
1.5.4.1
next reply other threads:[~2009-10-23 10:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 10:07 Naohiro Ooiwa [this message]
2009-10-23 11:46 ` [PATCH] show message when exceeded rlimit of pending signals Ingo Molnar
2009-10-24 7:02 ` Naohiro Ooiwa
2009-10-24 8:56 ` Naohiro Ooiwa
2009-10-24 8:58 ` Ingo Molnar
2009-10-26 10:17 ` nooiwa
2009-10-26 11:38 ` Ingo Molnar
2009-10-26 16:37 ` Roland McGrath
2009-10-26 16:39 ` Naohiro Ooiwa
2009-10-26 20:28 ` Ingo Molnar
2009-10-27 2:58 ` Naohiro Ooiwa
2009-10-27 4:36 ` Hiroshi Shimamoto
2009-10-27 8:27 ` nooiwa
2009-10-23 21:07 ` Roland McGrath
2009-10-24 8:27 ` Naohiro Ooiwa
-- strict thread matches above, loose matches on Subject: below --
2009-10-30 11:36 Naohiro Ooiwa
2009-10-30 21:33 ` Andrew Morton
2009-10-30 21:45 ` Joe Perches
2009-10-31 7:58 ` Naohiro Ooiwa
2009-10-31 8:50 ` Naohiro Ooiwa
2009-10-31 8:57 ` Andrew Morton
2009-10-31 11:05 ` Naohiro Ooiwa
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=4AE1804A.2050404@miraclelinux.com \
--to=nooiwa@miraclelinux.com \
--cc=akpm@linux-foundation.org \
--cc=h-shimamoto@ct.jp.nec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=roland@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.