All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Remove rwsem limitation of 32k waiters
Date: Mon, 22 Aug 2005 20:18:30 +0000	[thread overview]
Message-ID: <20050822201830.GB3150@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.62.0508221215370.7633@schroedinger.engr.sgi.com>

On Mon, Aug 22, 2005 at 12:38:45PM -0700, Christoph Lameter wrote:
> On Mon, 22 Aug 2005, Matthew Wilcox wrote:
> > Why not just change the BIAS value to 0x0010000?  As long as you don't
> > have more than 1024 processors trying to simultaneously acquire the same
> > write lock (and if you do, you have other problems ...), this won't fail
> > and gives you 2^19 waiters.
> 
> The same approach was already chosen by s390 and alpha.
> 
> Changing the bias value reduces the maximum number of waiting 
> processes as you noted. Note "processes" not processors. One processor can 
> have multiple processes waiting on semaphores. These are not spinlocks.

No, but you didn't look at the implementation in lib/rwsem.c.

static inline struct rw_semaphore *
rwsem_down_failed_common(struct rw_semaphore *sem,
                        struct rwsem_waiter *waiter, signed long adjustment)
...
        /* we're now waiting on the lock, but no longer actively read-locking */
        count = rwsem_atomic_update(adjustment, sem);

struct rw_semaphore fastcall __sched *
rwsem_down_write_failed(struct rw_semaphore *sem)
...
        rwsem_down_failed_common(sem, &waiter, -RWSEM_ACTIVE_BIAS);

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

  parent reply	other threads:[~2005-08-22 20:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-22 19:20 [PATCH] Remove rwsem limitation of 32k waiters Christoph Lameter
2005-08-22 19:29 ` Matthew Wilcox
2005-08-22 19:38 ` Christoph Lameter
2005-08-22 20:18 ` Matthew Wilcox [this message]
2005-08-22 20:26 ` Christoph Lameter
2005-08-22 20:31 ` Matthew Wilcox
2005-08-22 20:33 ` Christoph Lameter
2005-08-23  7:05 ` Chen, Kenneth W
2005-08-23 13:39 ` Christoph Lameter
2005-08-23 17:14 ` Chen, Kenneth W

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=20050822201830.GB3150@parcelfarce.linux.theplanet.co.uk \
    --to=matthew@wil.cx \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.