Re: [PATCH RFC v2 1/4] cgroup: implement eventfd-based generic API for notifications

From: Kirill A. Shutemov
Date: Tue Dec 15 2009 - 10:03:49 EST


On Tue, Dec 15, 2009 at 11:35 AM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> On Tue, 15 Dec 2009 11:11:16 +0200
> "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> wrote:
>
>> Could anybody review the patch?
>>
>> Thank you.
>
> some nitpicks.
>
>>
>> On Sat, Dec 12, 2009 at 12:59 AM, Kirill A. Shutemov
>> <kirill@xxxxxxxxxxxxx> wrote:
>
>> > + Â Â Â /*
>> > + Â Â Â Â* Unregister events and notify userspace.
>> > + Â Â Â Â* FIXME: How to avoid race with cgroup_event_remove_work()
>> > + Â Â Â Â* Â Â Â Âwhich runs from workqueue?
>> > + Â Â Â Â*/
>> > + Â Â Â mutex_lock(&cgrp->event_list_mutex);
>> > + Â Â Â list_for_each_entry_safe(event, tmp, &cgrp->event_list, list) {
>> > + Â Â Â Â Â Â Â cgroup_event_remove(event);
>> > + Â Â Â Â Â Â Â eventfd_signal(event->eventfd, 1);
>> > + Â Â Â }
>> > + Â Â Â mutex_unlock(&cgrp->event_list_mutex);
>> > +
>> > +out:
>> > Â Â Â Âreturn ret;
>> > Â}
>
> How ciritical is this FIXME ?
> But Hmm..can't we use RCU ?

It's not reasonable to have RCU here, since event_list isn't mostly-read.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/