lkml.org 
[lkml]   [2009]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 1/4] ipc/sem.c: optimize if semops fail
This is the first of four patches that reduce the amount of scanning of the
list of pending semaphore operations:
Part 1: if try_atomic_semop failed, then no changes were applied. Thus
no need to restart.
Additionally, this patch correct an incorrect comment.

The changes are from Nick Piggin, the patch is just splitted differently.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
---
ipc/sem.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipc/sem.c b/ipc/sem.c
index 3629ef8..9425817 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -444,13 +444,13 @@ again:
* of the completed operation:
* - if the operation modified the array, then restart from the
* head of the queue and check for threads that might be
- * waiting for semaphore values to become 0.
+ * waiting for the new semaphore values.
* - if the operation didn't modify the array, then just
* continue.
*/
alter = q->alter;
wake_up_sem_queue(q, error);
- if (alter)
+ if (alter && !error)
goto again;
}
}
--
1.6.2.5


\
 
 \ /
  Last update: 2009-08-16 02:53    [W:0.024 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site