lkml.org 
[lkml]   [2009]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 4/4] ipc: sem optimise simple operations
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


\
 
 \ /
  Last update: 2009-08-14 20:49    [W:1.157 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site