mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@karaya.com>
To: timw@splhi.com
Cc: Jonathan Lahr <lahr@sequent.com>,
	Anton Blanchard <anton@linuxcare.com.au>,
	linux-kernel@vger.kernel.org
Subject: Re: kernel lock contention and scalability
Date: Tue, 06 Mar 2001 22:12:17 -0500	[thread overview]
Message-ID: <200103070312.WAA04661@ccure.karaya.com> (raw)
In-Reply-To: Your message of "Tue, 06 Mar 2001 16:28:18 PST." <20010306162818.A1095@kochanski.internal.splhi.com>

timw@splhi.com said:
> If you're a UP system, it never makes sense to spin in userland, since
> you'll just burn up a timeslice and prevent the lock holder from
> running. I haven't looked, but assume that their code only uses
> spinlocks on SMP. If you're an SMP system, then you shouldn't be using
> a spinlock unless the critical section is "short", in which case the
> waiters should simply spin in userland rather than making system calls
> which is simply overhead.

This is a problem that UML is going to have when I turn SMP back on.  
Emulating a multiprocessor box on a UP host with the existing locking 
primitives is going to result in exactly this problem.

> Actually, what's really needed here is an efficient form of
> dynamically marking a process as non-preemptible so that when
> acquiring a spinlock the process can ensure that it exits the critical
> section as fast as possible, when it would relinquish its
> non-preemptible privilege.

That sounds like a pretty fundamental (and abusable) mechanism.

I had a suggestion from an IBM guy at ALS last year to make UML "spin"-locks 
actually sleep in the host (this doesn't make them sleep locks in userspace 
because they don't call schedule), which sounds reasonable.  This gives the 
lock-holder an opportunity to run immediately.  It's unclear to me what the 
wake-up mechanism would be, though.

Another thought I had was to raise the priority of a thread holding a 
spinlock.  This would reduce the chance that it would be preempted by a thread 
that will waste a timeslice spinning on that lock.  I don't know whether this 
is a good idea either.

> Another synchronization method popular with database peeps is "post/
> wait" for which SGI have a patch available for Linux. I understand
> that this is relatively "light weight" and might be a better choice
> for PG. 

URL?

				Jeff



  reply	other threads:[~2001-03-07  2:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-15 18:46 Jonathan Lahr
2001-02-25  9:52 ` Manfred Spraul
2001-03-05 18:41   ` Jonathan Lahr
2001-03-05  0:38 ` Anton Blanchard
2001-03-06 22:45   ` Jonathan Lahr
2001-03-06 23:39     ` Matthew Kirkwood
2001-03-07  0:28       ` Tim Wright
2001-03-07  3:12         ` Jeff Dike [this message]
2001-03-07 22:13           ` Tim Wright
2001-03-08 23:26             ` Jeff Dike
2001-03-11  6:50       ` Anton Blanchard
2001-03-11  6:26     ` Anton Blanchard
     [not found] <98454d$19p9h$1@fido.engr.sgi.com>
2001-03-07  2:55 ` Rajagopal Ananthanarayanan
2001-03-07  5:48   ` Jeff Dike

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=200103070312.WAA04661@ccure.karaya.com \
    --to=jdike@karaya.com \
    --cc=anton@linuxcare.com.au \
    --cc=lahr@sequent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timw@splhi.com \
    /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®