public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] reader-writer livelock problem
Date: Fri, 08 Nov 2002 19:19:07 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805373@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805355@msgid-missing>

On Fri, Nov 08, 2002 at 12:05:30PM -0600, Van Maren, Kevin wrote:
> Absolutely you should minimize the locking contention.
> However, that isn't always possible, such as when you
> have 64 processors contending on the same resource.

if you've got 64 processors contending on the same resource, maybe you
need to split that resource up so they can have a copy each.  all that
cacheline bouncing can't do your numa boxes any good.

> With the current kernel, the trivial example with reader/
> writer locks was having them all call gettimeofday().

i hear x86-64 has a lockless gettimeofday.  maybe that's the solution.

> But try having 64 processors fstat() the same file,
> which I have also seen happen (application looping,
> waiting for another process to finish setting up the
> file so they can all mmap it).

umm.. the call trace:

sys_fstat
|-> vfs_fstat
|   |-> fget
|	|-> read_lock(&files->file_lock)
|   |-> vfs_getattr
|	|-> inode->i_op->getattr
|	|-> generic_fillattr
|-> cp_new_stat64
    |-> memset
    |-> copy_to_user

so you're talking about contention on files->file_lock, right?  it's really
not the kernel's fault that your app is badly written.  that lock's private
to process & children, so it's not like another application can hurt you.

> What MCS locks do is they reduce the number of times
> the cacheline has to be flung around the system in
> order to get work done: they "scale" much better with
> the number of processors: O(N) instead of O(N^2).

yes, but how slow are they in the uncontended case?

-- 
Revolutions do not require corporate support.


  parent reply	other threads:[~2002-11-08 19:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08  3:23 [Linux-ia64] reader-writer livelock problem Van Maren, Kevin
2002-11-08 17:13 ` Jeremy Fitzhardinge
2002-11-08 17:25 ` Linus Torvalds
2002-11-08 17:28 ` Linus Torvalds
2002-11-08 17:34 ` David Howells
2002-11-08 17:38 ` Jeremy Fitzhardinge
2002-11-08 17:41 ` Van Maren, Kevin
2002-11-08 17:43 ` David Howells
2002-11-08 17:52 ` Matthew Wilcox
2002-11-08 17:54 ` David Howells
2002-11-08 17:55 ` Stephen Hemminger
2002-11-08 18:05 ` Van Maren, Kevin
2002-11-08 19:19 ` Matthew Wilcox [this message]
2002-11-08 19:26 ` David Mosberger
2002-11-08 20:17 ` Van Maren, Kevin
2002-11-08 20:39 ` Matthew Wilcox
2002-11-09  2:48 ` Rusty Russell
2002-11-11 16:29 ` Mario Smarduch
2002-11-11 20:01 ` [Linux-ia64] reader-writer livelock proble Mario Smarduch

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=marc-linux-ia64-105590709805373@msgid-missing \
    --to=willy@debian.org \
    --cc=linux-ia64@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