* [PATCH] oom: add uid to "Killed process" message
@ 2011-06-20 11:04 Frantisek Hrbata
2011-06-20 21:09 ` David Rientjes
0 siblings, 1 reply; 5+ messages in thread
From: Frantisek Hrbata @ 2011-06-20 11:04 UTC (permalink / raw)
To: linux-mm
Cc: linux-kernel, Andrew Morton, David Rientjes, KOSAKI Motohiro,
Minchan Kim, KAMEZAWA Hiroyuki, CAI Qian, lwoodman
Add user id to the oom killer's "Killed process" message, so the user of the
killed process can be identified.
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
mm/oom_kill.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index e4b0991..249a15a 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -427,8 +427,9 @@ static int oom_kill_task(struct task_struct *p, struct mem_cgroup *mem)
/* mm cannot be safely dereferenced after task_unlock(p) */
mm = p->mm;
- pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
- task_pid_nr(p), p->comm, K(p->mm->total_vm),
+ pr_err("Killed process %d (%s) uid: %d, total-vm:%lukB, "
+ "anon-rss:%lukB, file-rss:%lukB\n",
+ task_pid_nr(p), p->comm, task_uid(p), K(p->mm->total_vm),
K(get_mm_counter(p->mm, MM_ANONPAGES)),
K(get_mm_counter(p->mm, MM_FILEPAGES)));
task_unlock(p);
--
1.7.4.4
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] oom: add uid to "Killed process" message
2011-06-20 11:04 [PATCH] oom: add uid to "Killed process" message Frantisek Hrbata
@ 2011-06-20 21:09 ` David Rientjes
2011-06-21 11:36 ` Frantisek Hrbata
0 siblings, 1 reply; 5+ messages in thread
From: David Rientjes @ 2011-06-20 21:09 UTC (permalink / raw)
To: Frantisek Hrbata
Cc: linux-mm, linux-kernel, Andrew Morton, KOSAKI Motohiro,
Minchan Kim, KAMEZAWA Hiroyuki, CAI Qian, lwoodman
On Mon, 20 Jun 2011, Frantisek Hrbata wrote:
> Add user id to the oom killer's "Killed process" message, so the user of the
> killed process can be identified.
>
Notified in what way? Unless you are using the memory controller, there's
no userspace notification that an oom event has happened so nothing would
know to scrape the kernel log for this information.
We've had a long-time desire for an oom notifier, not only at the time of
oom but when approaching it with configurable thresholds, that would
wakeup a userspace daemon that might be polling on notifier. That seems
more useful for realtime notification of an oom event rather than relying
on the kernel log?
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] oom: add uid to "Killed process" message
2011-06-20 21:09 ` David Rientjes
@ 2011-06-21 11:36 ` Frantisek Hrbata
2011-06-21 19:07 ` David Rientjes
0 siblings, 1 reply; 5+ messages in thread
From: Frantisek Hrbata @ 2011-06-21 11:36 UTC (permalink / raw)
To: David Rientjes
Cc: linux-mm, linux-kernel, Andrew Morton, KOSAKI Motohiro,
Minchan Kim, KAMEZAWA Hiroyuki, CAI Qian, lwoodman
On Mon, Jun 20, 2011 at 02:09:19PM -0700, David Rientjes wrote:
> On Mon, 20 Jun 2011, Frantisek Hrbata wrote:
>
> > Add user id to the oom killer's "Killed process" message, so the user of the
> > killed process can be identified.
> >
>
> Notified in what way? Unless you are using the memory controller, there's
> no userspace notification that an oom event has happened so nothing would
> know to scrape the kernel log for this information.
Agreed, but this is not primary about notification, but about the availability of
the information at all, even if it's just in the kernel log and there is no
realtime notification about it. If I'm not missing anything, now you are not
notified if some process is killed neither(unless as you mentioned, you use
eventfd for memory.oom_control). But you can always inspect the kernel log
afterwards when you find out that some process is not running and you want to
know what happened. And here you have the information that the process was
killed by the oom killer.
I guess the uid of the killed process can be identified from the dump_tasks
output, where it is presented along with other info. I think it is handy
to have the uid info directly in the "Killed process" message.
This is used/requested by one of our customers and since I think it's a good
idea to have the uid info presented, I posted the patch here to see what do you
think about it.
Many thanks
>
> We've had a long-time desire for an oom notifier, not only at the time of
> oom but when approaching it with configurable thresholds, that would
> wakeup a userspace daemon that might be polling on notifier. That seems
> more useful for realtime notification of an oom event rather than relying
> on the kernel log?
--
Frantisek Hrbata
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] oom: add uid to "Killed process" message
2011-06-21 11:36 ` Frantisek Hrbata
@ 2011-06-21 19:07 ` David Rientjes
0 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2011-06-21 19:07 UTC (permalink / raw)
To: Frantisek Hrbata
Cc: linux-mm, linux-kernel, Andrew Morton, KOSAKI Motohiro,
Minchan Kim, KAMEZAWA Hiroyuki, CAI Qian, lwoodman
On Tue, 21 Jun 2011, Frantisek Hrbata wrote:
> I guess the uid of the killed process can be identified from the dump_tasks
> output, where it is presented along with other info. I think it is handy
> to have the uid info directly in the "Killed process" message.
>
> This is used/requested by one of our customers and since I think it's a good
> idea to have the uid info presented, I posted the patch here to see what do you
> think about it.
>
I don't feel strongly about it, but I think you could justify adding a lot
of the same information from the tasklist dump to the single "Killed
process" message. The optimal way of getting this information would be
from the tasklist dump.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] oom: add uid to "Killed process" message
@ 2011-06-20 10:16 Frantisek Hrbata
0 siblings, 0 replies; 5+ messages in thread
From: Frantisek Hrbata @ 2011-06-20 10:16 UTC (permalink / raw)
To: linux-mm
Cc: linux-kernel, Andrew Morton, David Rientjes, KOSAKI Motohiro,
Minchan Kim, KAMEZAWA Hiroyuki, CAI Qian, lwoodman
Add user id to the oom killer's "Killed process" message, so the user of the
killed process can be identified.
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
mm/oom_kill.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index e4b0991..249a15a 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -427,8 +427,9 @@ static int oom_kill_task(struct task_struct *p, struct mem_cgroup *mem)
/* mm cannot be safely dereferenced after task_unlock(p) */
mm = p->mm;
- pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
- task_pid_nr(p), p->comm, K(p->mm->total_vm),
+ pr_err("Killed process %d (%s) uid: %d, total-vm:%lukB, "
+ "anon-rss:%lukB, file-rss:%lukB\n",
+ task_pid_nr(p), p->comm, task_uid(p), K(p->mm->total_vm),
K(get_mm_counter(p->mm, MM_ANONPAGES)),
K(get_mm_counter(p->mm, MM_FILEPAGES)));
task_unlock(p);
--
1.7.4.4
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-21 19:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 11:04 [PATCH] oom: add uid to "Killed process" message Frantisek Hrbata
2011-06-20 21:09 ` David Rientjes
2011-06-21 11:36 ` Frantisek Hrbata
2011-06-21 19:07 ` David Rientjes
-- strict thread matches above, loose matches on Subject: below --
2011-06-20 10:16 Frantisek Hrbata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).