From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "Kirill A. Shutemov"
<kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Cgroups <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] cgroup: make cgrp->event_list_lock irqsafe
Date: Wed, 6 Mar 2013 15:15:59 +0800 [thread overview]
Message-ID: <5136ED2F.8080400@huawei.com> (raw)
In-Reply-To: <CAOS58YN9K9OrvvdZjUV9dFOP=SpJYgeyPp0Y5yipNE47osqXpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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(...)
WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
LKML <linux-kernel@vger.kernel.org>,
Cgroups <cgroups@vger.kernel.org>
Subject: Re: [PATCH] cgroup: make cgrp->event_list_lock irqsafe
Date: Wed, 6 Mar 2013 15:15:59 +0800 [thread overview]
Message-ID: <5136ED2F.8080400@huawei.com> (raw)
In-Reply-To: <CAOS58YN9K9OrvvdZjUV9dFOP=SpJYgeyPp0Y5yipNE47osqXpQ@mail.gmail.com>
On 2013/3/6 15:02, Tejun Heo wrote:
> On Tue, Mar 5, 2013 at 11:00 PM, Li Zefan <lizefan@huawei.com> 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(...)
next prev parent reply other threads:[~2013-03-06 7:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 3:28 [PATCH] cgroup: make cgrp->event_list_lock irqsafe Li Zefan
2013-03-06 6:22 ` Tejun Heo
[not found] ` <20130306062224.GJ1227-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-03-06 7:00 ` Li Zefan
2013-03-06 7:00 ` Li Zefan
[not found] ` <5136E9A4.7000201-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-03-06 7:02 ` Tejun Heo
2013-03-06 7:02 ` Tejun Heo
[not found] ` <CAOS58YN9K9OrvvdZjUV9dFOP=SpJYgeyPp0Y5yipNE47osqXpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-06 7:15 ` Li Zefan [this message]
2013-03-06 7:15 ` Li Zefan
[not found] ` <5136ED2F.8080400-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-03-06 7:21 ` Tejun Heo
2013-03-06 7:21 ` Tejun Heo
[not found] ` <CAOS58YNJd557hGDMGqavp8eq+B9x5WExCcpW+CwZ8dUainjUUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-06 7:23 ` Tejun Heo
2013-03-06 7:23 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5136ED2F.8080400@huawei.com \
--to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.