Re: [PATCH 2/2] CRED: Fix __task_cred()'s lockdep check and bannercomment
From: Thomas Gleixner
Date: Tue Aug 03 2010 - 13:49:19 EST
On Tue, 3 Aug 2010, Linus Torvalds wrote:
> Added Oleg and Thomas to the participants.
> Oleg/Thomas: the whole thread is on lkml, but I'm quoting most of the
> relevant parts..
> On Tue, Aug 3, 2010 at 2:34 AM, David Howells <dhowells@xxxxxxxxxx> wrote:
> > A previous patch:
> > commit 8f92054e7ca1d3a3ae50fb42d2253ac8730d9b2a
> > Author: David Howells <dhowells@xxxxxxxxxx>
> > Date: Thu Jul 29 12:45:55 2010 +0100
> > Subject: CRED: Fix __task_cred()'s lockdep check and banner comment
> > fixed the lockdep checks on __task_cred(). This has shown up a place in the
> > signalling code where a lock should be held - namely that
> > check_kill_permission() requires its callers to hold the RCU lock.
> It's not just check_kill_permission(), is it? I thought we could do
> the "for_each_process()" loops with just RCU, rather than holding the
> whole tasklist_lock? So I _think_ that getting the RCU read-lock would
> make it possible to get rid of the tasklist_lock in there too? At
> least in kill_something_info().
> Yes/no? What am I missing? This is an Oleg question, mainly.
Yes, almost all places in the kernel which hold tasklist_lock read
locked are safe with RCU. I started to work on that, but got