All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Efremov <efremov@linux.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org
Subject: Re: [Cocci] [PATCH] coccinelle: api: add kvfree script
Date: Sat, 6 Jun 2020 00:15:03 +0300	[thread overview]
Message-ID: <43cead50-05f8-67ce-c1de-ce3acefb0dec@linux.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2006052249160.28300@hadrien>

On 6/5/20 11:51 PM, Julia Lawall wrote:
> Is there a strong reason for putting the choice rule first?  It may make
> things somewhat slower than necessary, if it matches in many places,
> because the opportunity rule will have to detect that it doesn't care
> about all of those places.

No, I didn't know that order of rules matters. I just checked it, my PC
shows no difference in exec time if I swap these rules.

"choice" doesn't check the size. "opportunity" is more strict.
The motivation for adding 2 rules is that we could recommend to use
kvmalloc* only when there is a size condition. At the same time, we
should skip all if (...) {kmalloc()} else {vmalloc()},
res = kmalloc() if (!res) {vmalloc()} cases as false positives.

It seems that it's not possible to use subexpression rule
"expression size <= choice.E" in this case.

> Also, there is no need to exceed 80 characters here.  You can put a
> newline in the middle of a \( ... \)

Ok, I will fix it in v2 after all comments/suggestions.

Thanks,
Denis
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

WARNING: multiple messages have this Message-ID (diff)
From: Denis Efremov <efremov@linux.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org
Subject: Re: [Cocci] [PATCH] coccinelle: api: add kvfree script
Date: Sat, 6 Jun 2020 00:15:03 +0300	[thread overview]
Message-ID: <43cead50-05f8-67ce-c1de-ce3acefb0dec@linux.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2006052249160.28300@hadrien>

On 6/5/20 11:51 PM, Julia Lawall wrote:
> Is there a strong reason for putting the choice rule first?  It may make
> things somewhat slower than necessary, if it matches in many places,
> because the opportunity rule will have to detect that it doesn't care
> about all of those places.

No, I didn't know that order of rules matters. I just checked it, my PC
shows no difference in exec time if I swap these rules.

"choice" doesn't check the size. "opportunity" is more strict.
The motivation for adding 2 rules is that we could recommend to use
kvmalloc* only when there is a size condition. At the same time, we
should skip all if (...) {kmalloc()} else {vmalloc()},
res = kmalloc() if (!res) {vmalloc()} cases as false positives.

It seems that it's not possible to use subexpression rule
"expression size <= choice.E" in this case.

> Also, there is no need to exceed 80 characters here.  You can put a
> newline in the middle of a \( ... \)

Ok, I will fix it in v2 after all comments/suggestions.

Thanks,
Denis

  reply	other threads:[~2020-06-05 21:15 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 20:42 [Cocci] [PATCH] coccinelle: api: add kvfree script Denis Efremov
2020-06-05 20:42 ` Denis Efremov
2020-06-05 20:51 ` [Cocci] " Julia Lawall
2020-06-05 20:51   ` Julia Lawall
2020-06-05 21:15   ` Denis Efremov [this message]
2020-06-05 21:15     ` Denis Efremov
2020-06-05 21:19     ` Julia Lawall
2020-06-05 21:19       ` Julia Lawall
2020-06-14  9:03   ` Denis Efremov
2020-06-14  9:03     ` Denis Efremov
2020-06-14  9:17     ` Julia Lawall
2020-06-14  9:17       ` Julia Lawall
2020-06-14  9:24       ` Denis Efremov
2020-06-14  9:24         ` Denis Efremov
2020-06-14 18:36 ` [Cocci] [PATCH v2] " Denis Efremov
2020-06-14 18:36   ` Denis Efremov
2020-07-17 12:00   ` [Cocci] " Denis Efremov
2020-07-17 12:00     ` Denis Efremov
2020-07-30 14:01 ` [Cocci] [PATCH v3] " Denis Efremov
2020-07-30 14:01   ` Denis Efremov
2020-07-30 14:05   ` [Cocci] " Denis Efremov
2020-07-30 14:05     ` Denis Efremov
2020-07-30 14:07 ` [Cocci] [PATCH v4] " Denis Efremov
2020-07-30 14:07   ` Denis Efremov
2020-07-30 20:15   ` [Cocci] " Julia Lawall
2020-07-30 20:15     ` Julia Lawall
2020-07-30 20:38   ` [Cocci] " Julia Lawall
2020-07-30 20:38     ` Julia Lawall
2020-07-31  8:31     ` [Cocci] " Denis Efremov
2020-07-31  8:31       ` Denis Efremov
2020-07-31  8:48       ` [Cocci] " Julia Lawall
2020-07-31  8:48         ` Julia Lawall
2020-07-31 10:47 ` [Cocci] [PATCH v5] " Denis Efremov
2020-07-31 10:47   ` Denis Efremov
2020-07-31 21:00 ` [Cocci] [PATCH v6] " Denis Efremov
2020-07-31 21:00   ` Denis Efremov
2020-08-02 20:24   ` [Cocci] " Julia Lawall
2020-08-02 20:24     ` Julia Lawall
2020-08-03 11:33     ` [Cocci] " Denis Efremov
2020-08-03 11:33       ` Denis Efremov
2020-08-03 12:18       ` [Cocci] " Julia Lawall
2020-08-03 12:18         ` Julia Lawall
2020-08-03 11:45   ` [Cocci] " Denis Efremov
2020-08-03 11:45     ` Denis Efremov
2020-08-03 12:12     ` [Cocci] " Julia Lawall
2020-08-03 12:12       ` Julia Lawall
2020-08-03 18:34 ` [Cocci] [PATCH v7] coccinelle: api: add kfree_mismatch script Denis Efremov
2020-08-03 18:34   ` Denis Efremov
2020-09-21 17:15   ` [Cocci] " Denis Efremov
2020-09-21 17:15     ` Denis Efremov
2020-10-15 20:48   ` [Cocci] " Julia Lawall
2020-10-15 20:48     ` Julia Lawall
2020-10-16  8:54 ` [Cocci] [PATCH v8] " Denis Efremov
2020-10-16  8:54   ` Denis Efremov
2020-10-17 21:17   ` [Cocci] " Julia Lawall
2020-10-17 21:17     ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2020-06-06  7:30 [Cocci] [PATCH] coccinelle: api: add kvfree script Markus Elfring
2020-06-06  7:46 ` Julia Lawall
2020-06-06 14:04 Markus Elfring
2020-06-06 14:39 ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43cead50-05f8-67ce-c1de-ce3acefb0dec@linux.com \
    --to=efremov@linux.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@inria.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.