Re: coccinelle: merge two rules from flex_alloc.cocci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Nov 2019 at 22:10, Markus Elfring <Markus.Elfring@xxxxxx> wrote:
>
> >>> This script contained two transformation rules for the semantic patch language
> >>> which used duplicate code.
> >>> Thus combine these rules by using a SmPL disjunction for the replacement
> >>> of two identifiers.
> >
> > My knowledge of coccinelle and cocci rules is basically zero,
>
> Would you like to change this situation eventually?

Possibly, yeah, but I think the key word there is "eventually". ;-)
But maybe I'll learn something from this exchange.

> > but my impression from this list is that running "make coccicheck"
> > can be expensive, both in terms of time and memory.
>
> The desired source code analysis to detect possible software transformations
> needs additional data processing resources.
> It is usually hoped that corresponding efforts will help with development
> approaches at other places.

Right. So by that logic, if this patch doubles the memory usage and/or time
consumption of "make coccicheck", wouldn't this patch be affecting those
other activities at other places of the code negatively? ;-)

I'm not saying that this patch DOES affect the time/memory usage
negatively, and I'm not saying this patch IS a net negative. Definitely
not. It's just that considering, e.g., 960154b9c1 ("coccicheck:
optionally batch spatch invocations", 2019-05-06), time/memory
consumption -- and the balancing of the two -- seems to be an actual
real-world issue here, worth thinking about.

(That commit message mentions that processing all source files in one go
requires close to 2GB of memory. We've since started processing more
files.)

> > Do these patches help there in any way?
>
> I hope so to some degree.

If you could have some before/after numbers, that would be cool. If you
collect your patches into one series, you could at least do measurements
before/after the series.

Or if you could make some other sort of claim around "this shouldn't
affect this-or-that because so-and-so".

> How much do you care to avoid code duplication?

I tend to like it, everything else equal.

> > Or could they hurt?
>
> I assume that you ask according to the presented change possibilities
> for Git's SmPL scripts (and not only for “flex_alloc.cocci”).
>
> Some changes usually contain the risk for undesirable effects.
> Would you like to clarify each of them in more detail?

Do you mean whether I would like to clarify the risks I see, or do you
mean whether I would like you to clarify which you see? I've tried to
clarify the one I see -- based on passively observing cocci-related
patches floating around this list. If you see other potential risks,
feel free to mention them.

You seem to know lots more than I do about these things. I wouldn't be
surprised if you know more on this than most or all other participants
on this list, so feel free to share some of that in the commit messages
so that others can understand how you've reasoned.

Martin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux