mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob Miller <rem@osdl.org>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.3 remove global semaphore_lock spin lock.
Date: Fri, 1 Feb 2002 12:52:34 -0800	[thread overview]
Message-ID: <20020201125234.A1418@doc.pdx.osdl.net> (raw)
In-Reply-To: <20020131150139.A1345@doc.pdx.osdl.net> <3C59D956.4F2B85DB@zip.com.au>
In-Reply-To: <3C59D956.4F2B85DB@zip.com.au>

On Thu, Jan 31, 2002 at 03:55:02PM -0800, Andrew Morton wrote:
> Bob Miller wrote:
> > 
> > Below is a patch for i386 that replaces the global spin lock semaphore_lock,
> > with the rwlock_t embedded in the wait_queue_head_t in the struct semaphore.
> > 
> 
> Looks sane.  In practice, the speedup is unmeasurable, but...
> 
> > ...
> > +       unsigned long flags;
> > +       wq_write_lock_irqsave(&sem->wait.lock, flags);
> > -       spin_lock_irq(&semaphore_lock);
> 
> I rather dislike spin_lock_irq(), because it's fragile (makes
> assumptions about the caller's state).  But in this case,
> it's probably a reasonable micro-optimisation to not have to
> save the flags.  Nobody should be calling down() with local
> interrupts disabled.
> 
> > ...
> > +/*
> > + * Same as __wake_up but called with the wait_queue_head_t lock held
> > + * in at least read mode.
> > + */
> > +void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr)
> > +{
> > +       if (q) {
> 
> I don't think we need to test `q' here.  It's a new function,
> and we don't need to support broken callers.  So __wake_up_locked()
> can become a macro direct call to __wake_up_common().
> 
> > +               __wake_up_common(q, mode, nr, 0);
> 
> This one breaks the camel's back :)
> 
> Let's un-inline __wake_up_common and EXPORT_SYMBOL it.
> 
> It'd be good if you could also verify that the code still
> works when the use-rwlocks-for-waitqueues option is turned
> on.   (wait.h:USE_RW_WAIT_QUEUE_SPINLOCK)
> 
>  
Thanks for the feed back. I've incorporated your comments.  Also, at your
suggestion I set wait.h:USE_RW_WAIT_QUEUE_SPINLOCK on a clean 2.5.3 system
to test.  The problem is that it OOPs on startup.  After I track that down
and test with my stuff I'll resubmit the patch.

Thanks for taking the time...

-- 
Bob Miller					Email: rem@osdl.org
Open Software Development Lab			Phone: 503.626.2455 Ext. 17

  parent reply	other threads:[~2002-02-01 20:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31 23:01 Bob Miller
2002-01-31 23:55 ` Andrew Morton
2002-02-01  3:41   ` Jeff Garzik
2002-02-01 15:58     ` Jens Axboe
2002-02-01 20:52   ` Bob Miller [this message]
2002-02-01 21:05     ` Andrew Morton
2002-02-01 22:45       ` Bob Miller

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=20020201125234.A1418@doc.pdx.osdl.net \
    --to=rem@osdl.org \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®