public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
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:00:52 +0800	[thread overview]
Message-ID: <5136E9A4.7000201@huawei.com> (raw)
In-Reply-To: <20130306062224.GJ1227-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>

On 2013/3/6 14:22, Tejun Heo wrote:
> Hello, Li.
> 
> On Wed, Mar 06, 2013 at 11:28:01AM +0800, Li Zefan wrote:
>> cgroup_event_wake() is called with hardirq-safe wqh->lock held, so
>> the nested cgrp->event_list_lock should also be hardirq-safe.
>>
>> Fortunately I don't think the deadlock can happen in real life.
>>
>> Lockdep never complained, maybe because it never found wqh->lock was
>> held in irq context?
> 
> 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.

> Locks which are grabbed with irq disabled aren't
> necessarily irq context locks as that doesn't lead to deadlocks.  They
> need to be actually grabbed from irq context.
> 
> Thanks.
> 

  parent reply	other threads:[~2013-03-06  7:00 UTC|newest]

Thread overview: 7+ 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 [this message]
     [not found]       ` <5136E9A4.7000201-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-03-06  7:02         ` Tejun Heo
     [not found]           ` <CAOS58YN9K9OrvvdZjUV9dFOP=SpJYgeyPp0Y5yipNE47osqXpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-06  7:15             ` Li Zefan
     [not found]               ` <5136ED2F.8080400-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-03-06  7:21                 ` Tejun Heo
     [not found]                   ` <CAOS58YNJd557hGDMGqavp8eq+B9x5WExCcpW+CwZ8dUainjUUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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=5136E9A4.7000201@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox