[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091109173654.GA8809@redhat.com>
Date: Mon, 9 Nov 2009 18:36:54 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Slaby <jirislaby@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>, Neil Horman <nhorman@...driver.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
marcin.slusarz@...il.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 0/3] extend get/setrlimit to support setting rlimits
external to a process (v7)
On 11/09, Jiri Slaby wrote:
>
> On 11/09/2009 05:40 PM, Oleg Nesterov wrote:
> > Also, I don't understand why wthis code get's both pid and task_struct().
>
> And what do you suggest?
Well, I didn't see this patch, except the part quoted in your email...
(btw, thanks for ccing me).
We can call find_task_by_vpid() under rcu and do get_task_struct().
Or, given that we need tasklist anyway we can do find_task_by_vpid()
under tasklist and do not get() at all.
> > And the "if (resource >= RLIM_NLIMITS)" check is racy afaics, see
> > http://marc.info/?l=linux-kernel&m=125200862124872
>
> Your patch (which I have in my series btw) is likely needed for the
> setprlimit syscall, having this on my mind again from now on. But the
> 'if' above is a different story. 'resource' is an index here.
Yes, thanks, I misread this check ;)
> And as a bonus, what I found out now is that /proc/*/limits
> (proc_info_read->proc_pid_limits) doesn't necessarily reflect current
> limits. Since task_lock(current->group_leader) is not held, values of
> one limit may be from the old as well as the currently updated one.
>
> Am I right and do we care at all
I don't know, but personally I think we don't care.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists