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 22:25:22 -0500 [thread overview]
Message-ID: <1212031522.3445.138.camel@localhost.localdomain> (raw)
In-Reply-To: <a8e1da0805281745g31c8217fk860dfe17cc674be5@mail.gmail.com>
On Thu, 2008-05-29 at 08:45 +0800, Dave Young wrote:
> > 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.
>
> Matthew & greg did the work already.
Yes, that was nice of them ...
> >From my original idea I don't want to do this for all classes, and I
> would think it as a rare case.
Hardly ... the fact that it showed up in two different cases indicated
the problem to be more generic.
The root cause of the problem was that mutexes are part of the lockdep
infrastructure whereas semaphores aren't and the dynamic initialisation
of mutexes becomes a lockdep problem unless they're keyed and
initiallised correctly. If you want to do more semaphore->mutex
conversions, it would really be useful for you to understand what was
done and why it was necessary ... because it's going to become necessary
again in others of them.
James
next prev parent reply other threads:[~2008-05-29 3:25 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
2008-05-29 0:45 ` Dave Young
2008-05-29 3:25 ` James Bottomley [this message]
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=1212031522.3445.138.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;
as well as URLs for NNTP newsgroup(s).