<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/scripts/kconfig/expr.h, branch v6.12.80</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>kconfig: cache expression values</title>
<updated>2024-09-20T00:21:53+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-09-08T12:43:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=95573cac25c6b11f02d599d18e9a1c778706e838'/>
<id>95573cac25c6b11f02d599d18e9a1c778706e838</id>
<content type='text'>
Cache expression values to avoid recalculating them repeatedly.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cache expression values to avoid recalculating them repeatedly.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: use hash table to reuse expressions</title>
<updated>2024-09-20T00:21:52+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-09-08T12:43:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f93d6bfbd2f74d79041c153a59df5336f6e9a14a'/>
<id>f93d6bfbd2f74d79041c153a59df5336f6e9a14a</id>
<content type='text'>
Currently, every expression in Kconfig files produces a new abstract
syntax tree (AST), even if it is identical to a previously encountered
one.

Consider the following code:

    config FOO
           bool "FOO"
           depends on (A || B) &amp;&amp; C

    config BAR
           bool "BAR"
           depends on (A || B) &amp;&amp; C

    config BAZ
           bool "BAZ"
           depends on A || B

The "depends on" lines are similar, but currently a separate AST is
allocated for each one.

The current data structure looks like this:

  FOO-&gt;dep ==&gt; AND        BAR-&gt;dep ==&gt; AND        BAZ-&gt;dep ==&gt; OR
              /   \                   /   \                   /  \
            OR     C                OR     C                 A    B
           /  \                    /  \
          A    B                  A    B

This is redundant; FOO-&gt;dep and BAR-&gt;dep have identical ASTs but
different memory instances.

We can optimize this; FOO-&gt;dep and BAR-&gt;dep can share the same AST, and
BAZ-&gt;dep can reference its sub tree.

The optimized data structure looks like this:

  FOO-&gt;dep, BAR-&gt;dep ==&gt; AND
                        /   \
         BAZ-&gt;dep ==&gt; OR     C
                     /  \
                    A    B

This commit introduces a hash table to keep track of allocated
expressions. If an identical expression is found, it is reused.

This does not necessarily result in memory savings, as menu_finalize()
transforms expressions without freeing up stale ones. This will be
addressed later.

One optimization that can be easily implemented is caching the
expression's value. Once FOO's dependency, (A || B) &amp;&amp; C, is calculated,
it can be cached, eliminating the need to recalculate it for BAR.

