[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091109090143.GB24020@elte.hu>
Date: Mon, 9 Nov 2009 10:01:43 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Jiri Slaby <jirislaby@...il.com>
Cc: 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)
* Jiri Slaby <jirislaby@...il.com> wrote:
> On 11/06/2009 10:26 AM, Ingo Molnar wrote:
> > Also, the locking there looks messy:
> >
> > + /* optimization: 'current' doesn't need locking, e.g. setrlimit */
> > + if (tsk != current) {
> > + /* protect tsk->signal and tsk->sighand from disappearing */
> > + read_lock(&tasklist_lock);
> > + if (!tsk->sighand) {
> > + retval = -ESRCH;
> > + goto out;
> > + }
> > }
> >
> > Neil's splitup into a helper function looks _far_ cleaner.
>
> Oops, I don't understand here. Looking at
> http://patchwork.kernel.org/patch/54863/
> and
> http://decibel.fi.muni.cz/cgi-bin/gitweb.cgi?p=linux.git;a=commitdiff;h=ba9ba971a9241250646091935d77d2f31b7c15af
>
> They are almost identical. That 'if' above is added by:
> http://decibel.fi.muni.cz/cgi-bin/gitweb.cgi?p=linux.git;a=commitdiff;h=bab65b1e6c0fd797a1ecdb32911faa82947effd0
>
> The latter commit is to avoid performance penalty introduced for
> setrlimit syscall by the added lock (as it's unneeded for 'current').
> If you find that crappy, there is no problem to drop it, indeed.
Looks a bit ugly but i agree that it's a real speedup as before this
change we never had to take the tasklist lock for current task rlimit
setting. (which was the only method possible.)
So i guess renaming setrlimit to do_setrlimit and adding the syscall
from Neil's patch should bring the two series into sync, right?
Ingo
--
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