cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: hauke@hauke-m.de (Hauke Mehrtens)
To: cocci@systeme.lip6.fr
Subject: [Cocci] 0079-netdev-destructor.cocci very slow
Date: Tue, 18 Sep 2018 23:52:16 +0200	[thread overview]
Message-ID: <c823a257-4a1e-f3d0-d5a4-4face3c0c85a@hauke-m.de> (raw)
In-Reply-To: <1537262543.2957.19.camel@sipsolutions.net>

On 09/18/2018 11:22 AM, Johannes Berg wrote:
> On Mon, 2018-09-17 at 23:55 +0200, Hauke Mehrtens wrote:
>> The 0079-netdev-destructor.cocci spatch in backports is very slow for
>> me. For bigger files I get a warning that it takes over to 15 seconds to
>> apply it to just one file, for the complete backports tree it takes over
>> an hour to apply.
>>
>> This is the patch:
>> https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git/tree/patches/0079-netdev-destructor.cocci
>>
>> When I remove the <-- --> in the first rule, it is applied in some
>> seconds on the complete tree, so an speed improvement of about 100
>> times, but it is not working correctly any more. ;-)
>>
>> Is this normal or how can I improve the spatch to be faster? I am using
>> coccinelle 1.0.7 build with default configure arguments against the
>> libraries from Debian stable.
> 
> We've had this discussion before :-)
> I think we determined that it was normal.
> 
>> If this is normal I should probably try to reduce the number of files it
>> tries to apply this against in gentree.py before spatch gets started.
> 
> spatch should already try that internally, but perhaps with some extra
> knowledge we can do a better job ...
> 
> johannes
> 
Hi Johannes,

Yes we talked about this topic some months ago in IRC.
If there is really no better solution, then I will grep in all files for
needs_free_netdev and priv_destructor and only apply this to the files
which are matching. This list should be pretty short.

It looks like coccinelle already does such a grep when I remove the <--
--> from the patch, because this is about 100 times faster.

Hauke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20180918/07796208/attachment.asc>

  reply	other threads:[~2018-09-18 21:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 21:55 [Cocci] 0079-netdev-destructor.cocci very slow Hauke Mehrtens
2018-09-18  9:22 ` Johannes Berg
2018-09-18 21:52   ` Hauke Mehrtens [this message]
2018-09-19  8:43     ` Johannes Berg
2018-09-19  8:49       ` Julia Lawall
2018-09-19  9:02         ` Johannes Berg

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=c823a257-4a1e-f3d0-d5a4-4face3c0c85a@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=cocci@systeme.lip6.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).