From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
LKML <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
Li Zefan <lizf@cn.fujitsu.com>,
Wu Fengguang <fengguang.wu@intel.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: Possible IRQ lock inversion from 2.6.29-Linus-03321-gbe0ea69 (2.6.29-git)
Date: Sat, 28 Mar 2009 14:36:09 +0100 [thread overview]
Message-ID: <200903281436.20086.bzolnier@gmail.com> (raw)
In-Reply-To: <20090327120623.3056c795@bike.lwn.net>
On Friday 27 March 2009, Jonathan Corbet wrote:
> On Fri, 27 Mar 2009 13:54:35 +0100
> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
> > I remember looking a bit more closely into the issue and not seeing
> > the problem with the locking (though I could have missed something):
> >
> > file->f_lock is never taken in hard-irq or soft-irq context and in
> > the only place where file->f_lock is taken with fasync_lock hold we're
> > protected against IRQs by write_lock_irq().
>
> I do think that the warning is spurious at this time.
>
> > [ Despite not being a problem now I think that changing spin_[un]lock()
> > to *_irq() variants for file->f_lock could be (given that it really
> > fixes the warning) more viable long-term solution than adding special
> > lockdep handling (well, it could be that one day file->f_lock is used
> > in soft-irq context and then the irq lock inversion issue will become
> > a real one) and shouldn't incurr performance penalty since we hold it
> > only for a very brief time. ]
>
> We could do that. When I made the change I'd verified that there were
> no users in IRQ context, and I couldn't really see why there should
> be. I'd rather avoid adding all those IRQ disables if I can avoid it.
>
> How about, instead, just reversing the order of lock acquisition in
> fasync_helper()? That would increase the hold time for f_lock, but I
> have a hard time seeing that being a real problem. I'm running with
> the following now; all seems well. I'll send it up in a bit if nobody
> gripes.
This is even better and works just fine here.
Thanks,
Bart
prev parent reply other threads:[~2009-03-28 13:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 5:07 Possible IRQ lock inversion from 2.6.29-Linus-03321-gbe0ea69 (2.6.29-git) Larry Finger
2009-03-27 12:54 ` Bartlomiej Zolnierkiewicz
2009-03-27 18:06 ` Jonathan Corbet
2009-03-27 19:05 ` Larry Finger
2009-03-28 0:32 ` Peter Zijlstra
2009-03-28 13:36 ` Bartlomiej Zolnierkiewicz [this message]
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=200903281436.20086.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=corbet@lwn.net \
--cc=fengguang.wu@intel.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=viro@zeniv.linux.org.uk \
/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