From: "Figo.zhang" <zhangtianfei@leadcoretech.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] oom: create a resource limit for oom_adj
Date: Thu, 11 Nov 2010 13:19:05 +0800 [thread overview]
Message-ID: <4CDB7CC9.9040203@leadcoretech.com> (raw)
> if (oom_adjust< task->signal->oom_adj&& !capable(CAP_SYS_RESOURCE)) {
> - err = -EACCES;
> - goto err_sighand;
> + /* convert oom_adj [15,-17] to rlimit style value [1,33] */
> + long oom_rlim = OOM_ADJUST_MAX + 1 - oom_adjust;
> +
> + if (oom_rlim> task->signal->rlim[RLIMIT_OOMADJ].rlim_cur) {
> + unlock_task_sighand(task,&flags);
> + put_task_struct(task);
> + err = -EACCES;
> + goto err_sighand;
> + }
> }
=> Label "err_sighand" have do that, why are you do that on here?
+ err = -EACCES;
+ goto err_sighand;
+ }
}
next reply other threads:[~2010-11-11 5:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 5:19 Figo.zhang [this message]
[not found] <fNx73-1cI-1@gated-at.bofh.it>
[not found] ` <fNzVf-5UY-3@gated-at.bofh.it>
[not found] ` <fNKdY-6FU-11@gated-at.bofh.it>
[not found] ` <fNMps-1S1-21@gated-at.bofh.it>
2010-11-11 23:15 ` [PATCH] oom: create a resource limit for oom_adj Bodo Eggert
2010-11-11 23:21 ` David Rientjes
2010-11-14 5:07 ` KOSAKI Motohiro
2010-11-14 21:42 ` David Rientjes
2010-11-23 7:16 ` KOSAKI Motohiro
-- strict thread matches above, loose matches on Subject: below --
2010-11-11 4:35 Mandeep Singh Baines
2010-11-11 7:35 ` David Rientjes
2010-11-11 18:30 ` Mandeep Singh Baines
2010-11-11 20:57 ` David Rientjes
2010-11-11 22:25 ` Mandeep Singh Baines
2010-11-11 23:19 ` David Rientjes
2010-11-11 23:56 ` Mandeep Singh Baines
2010-11-14 5:07 ` KOSAKI Motohiro
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=4CDB7CC9.9040203@leadcoretech.com \
--to=zhangtianfei@leadcoretech.com \
--cc=linux-kernel@vger.kernel.org \
/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