lkml.org 
[lkml]   [2013]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ipc/sem.c: fix lockup, restore FIFO behavior
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


\
 
 \ /
  Last update: 2013-05-25 16:41    [W:0.054 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site