From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
Oleg Nesterov <oleg@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org,
Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check and banner comment
Date: Thu, 05 Aug 2010 14:20:36 -0700 [thread overview]
Message-ID: <m1lj8k21uj.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <AANLkTim=VMoC+wG6Hikzic95Avooi=-9Fu=mjSCxNXEZ@mail.gmail.com> (Linus Torvalds's message of "Thu\, 5 Aug 2010 13\:26\:21 -0700")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Thu, Aug 5, 2010 at 1:13 PM, Eric W. Biederman <ebiederm@xmission.com> wrote:
>>
>> I think it is totally reasonable to add a per pid lock,
>> that would protect the pid->task[...] hlist. That would make
>> things clearer and finer grained without a lot of effort. Just
>> a little more struct pid bloat, and a little extra care in fork,
>> when we add to those lists.
>
> Hmm. Have you taken a look at Nick Piggin's VFS scalability patches?
> They introduce this "RCU-safe hash chain lock", where each hashchain
> has a lock-bit in the low bit. I wonder if that would be the right
> thing to use?
Interesting. I haven't looked but a lock bit in the low bit of the
hlist head in struct pid would not add any space, and would not add
any extra cache line bounces. So that would just be a matter of
adding the extra locks and getting the lock ordering correct.
>> Even with the per-pgrp lock we still need a lock on the global process
>> list for the kill -KILL -1 case. Which suggests that tasklist_lock is
>> still needed for part of kill_something_info.
>
> Well, that -1 case is special anyway. The fact that we might want to
> use the tasklist_lock there is not very relevant, I think. That is
> _not_ a hotpath, really (at least not under any relevant loads, I'm
> sure you could make a silly benchmark of "kill(-1,0)").
I expect even signal deliver to process groups is relatively rare.
The interesting question is can we kill the tasklist_lock and/or the
tasklist. A quick grep shows that we have maybe 100 users of the tasklist
in the entire kernel. Poking a little deeper it looks like man of those
are connected to scheduling and are uses that today take the tasklist_lock
but would be fine with the rcu_read_lock().
Eric
next prev parent reply other threads:[~2010-08-05 21:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-29 11:45 [PATCH 1/2] CRED: Fix get_task_cred() and task_state() to not resurrect dead credentials David Howells
2010-07-29 11:45 ` [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check and banner comment David Howells
2010-08-02 20:40 ` Paul E. McKenney
2010-08-03 0:55 ` Tetsuo Handa
2010-08-03 9:34 ` David Howells
2010-08-03 16:07 ` Linus Torvalds
2010-08-03 17:48 ` Thomas Gleixner
2010-08-04 13:17 ` Oleg Nesterov
2010-08-04 14:01 ` David Howells
2010-08-04 15:08 ` Oleg Nesterov
2010-08-04 15:22 ` David Howells
2010-08-04 15:44 ` Oleg Nesterov
2010-08-05 7:19 ` Eric W. Biederman
2010-08-05 16:14 ` Linus Torvalds
2010-08-05 18:16 ` Oleg Nesterov
2010-08-05 20:13 ` Eric W. Biederman
2010-08-05 20:26 ` Linus Torvalds
2010-08-05 21:20 ` Eric W. Biederman [this message]
2010-08-04 0:38 ` Tetsuo Handa
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=m1lj8k21uj.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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