Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check and banner comment

From: Linus Torvalds
Date: Thu Aug 05 2010 - 16:27:32 EST

On Thu, Aug 5, 2010 at 1:13 PM, Eric W. Biederman <ebiederm@xxxxxxxxxxxx> 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?

> 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)").

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at