public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: Greg KH <greg@kroah.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-scsi@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: lockdep whine in 2.6.26-rc2-mm1
Date: Mon, 19 May 2008 04:23:44 -0600	[thread overview]
Message-ID: <20080519102343.GB2638@parisc-linux.org> (raw)
In-Reply-To: <a8e1da0805182220y23412047g4969e3906a4c5aca@mail.gmail.com>

On Mon, May 19, 2008 at 01:20:33PM +0800, Dave Young wrote:
> On Sat, May 17, 2008 at 6:14 PM, Dave Young <hidave.darkstar@gmail.com> wrote:
> > On 5/15/08, Matthew Wilcox <matthew@wil.cx> wrote:
> >> On Thu, May 15, 2008 at 05:01:01PM +0800, Dave Young wrote:
> >>> > The classes are different here, first sdev_class, then sg_sysfs_class
> >>
> >> Oh ... right.  I misread scsi_register_interface as
> >> class_register_interface.
> >>
> >>> Greg, what about using mutex_lock_nested to silence lockdep? They are
> >>> the only usage of class->mutex out of class.c
> >>
> >> I don't see how we prove that, for example, you can never take the
> >> sg_sysfs_class mutex and then take the sdev_class mutex.
> >
> > Sorry for my delay. AFAIK, there's no this kind of use.

The question isn't whether there is or isn't this kind of use right now.
The question is whether there might be this kind of use in the future,
and if there is, whether we'd like lockdep to warn us.

> I rechecked the class_interface use, the users are scsi and pcmcia.
> 
> The two classes could call device_add/del while doing
> class_interface_register/unregister is :
> sg_sysfs_class
> pcmcia_socket_class
> 
> So is it possible to reset their lock_class instead of do __mutex_init
> for all classes?

Again, it's not about current usage, it's about future usage.  Why do
you want all sysfs classes to have the same lockdep class?  There can
be good reasons.  For example, if two locks are conceptually the same,
keeping them in the same class helps you find AB-BA problems earlier.

Is there a reason you don't like my idea?

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2008-05-19 10:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14  7:09 lockdep whine in 2.6.26-rc2-mm1 Andrew Morton
2008-05-14 15:56 ` Greg KH
2008-05-14 16:24   ` Matthew Wilcox
2008-05-15  5:47     ` Dave Young
2008-05-15  9:01       ` Dave Young
2008-05-15 11:52         ` Matthew Wilcox
2008-05-17 10:14           ` Dave Young
2008-05-19  5:20             ` Dave Young
2008-05-19  7:56               ` Dave Young
2008-05-19 10:23               ` Matthew Wilcox [this message]
2008-05-20  1:27                 ` Dave Young
2008-05-20  1:51                   ` Matthew Wilcox
2008-05-20 18:07                   ` Greg KH
2008-05-21  3:20                     ` Dave Young
2008-05-21  4:38                       ` Greg KH
2008-05-15  5:50   ` Dave Young

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=20080519102343.GB2638@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=hidave.darkstar@gmail.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-scsi@vger.kernel.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