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

Manfred Spraul
2009-08-14T18:46:50Z

On 08/11/2009 01:09 PM, npiggin@suse.de 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