[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110328133602.GA8612@redhat.com>
Date: Mon, 28 Mar 2011 15:36:02 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Matt Fleming <matt@...sole-pimps.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: __lock_task_sighand() and RCU
Hi Matt,
On 03/28, Matt Fleming wrote:
>
> I've been reading __lock_task_sighand() and I can't quite wrap my head
> around what the rcu_read_lock()/rcu_read_unlock() is protecting in
> there.
It protects ->sighand.
> Initially I assumed that it was protecting the 'tsk' argument,
No. the caller must have a reference.
> Then I wondered if it was protecting the sighand from being freed from
> under us while we're trying to lock it.
Yes,
> But sighands aren't freed via
> rcu,
it is ;)
> it's just a simple refcnt and kmem_cache_free()
Yes, but please note that sighand_cachep was created with
SLAB_DESTROY_BY_RCU.
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