From: "Figo.zhang" <zhangtianfei@leadcoretech.com>
To: David Rientjes <rientjes@google.com>
Cc: figo zhang <figo1802@gmail.com>,
lkml <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: Re:[PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus
Date: Thu, 04 Nov 2010 12:42:10 +0800 [thread overview]
Message-ID: <1288845730.2102.11.camel@myhost> (raw)
In-Reply-To: <alpine.DEB.2.00.1011031952110.28251@chino.kir.corp.google.com>
On Wed, 2010-11-03 at 19:54 -0700, David Rientjes wrote:
> On Thu, 4 Nov 2010, Figo.zhang wrote:
>
> > In your new heuristic, you also get CAP_SYS_RESOURCE to protection.
> > see fs/proc/base.c, line 1167:
> > if (oom_score_adj < task->signal->oom_score_adj &&
> > !capable(CAP_SYS_RESOURCE)) {
> > err = -EACCES;
> > goto err_sighand;
> > }
>
> That's unchanged from the old behavior with oom_adj.
>
> > so i want to protect some process like normal process not
> > CAP_SYS_RESOUCE, i set a small oom_score_adj , if new oom_score_adj is
> > small than now and it is not limited resource, it will not adjust, that
> > seems not right?
> >
>
> Tasks without CAP_SYS_RESOURCE cannot lower their own oom_score_adj,
CAP_SYS_RESOURCE == 1 means without resource limits just like a
superuser,
CAP_SYS_RESOURCE == 0 means hold resource limits, like normal user,
right?
a new lower oom_score_adj will protect the process, right?
Tasks without CAP_SYS_RESOURCE, means that it is not a superuser, why
user canot protect it by oom_score_adj?
like i want to protect my program such as gnome-terminal which is
without CAP_SYS_RESOURCE (have resource limits),
[figo@myhost ~]$ ps -ax | grep gnome-ter
Warning: bad ps syntax, perhaps a bogus '-'? See
http://procps.sf.net/faq.html
2280 ? Sl 0:01 gnome-terminal
8839 pts/0 S+ 0:00 grep gnome-ter
[figo@myhost ~]$ cat /proc/2280/oom_adj
3
[figo@myhost ~]$ echo -17 > /proc/2280/oom_adj
bash: echo: write error: Permission denied
[figo@myhost ~]$
so, i canot protect my program.
> otherwise it can trivially kill other tasks. They can, however, increase
> their own oom_score_adj so the oom killer prefers to kill it first.
>
> I think you may be confused: CAP_SYS_RESOURCE override resource limits.
WARNING: multiple messages have this Message-ID (diff)
From: "Figo.zhang" <zhangtianfei@leadcoretech.com>
To: David Rientjes <rientjes@google.com>
Cc: figo zhang <figo1802@gmail.com>,
lkml <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: Re:[PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus
Date: Thu, 04 Nov 2010 12:42:10 +0800 [thread overview]
Message-ID: <1288845730.2102.11.camel@myhost> (raw)
In-Reply-To: <alpine.DEB.2.00.1011031952110.28251@chino.kir.corp.google.com>
On Wed, 2010-11-03 at 19:54 -0700, David Rientjes wrote:
> On Thu, 4 Nov 2010, Figo.zhang wrote:
>
> > In your new heuristic, you also get CAP_SYS_RESOURCE to protection.
> > see fs/proc/base.c, line 1167:
> > if (oom_score_adj < task->signal->oom_score_adj &&
> > !capable(CAP_SYS_RESOURCE)) {
> > err = -EACCES;
> > goto err_sighand;
> > }
>
> That's unchanged from the old behavior with oom_adj.
>
> > so i want to protect some process like normal process not
> > CAP_SYS_RESOUCE, i set a small oom_score_adj , if new oom_score_adj is
> > small than now and it is not limited resource, it will not adjust, that
> > seems not right?
> >
>
> Tasks without CAP_SYS_RESOURCE cannot lower their own oom_score_adj,
CAP_SYS_RESOURCE == 1 means without resource limits just like a
superuser,
CAP_SYS_RESOURCE == 0 means hold resource limits, like normal user,
right?
a new lower oom_score_adj will protect the process, right?
Tasks without CAP_SYS_RESOURCE, means that it is not a superuser, why
user canot protect it by oom_score_adj?
like i want to protect my program such as gnome-terminal which is
without CAP_SYS_RESOURCE (have resource limits),
[figo@myhost ~]$ ps -ax | grep gnome-ter
Warning: bad ps syntax, perhaps a bogus '-'? See
http://procps.sf.net/faq.html
2280 ? Sl 0:01 gnome-terminal
8839 pts/0 S+ 0:00 grep gnome-ter
[figo@myhost ~]$ cat /proc/2280/oom_adj
3
[figo@myhost ~]$ echo -17 > /proc/2280/oom_adj
bash: echo: write error: Permission denied
[figo@myhost ~]$
so, i canot protect my program.
> otherwise it can trivially kill other tasks. They can, however, increase
> their own oom_score_adj so the oom killer prefers to kill it first.
>
> I think you may be confused: CAP_SYS_RESOURCE override resource limits.
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-11-04 4:45 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 1:43 [PATCH]oom-kill: direct hardware access processes should get bonus Figo.zhang
2010-11-02 1:43 ` Figo.zhang
2010-11-02 3:10 ` David Rientjes
2010-11-02 3:10 ` David Rientjes
2010-11-02 14:24 ` Figo.zhang
2010-11-02 14:24 ` Figo.zhang
2010-11-02 19:34 ` David Rientjes
2010-11-02 19:34 ` David Rientjes
2010-11-03 23:43 ` [PATCH v2]oom-kill: CAP_SYS_RESOURCE " Figo.zhang
2010-11-03 23:43 ` Figo.zhang
2010-11-03 23:47 ` David Rientjes
2010-11-03 23:47 ` David Rientjes
[not found] ` <AANLkTimjfmLzr_9+Sf4gk0xGkFjffQ1VcCnwmCXA88R8@mail.gmail.com>
2010-11-04 1:38 ` Figo.zhang
2010-11-04 1:38 ` Figo.zhang
2010-11-04 1:50 ` David Rientjes
2010-11-04 1:50 ` David Rientjes
2010-11-04 2:12 ` Figo.zhang
2010-11-04 2:12 ` Figo.zhang
2010-11-04 2:54 ` David Rientjes
2010-11-04 2:54 ` David Rientjes
2010-11-04 4:42 ` Figo.zhang [this message]
2010-11-04 4:42 ` Figo.zhang
2010-11-04 5:08 ` David Rientjes
2010-11-04 5:08 ` David Rientjes
2010-11-09 11:01 ` [PATCH " KOSAKI Motohiro
2010-11-09 11:01 ` KOSAKI Motohiro
2010-11-09 12:24 ` Alan Cox
2010-11-09 12:24 ` Alan Cox
2010-11-09 21:06 ` David Rientjes
2010-11-09 21:06 ` David Rientjes
2010-11-09 21:25 ` David Rientjes
2010-11-09 21:25 ` David Rientjes
2010-11-10 14:38 ` Figo.zhang
2010-11-10 14:38 ` Figo.zhang
2010-11-10 20:50 ` David Rientjes
2010-11-10 20:50 ` David Rientjes
2010-11-09 10:41 ` [PATCH]oom-kill: direct hardware access processes " KOSAKI Motohiro
2010-11-09 10:41 ` KOSAKI Motohiro
2010-11-09 12:24 ` [PATCH v2]mm/oom-kill: " Figo.zhang
2010-11-09 12:24 ` Figo.zhang
2010-11-09 21:16 ` David Rientjes
2010-11-09 21:16 ` David Rientjes
2010-11-10 14:48 ` Figo.zhang
2010-11-10 14:48 ` Figo.zhang
2010-11-14 5:07 ` KOSAKI Motohiro
2010-11-14 5:07 ` KOSAKI Motohiro
2010-11-14 21:29 ` David Rientjes
2010-11-14 21:29 ` David Rientjes
2010-11-15 1:24 ` KOSAKI Motohiro
2010-11-15 1:24 ` KOSAKI Motohiro
2010-11-15 10:03 ` David Rientjes
2010-11-15 10:03 ` David Rientjes
2010-11-23 7:16 ` KOSAKI Motohiro
2010-11-23 7:16 ` KOSAKI Motohiro
2010-11-28 1:36 ` David Rientjes
2010-11-28 1:36 ` David Rientjes
2010-11-30 13:00 ` KOSAKI Motohiro
2010-11-30 13:00 ` KOSAKI Motohiro
2010-11-30 20:05 ` David Rientjes
2010-11-30 20:05 ` David Rientjes
2010-11-10 15:14 ` [PATCH v3]mm/oom-kill: " Figo.zhang
2010-11-10 15:14 ` Figo.zhang
2010-11-10 15:24 ` Figo.zhang
2010-11-10 15:24 ` Figo.zhang
2010-11-10 21:00 ` David Rientjes
2010-11-10 21:00 ` David Rientjes
2010-11-14 5:21 ` KOSAKI Motohiro
2010-11-14 5:21 ` KOSAKI Motohiro
2010-11-14 21:33 ` David Rientjes
2010-11-14 21:33 ` David Rientjes
2010-11-15 3:26 ` [PATCH] Revert oom rewrite series Figo.zhang
2010-11-15 3:26 ` Figo.zhang
2010-11-15 10:14 ` David Rientjes
2010-11-15 10:14 ` David Rientjes
2010-11-15 10:57 ` Alan Cox
2010-11-15 10:57 ` Alan Cox
2010-11-15 20:54 ` David Rientjes
2010-11-15 20:54 ` David Rientjes
2010-11-23 7:16 ` KOSAKI Motohiro
2010-11-23 7:16 ` KOSAKI Motohiro
2011-01-04 7:51 ` [PATCH v3]mm/oom-kill: direct hardware access processes should get bonus Figo.zhang
2011-01-04 7:51 ` Figo.zhang
2011-01-04 8:28 ` KAMEZAWA Hiroyuki
2011-01-04 8:28 ` KAMEZAWA Hiroyuki
2011-01-04 8:56 ` Figo.zhang
2011-01-04 8:56 ` Figo.zhang
2011-01-06 0:55 ` KAMEZAWA Hiroyuki
2011-01-06 0:55 ` KAMEZAWA Hiroyuki
2011-01-05 3:32 ` David Rientjes
2011-01-05 3:32 ` David Rientjes
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=1288845730.2102.11.camel@myhost \
--to=zhangtianfei@leadcoretech.com \
--cc=akpm@osdl.org \
--cc=figo1802@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@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 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.