From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: akpm@linux-foundation.org, greg@kroah.com, matthew@wil.cx,
kay.sievers@vrfy.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH][-mm] reclassify sg_sysfs_class for lockdep
Date: Wed, 28 May 2008 09:40:00 -0500 [thread overview]
Message-ID: <1211985600.3445.14.camel@localhost.localdomain> (raw)
In-Reply-To: <20080527101009.GA3015@darkstar.te-china.tietoenator.com>
On Tue, 2008-05-27 at 18:10 +0800, Dave Young wrote:
> As register sg_interface, the sg_add will be called, which then will
> add device to sg_sysfs_class. This will cause lockdep warning,
> please see following email
>
> In this case the locks are from diffrent classi, one is sdev_class,
> another is sg_sysfs_class
>
> Here reclassify the sg_sysfs_class for lockdep
This isn't really a generic solution, is it? It only works because we
currently only have two users of the interface functions, so if we
reclassify one they look separate to lockdep. It will fall over again
if we ever get another one.
Surely the correct fix is to initialise lockdep for the mutex the same
way we did for the semaphore in class_register() (which does exactly the
same locking without triggering lockdep)? That way we'll also fix the
problem for other conversions of semaphore->mutex.
James
next prev parent reply other threads:[~2008-05-28 14:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-27 10:10 [PATCH][-mm] reclassify sg_sysfs_class for lockdep Dave Young
2008-05-28 14:40 ` James Bottomley [this message]
2008-05-29 0:45 ` Dave Young
2008-05-29 3:25 ` James Bottomley
2008-05-28 14:49 ` Matthew Wilcox
2008-05-28 19:18 ` Andrew Morton
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=1211985600.3445.14.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=hidave.darkstar@gmail.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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