git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: coccinelle: merge two rules from flex_alloc.cocci

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Nov 14, 2019, 06:37 UTC
Message-ID
<CAN0heSqyGwkeGKv0m_gLDooaUp=gN2_tD7kJYNxeL7LALiPRhQ@mail.gmail.com>
In-Reply-To
<ff240bc1-ae2a-17e5-d149-2d08c5367e96@web.de>
On Wed, 13 Nov 2019 at 22:10, Markus Elfring <Markus.Elfring@web.de> wrote:
Show 9 quoted lines
>
> >>> 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.

Show 7 quoted lines
> > 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.
Show 7 quoted lines
> > 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
Previous: Markus ElfringNext: Markus Elfring
Message 5 of 9 in “coccinelle: merge two rules from flex_alloc.cocci”
  1. coccinelle: merge two rules from flex_alloc.cocciMarkus Elfring, Nov 12, 2019
  2. Denton LiuNov 12, 2019
  3. Martin ÅgrenNov 13, 2019
  4. Markus ElfringNov 13, 2019
  5. Martin ÅgrenNov 14, 2019
  6. Markus ElfringNov 14, 2019
  7. SZEDER GáborNov 14, 2019
  8. Markus ElfringNov 14, 2019
  9. Junio C HamanoNov 15, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.