Re: [patch 4/4] ipc: sem optimise simple operations

From: Manfred Spraul
Date: Fri Aug 14 2009 - 14:46:58 EST


On 08/11/2009 01:09 PM, npiggin@xxxxxxx wrote:
@@ -438,23 +448,94 @@ again:
continue;

list_del(&q->list);
+ if (q->nsops == 1)
+ list_del(&q->simple_list);
+ else
+ sma->complex_count--;
+
+ alter = q->alter;
+ wake_up_sem_queue(q, error);
Unlink approach one: list_del() only if q->nsops!=1.

@@ -532,6 +613,9 @@ static void freeary(struct ipc_namespace
/* Wake up all pending processes and let them fail with EIDRM. */
list_for_each_entry_safe(q, tq,&sma->sem_pending, list) {
list_del(&q->list);
+ list_del(&q->simple_list);
+ if (q->nsops> 1)
+ sma->complex_count--;
Unlink approach two: list_del() even if q->nsops==1.
[i.e.: rely on list_del() on an empty list is permitted].

I would merge that into a helper function.

--
Manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/