From: Christoph Hellwig <hch@lst.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH] Celleb: improve htab lock
Date: Thu, 8 Feb 2007 21:28:02 +0100 [thread overview]
Message-ID: <20070208202802.GA2579@lst.de> (raw)
In-Reply-To: <200702080751.45278.arnd@arndb.de>
On Thu, Feb 08, 2007 at 07:51:44AM +0100, Arnd Bergmann wrote:
> On Thursday 08 February 2007 07:18, Ishizaki Kou wrote:
> > s);
> > +???????local_irq_save(flags);
> > +???????spin_lock(&beat_htab_lock);
> > ????????dummy1 = beat_lpar_hpte_getword0(slot);
> > ?
> > ????????if ((dummy1 & ~0x7FUL) != (want_v & ~0x7FUL)) {
> > ????????????????DBG_LOW("not found !\n");
> > -???????????????spin_unlock_irqrestore(&beat_htab_lock, flags);
> > +???????????????spin_unlock(&beat_htab_lock);
> > +???????????????local_irq_restore(flags);
> > ????????????????return;
> > ????????}
> > ?
> > ????????lpar_rc = beat_write_htab_entry(0, slot, 0, 0, HPTE_V_VALID, 0,
> > ????????????????&dummy1, &dummy2);
> > -???????spin_unlock_irqrestore(&beat_htab_lock, flags);
> > +???????spin_unlock(&beat_htab_lock);
> > +???????local_irq_restore(flags);
>
> The function normally used here would be spin_lock_irq()/spin_unlock_irq(),
> which does spin_{,un}lock along with local_irq_{save,restore}.
But I think the issue here is that we don't want to disable irqs because
we want to protect against IRQ context, but rather because the
hypervisor expects it. Using the separate routines makes this a little
cleaner. Then again a comment explaining why we do it in addition to
the separate routines would be even better. And if this is really the
case doing the disabling inside the spinlock might be more explanative
and reduces the irq disabling time. Also if we're sure that this is
always called from process context and with irqs enabled we should
be using local_irq_disable/local_irq_enable and avoid saving the
flags word.
next prev parent reply other threads:[~2007-02-08 20:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 6:18 [PATCH] Celleb: improve htab lock Ishizaki Kou
2007-02-08 6:51 ` Arnd Bergmann
2007-02-08 20:28 ` Christoph Hellwig [this message]
2007-02-08 20:43 ` Arnd Bergmann
2007-02-08 22:32 ` Benjamin Herrenschmidt
2007-02-09 6:44 ` Akira Iguchi
2007-02-08 22:30 ` Benjamin Herrenschmidt
2007-02-08 21:20 ` Benjamin Herrenschmidt
[not found] <200702090643.l196hHDv006227@toshiba.co.jp>
2007-02-09 6:52 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2007-02-09 7:53 Akira Iguchi
2007-02-09 9:19 ` Arnd Bergmann
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=20070208202802.GA2579@lst.de \
--to=hch@lst.de \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).