[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A85B167.5000803@colorfullife.com>
Date: Fri, 14 Aug 2009 20:48:07 +0200
From: Manfred Spraul <manfred@...orfullife.com>
To: npiggin@...e.de
CC: Andrew Morton <akpm@...ux-foundation.org>,
Nadia Derbey <Nadia.Derbey@...l.net>,
Pierre Peiffer <peifferp@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [patch 4/4] ipc: sem optimise simple operations
On 08/11/2009 01:09 PM, npiggin@...e.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
--
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