[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100511142149.83bb3538.akpm@linux-foundation.org>
Date: Tue, 11 May 2010 14:21:49 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Manfred Spraul <manfred@...orfullife.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Chris Mason <chris.mason@...cle.com>,
Zach Brown <zach.brown@...cle.com>,
Jens Axboe <jens.axboe@...cle.com>,
Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH 2/2] ipc/sem.c: move wake_up_process out of the spinlock
section
On Wed, 28 Apr 2010 21:06:27 +0200
Manfred Spraul <manfred@...orfullife.com> wrote:
> The wake-up part of semtimedop() consists out of two steps:
> - the right tasks must be identified.
> - they must be woken up.
>
> Right now, both steps run while the array spinlock is held.
> This patch reorders the code and moves the actual wake_up_process()
> behind the point where the spinlock is dropped.
>
> The code also moves setting sem->sem_otime to one place: It does not
> make sense to set the last modify time multiple times.
ipc/sem.c: In function 'update_queue':
ipc/sem.c:545: warning: 'retval' may be used uninitialized in this function
which indeed was a bug.
--- a/ipc/sem.c~ipc-semc-move-wake_up_process-out-of-the-spinlock-section-fix-2
+++ a/ipc/sem.c
@@ -542,7 +542,7 @@ static int update_queue(struct sem_array
struct list_head *walk;
struct list_head *pending_list;
int offset;
- int retval;
+ int retval = 0;
/* if there are complex operations around, then knowing the semaphore
* that was modified doesn't help us. Assume that multiple semaphores
_
But I worry that the patch which you sent might not have been the one
which you tested.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists