Re: [PATCH] cgroups: fix probable race with put_css_set[_taskexit] and find_css_set

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul Menage
Date: Wednesday, September 10, 2008 - 8:03 am

On Tue, Sep 9, 2008 at 11:29 PM, Greg KH <greg@kroah.com> wrote:

Right - that's why a kref_put_and_write_lock() function would be handy
- it would take the lock only when necessary. It would delegate most
of its work to the (as-yet nonexistant) atomic_dec_and_write_lock()
function, which would be an rwlock equivalent of atomic_dec_and_lock()


It's basically the same situation as the dentry cache - ref-counted
objects that are also referenced from a hash table protected by a
global lock.

If you're opposed to the addition of kref_put_and_write_lock() then
yes, I'll replace kref with a custom refcount.

Paul
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] cgroups: fix probable race with put_css_set[_t ..., Paul Menage, (Wed Sep 10, 8:03 am)