Re: [PATCH] cgroup: make cgrp->event_list_lock irqsafe

Li Zefan
2013-03-06T07:15:59Z

On 2013/3/6 15:02, Tejun Heo wrote:
> On Tue, Mar 5, 2013 at 11:00 PM, Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote:
>>> Why should wqh->lock be hard-irq-safe? Is it actually grabbed from
>>> irq context?
>>
>> becase cgroup_event_wake() is a callback to a wait queue, and it's wake_up()
>> that acquires wqh->lock with irq disabled.
>
> So, acquiring a lock with irq disabled doesn't make it a irq lock.
> Being grabbed *from* irq handler makes it a irq lock. Would the
> wake_up() happen from irq handler?
>

wqh->lock is used through out fs/eventfd.c. I don't know if currently there's
any kernel user using eventfd APIs in an irq handler, but at least that should
be allowed.

wake_up() is also allowed to be called from irq handler?

"allowed" should be enough reason we forbid:

spin_lock_irqsave(...)
spin_lock(...)