All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.com>,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	hhuang@redhat.com, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] ipc/sem.c: fix lockup, restore FIFO behavior
Date: Sat, 25 May 2013 09:49:26 -0400	[thread overview]
Message-ID: <51A0C166.4000503@redhat.com> (raw)
In-Reply-To: <1369472095-30195-1-git-send-email-manfred@colorfullife.com>

On 05/25/2013 04:54 AM, Manfred Spraul wrote:
> Hi Rik,
>
> I came up with a completely different approach:
>
> The patch
> a) fixes a lockup due to a missing restart.
> b) makes the code again FIFO.
>
> Changes:
> - the wait-for-zero operations are moved into seperate lists. Thus they can
>    be checked seperately, without rescanning the whole queue.
> - If a complex operating arrives, then all pending change operations are
>    moved into the global queue. This allows to keep everything FIFO.
>
> Advantage:
> - Fewer restarts in update_queue(), because pending wait-for-zero do not
>    force a restart anymore.
> - Efficient handling of wait-for-zero semops, both simple and complex.
> - FIFO. Dropping FIFO is a user visible change, and I'm a coward.
> - simpler check_restart logic.
>
> Disadvantage:
> When one complex operation arrives, then the semaphore array goes into a
> complex_present mode that always acquires the global lock. Even when the
> complex operations have completed, pending simple decrease operations
> prevent the array from switching back. The switch happens when
> there are only simple wait-for-zero semops (or no semops at all).
>
> But: Let's wait if this really exists: An application that does rarely
> complex operations (and that doesn't prefer FIFO semantics).

I do not like that downside at all.

The danger of staying in "too slow to be useful" mode forever
is really not a risk I want to take.

-- 
All rights reversed

  reply	other threads:[~2013-05-25 13:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25  8:54 [PATCH] ipc/sem.c: fix lockup, restore FIFO behavior Manfred Spraul
2013-05-25 13:49 ` Rik van Riel [this message]
2013-05-25 15:16   ` Manfred Spraul

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=51A0C166.4000503@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.com \
    --cc=davidlohr.bueso@hp.com \
    --cc=hhuang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=torvalds@linux-foundation.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.