This commit also reverts commit e983b7b17ad1 ("kconfig/menu.c: fix
multiple references to expressions in menu_add_prop()").

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, every expression in Kconfig files produces a new abstract
syntax tree (AST), even if it is identical to a previously encountered
one.

Consider the following code:

    config FOO
           bool "FOO"
           depends on (A || B) &amp;&amp; C

    config BAR
           bool "BAR"
           depends on (A || B) &amp;&amp; C

    config BAZ
           bool "BAZ"
           depends on A || B

The "depends on" lines are similar, but currently a separate AST is
allocated for each one.

The current data structure looks like this:

  FOO-&gt;dep ==&gt; AND        BAR-&gt;dep ==&gt; AND        BAZ-&gt;dep ==&gt; OR
              /   \                   /   \                   /  \
            OR     C                OR     C                 A    B
           /  \                    /  \
          A    B                  A    B

This is redundant; FOO-&gt;dep and BAR-&gt;dep have identical ASTs but
different memory instances.

We can optimize this; FOO-&gt;dep and BAR-&gt;dep can share the same AST, and
BAZ-&gt;dep can reference its sub tree.

The optimized data structure looks like this:

  FOO-&gt;dep, BAR-&gt;dep ==&gt; AND
                        /   \
         BAZ-&gt;dep ==&gt; OR     C
                     /  \
                    A    B

This commit introduces a hash table to keep track of allocated
expressions. If an identical expression is found, it is reused.

This does not necessarily result in memory savings, as menu_finalize()
transforms expressions without freeing up stale ones. This will be
addressed later.

One optimization that can be easily implemented is caching the
expression's value. Once FOO's dependency, (A || B) &amp;&amp; C, is calculated,
it can be cached, eliminating the need to recalculate it for BAR.

This commit also reverts commit e983b7b17ad1 ("kconfig/menu.c: fix
multiple references to expressions in menu_add_prop()").

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: change some expr_*() functions to bool</title>
<updated>2024-09-20T00:21:52+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-09-08T12:43:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d607e0e7a8d2ea6565f11064d28b0825a95748aa'/>
<id>d607e0e7a8d2ea6565f11064d28b0825a95748aa</id>
<content type='text'>
This clarifies the behavior of these functions.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This clarifies the behavior of these functions.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove P_SYMBOL property</title>
<updated>2024-09-01T11:34:48+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-08-12T11:49:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=96490176f1e11947be2bdd2700075275e2c27310'/>
<id>96490176f1e11947be2bdd2700075275e2c27310</id>
<content type='text'>
P_SYMBOL is a pseudo property that was previously used for data linking
purposes.

It is no longer used except for debug prints. Remove it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
P_SYMBOL is a pseudo property that was previously used for data linking
purposes.

It is no longer used except for debug prints. Remove it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: move some helper headers from scripts/kconfig/ to scripts/include/</title>
<updated>2024-07-21T14:10:43+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-07-20T07:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=fbaf242c956aff6a07d9e97eaa3a0a48d947de33'/>
<id>fbaf242c956aff6a07d9e97eaa3a0a48d947de33</id>
<content type='text'>
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/
to scripts/include/.

These headers will be useful for other host programs.

Remove scripts/mod/list.h.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/
to scripts/include/.

These headers will be useful for other host programs.

Remove scripts/mod/list.h.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove SYMBOL_CHOICEVAL flag</title>
<updated>2024-07-16T07:07:14+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-07-07T15:38:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=94a4b0a4cb4340273a2d67be893f9032fe7b7e26'/>
<id>94a4b0a4cb4340273a2d67be893f9032fe7b7e26</id>
<content type='text'>
This flag is unneeded because a choice member can be detected by
other means.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This flag is unneeded because a choice member can be detected by
other means.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: add const qualifiers to several function arguments</title>
<updated>2024-07-16T07:07:14+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-07-07T15:38:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=6425e3b247b1eff04c64091b2af8811d05546a86'/>
<id>6425e3b247b1eff04c64091b2af8811d05546a86</id>
<content type='text'>
Clarify that the given structures are not modified.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clarify that the given structures are not modified.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove E_LIST expression type</title>
<updated>2024-07-15T16:08:37+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-06-18T10:35:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=7c9bb07a6e9439fb7bdeee15eb188fe127a0d0e0'/>
<id>7c9bb07a6e9439fb7bdeee15eb188fe127a0d0e0</id>
<content type='text'>
E_LIST was preveously used to form an expression tree consisting of
choice members.

It is no longer used.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
E_LIST was preveously used to form an expression tree consisting of
choice members.

It is no longer used.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove P_CHOICE property</title>
<updated>2024-07-15T16:08:37+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-06-18T10:35:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=ca4c74ba306e28cebf53908e69b773dcbb700cbc'/>
<id>ca4c74ba306e28cebf53908e69b773dcbb700cbc</id>
<content type='text'>
P_CHOICE is a pseudo property used to link a choice with its members.

There is no more code relying on this, except for some debug code.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
P_CHOICE is a pseudo property used to link a choice with its members.

There is no more code relying on this, except for some debug code.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove expr_list_for_each_sym() macro</title>
<updated>2024-07-15T16:08:37+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-06-18T10:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=8926bc901d617f21d5ebd2eda17aeea55bbecd9a'/>
<id>8926bc901d617f21d5ebd2eda17aeea55bbecd9a</id>
<content type='text'>
All users of this macro have been converted. Remove it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All users of this macro have been converted. Remove it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
