lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] coccinelle: mini_lock: improve performance
2018-05-21 15:58 GMT+09:00 Julia Lawall <Julia.Lawall@lip6.fr>:
> Replace <+... ...+> by ... when any. <+... ...+> is slow, and in some
> obscure cases involving backward jumps it doesn't force the unlock to
> actually come after the end of the if.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---

Applied to linux-kbuild. Thanks!

> scripts/coccinelle/locks/mini_lock.cocci | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccinelle/locks/mini_lock.cocci b/scripts/coccinelle/locks/mini_lock.cocci
> index 47f649b..19c6ee5 100644
> --- a/scripts/coccinelle/locks/mini_lock.cocci
> +++ b/scripts/coccinelle/locks/mini_lock.cocci
> @@ -67,12 +67,14 @@ identifier lock,unlock;
> @@
>
> *lock(E1@p,...);
> -<+... when != E1
> +... when != E1
> + when any
> if (...) {
> ... when != E1
> * return@r ...;
> }
> -...+>
> +... when != E1
> + when any
> *unlock@up(E1,...);
>
> @script:python depends on org@
>



--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2018-05-22 16:24    [W:0.078 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site