Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1656792imm; Tue, 22 May 2018 07:25:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr4WSd5kuytJ7aMPtzTnFyzYZRMidglmmOaq8B8/cUm/p+vh8nk+957kG+U4ajpTHEuhJ4E X-Received: by 2002:a62:c2c7:: with SMTP id w68-v6mr24259172pfk.174.1526999119989; Tue, 22 May 2018 07:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526999119; cv=none; d=google.com; s=arc-20160816; b=Dnkw/xNwImo32dTsMRyq5EGIpgRXynG8fLdH2dEEkK0ujNfBNQkF5CIRcIJe8ssu4u Z5Lj55e9Hpr1UrycQ/8pDICIiFJH7if62c0Fn9/qcC6RH66EtOGB4upfF9GhGE9ahWr7 Ekrq0hsszoyJNyOXXdLXzdL7YZFdcJ5uxjVIoDt0QcS2UwoooL+/DdvoYb7ZcjpTISrA X1vWwiU7PfjpVGnnAH0GAoarLH0NkNV81pe8RWRNp5p6AvOt7YwfMrRBrvt7gVOv8xI7 xPaioT0KhuTuOKgF9UCsuHUvfwCjR157hAHQ3KtJjavl9tLA9oB/aFVcbpfn+F4OjJJj RBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=JBh+PgjnAhOmxkFqcsenTatDGKAKjYwKCYZiBdJBs4g=; b=u7U31V2MqfN7Rk/Jux947DJ7f0T/tEycbYLCBoN8h22Lsz+PWc6B0lyDsMUh1h3fG2 xzr+8FUcNzic6VuYZMoPVwCO/JKdUmjNcosNnYn/bG8tbMV8LJXJvq38+WFqKHcqa1WS tWp+V3qzFthkEBpvZrNY16qnQYBe1DePfwj1gqsSSp8rthTTZPjDaTdgskfg++af7iH/ Bscny1TJzshM7bO/9lgvxGUz1OuYUAzav2xeMcqLDVzCzmHEKO7/d6G8oL48A0p66eTo +VnZiZm/5Havsoc937qCfPXfQlr1/bVCfNMueNmB0Wj61WNvBpWjNRHNOsxH7sCPtfvp kXOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P5BNAZwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si15928627plr.365.2018.05.22.07.24.58; Tue, 22 May 2018 07:25:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P5BNAZwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751371AbeEVOXm (ORCPT + 99 others); Tue, 22 May 2018 10:23:42 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:37037 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbeEVOXl (ORCPT ); Tue, 22 May 2018 10:23:41 -0400 Received: from mail-vk0-f50.google.com (mail-vk0-f50.google.com [209.85.213.50]) (authenticated) by conssluserg-03.nifty.com with ESMTP id w4MENQQh023125; Tue, 22 May 2018 23:23:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w4MENQQh023125 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526999007; bh=JBh+PgjnAhOmxkFqcsenTatDGKAKjYwKCYZiBdJBs4g=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=P5BNAZwve3CtIkxEvltbEnk+B2UQl5MyLXeuuK27p9bzZm8k0e0vzvRxnfT1Vusqz pvK2/oG+2ItQCH7gy8pier2czDs4deA2fnbhHGvAR+XeaZ7hmewbuwWgpwZlC+IKKy 5Cv2mjCo88qXpuux11YwFs/XskMTsrQjk9/VQ41d8nnEHzRNhwBx9ECEusteyhkoVp Ds6q8icGqNMxWS6rLMCbeJv8ieXttFynulOH9+FoEE3eJj2Tmhr8wWzJxxn6MUWmih VZKMhyFbFx5bOS+VXm1LBlyKyi/owisxwANRHdmHDoy4nKKs+cD2/Q6b818b83Ti+s 6sr/cHnkVIbIg== X-Nifty-SrcIP: [209.85.213.50] Received: by mail-vk0-f50.google.com with SMTP id m144-v6so11018323vke.4; Tue, 22 May 2018 07:23:27 -0700 (PDT) X-Gm-Message-State: ALKqPwfVtJ9EWYS6Oh4wsiWYHSDM1jOlhwP8KzbRAmoa28C/t//a6PIV 47Q0GSjN4k8Q2+kjNDjJZBjfPzYLQFaP4lnQ9i8= X-Received: by 2002:a1f:2f8a:: with SMTP id v132-v6mr16407495vkv.34.1526999005900; Tue, 22 May 2018 07:23:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:55d8:0:0:0:0:0 with HTTP; Tue, 22 May 2018 07:22:45 -0700 (PDT) In-Reply-To: <1526885928-1712-1-git-send-email-Julia.Lawall@lip6.fr> References: <1526885928-1712-1-git-send-email-Julia.Lawall@lip6.fr> From: Masahiro Yamada Date: Tue, 22 May 2018 23:22:45 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] coccinelle: mini_lock: improve performance To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-21 15:58 GMT+09:00 Julia Lawall : > 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 > > --- 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