<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/Documentation/bpf, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-17T16:44:03Z</updated>
<entry>
<title>bpf: Adjust free target to avoid global starvation of LRU map</title>
<updated>2025-07-17T16:44:03Z</updated>
<author>
<name>Willem de Bruijn</name>
</author>
<published>2025-06-18T21:57:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea34a45b59618b661ad2d5cde13c8e15c3c6441d'/>
<id>urn:sha1:ea34a45b59618b661ad2d5cde13c8e15c3c6441d</id>
<content type='text'>
[ Upstream commit d4adf1c9ee7722545450608bcb095fb31512f0c6 ]

BPF_MAP_TYPE_LRU_HASH can recycle most recent elements well before the
map is full, due to percpu reservations and force shrink before
neighbor stealing. Once a CPU is unable to borrow from the global map,
it will once steal one elem from a neighbor and after that each time
flush this one element to the global list and immediately recycle it.

Batch value LOCAL_FREE_TARGET (128) will exhaust a 10K element map
with 79 CPUs. CPU 79 will observe this behavior even while its
neighbors hold 78 * 127 + 1 * 15 == 9921 free elements (99%).

CPUs need not be active concurrently. The issue can appear with
affinity migration, e.g., irqbalance. Each CPU can reserve and then
hold onto its 128 elements indefinitely.

Avoid global list exhaustion by limiting aggregate percpu caches to
half of map size, by adjusting LOCAL_FREE_TARGET based on cpu count.
This change has no effect on sufficiently large tables.

Similar to LOCAL_NR_SCANS and lru-&gt;nr_scans, introduce a map variable
lru-&gt;free_target. The extra field fits in a hole in struct bpf_lru.
The cacheline is already warm where read in the hot path. The field is
only accessed with the lru lock held.

Tested-by: Anton Protopopov &lt;a.s.protopopov@gmail.com&gt;
Signed-off-by: Willem de Bruijn &lt;willemb@google.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://lore.kernel.org/r/20250618215803.3587312-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf: Add namespace to BPF internal symbols</title>
<updated>2025-04-25T16:21:23Z</updated>
<author>
<name>Alexei Starovoitov</name>
</author>
<published>2025-04-25T01:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f88886de0927a2adf4c1b4c5c1f1d31d2023ef74'/>
<id>urn:sha1:f88886de0927a2adf4c1b4c5c1f1d31d2023ef74</id>
<content type='text'>
Add namespace to BPF internal symbols used by light skeleton
to prevent abuse and document with the code their allowed usage.

Fixes: b1d18a7574d0 ("bpf: Extend sys_bpf commands for bpf_syscall programs.")
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20250425014542.62385-1-alexei.starovoitov@gmail.com
</content>
</entry>
<entry>
<title>bpf, docs: Fix broken link to renamed bpf_iter_task_vmas.c</title>
<updated>2025-03-15T18:48:56Z</updated>
<author>
<name>T.J. Mercier</name>
</author>
<published>2025-03-04T20:45:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc438a9bc7610f23cca29a21bb5588b3c09d37f0'/>
<id>urn:sha1:dc438a9bc7610f23cca29a21bb5588b3c09d37f0</id>
<content type='text'>
This file was renamed from bpf_iter_task_vma.c.

Fixes: 45b38941c81f ("selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c")
Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Acked-by: Song Liu &lt;song@kernel.org&gt;
Link: https://lore.kernel.org/r/20250304204520.201115-1-tjmercier@google.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs/bpf: Document some special sdiv/smod operations</title>
<updated>2025-02-26T15:54:49Z</updated>
<author>
<name>Yonghong Song</name>
</author>
<published>2024-11-07T17:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b123480eec64dd879785c28f2a2d582d111cfb59'/>
<id>urn:sha1:b123480eec64dd879785c28f2a2d582d111cfb59</id>
<content type='text'>
Patch [1] fixed possible kernel crash due to specific sdiv/smod operations
in bpf program. The following are related operations and the expected results
of those operations:
  - LLONG_MIN/-1 = LLONG_MIN
  - INT_MIN/-1 = INT_MIN
  - LLONG_MIN%-1 = 0
  - INT_MIN%-1 = 0

Those operations are replaced with codes which won't cause
kernel crash. This patch documents what operations may cause exception and
what replacement operations are.

  [1] https://lore.kernel.org/all/20240913150326.1187788-1-yonghong.song@linux.dev/

Signed-off-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/r/20241107170924.2944681-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs/bpf: Document the semantics of BTF tags with kind_flag</title>
<updated>2025-02-06T00:17:59Z</updated>
<author>
<name>Ihor Solodrai</name>
</author>
<published>2025-01-30T20:12:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea70faa1f244ea0bd30f413e4ec7c79a3b5b96f1'/>
<id>urn:sha1:ea70faa1f244ea0bd30f413e4ec7c79a3b5b96f1</id>
<content type='text'>
Explain the meaning of kind_flag in BTF type_tags and decl_tags.
Update uapi btf.h kind_flag comment to reflect the changes.

Signed-off-by: Ihor Solodrai &lt;ihor.solodrai@linux.dev&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20250130201239.1429648-3-ihor.solodrai@linux.dev
</content>
</entry>
<entry>
<title>bpf: Remove trailing whitespace in verifier.rst</title>
<updated>2024-11-11T16:17:48Z</updated>
<author>
<name>Abhinav Saxena</name>
</author>
<published>2024-11-07T06:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5249b164e666cbdea970c88f2f0e5b06577f9e7b'/>
<id>urn:sha1:5249b164e666cbdea970c88f2f0e5b06577f9e7b</id>
<content type='text'>
Remove trailing whitespace in Documentation/bpf/verifier.rst.

Signed-off-by: Abhinav Saxena &lt;xandfury@gmail.com&gt;
Link: https://lore.kernel.org/r/20241107063708.106340-2-xandfury@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs/bpf: Add description of .BTF.base section</title>
<updated>2024-10-29T20:15:36Z</updated>
<author>
<name>Alan Maguire</name>
</author>
<published>2024-10-28T09:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a0cfd8adf81c438b9a0f527fcc3537498441785'/>
<id>urn:sha1:8a0cfd8adf81c438b9a0f527fcc3537498441785</id>
<content type='text'>
Now that .BTF.base sections are generated for out-of-tree kernel
modules (provided pahole supports the "distilled_base" BTF feature),
document .BTF.base and its role in supporting resilient split BTF
and BTF relocation.

Changes since v1:

- updated formatting, corrected typo, used BTF ID[s] consistently
  (Andrii)

Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20241028091543.2175967-1-alan.maguire@oracle.com
</content>
</entry>
<entry>
<title>docs/bpf: Add missing BPF program types to docs</title>
<updated>2024-09-12T17:56:41Z</updated>
<author>
<name>Donald Hunter</name>
</author>
<published>2024-09-12T09:59:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6182e0b80f9b5c8da19ab3a60db2e4cc10b259e8'/>
<id>urn:sha1:6182e0b80f9b5c8da19ab3a60db2e4cc10b259e8</id>
<content type='text'>
Update the table of program types in the libbpf documentation with the
recently added program types.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240912095944.6386-1-donald.hunter@gmail.com
</content>
</entry>
<entry>
<title>docs/bpf: Add constant values for linkages</title>
<updated>2024-09-11T20:47:04Z</updated>
<author>
<name>Will Hawkins</name>
</author>
<published>2024-09-11T05:50:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c229c17a76e9c52950ea345323d5a19993610f57'/>
<id>urn:sha1:c229c17a76e9c52950ea345323d5a19993610f57</id>
<content type='text'>
Make the values of the symbolic constants that define the valid linkages
for functions and variables explicit.

Signed-off-by: Will Hawkins &lt;hawkinsw@obs.cr&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/bpf/20240911055033.2084881-1-hawkinsw@obs.cr
</content>
</entry>
<entry>
<title>docs/bpf: Fix a typo in verifier.rst</title>
<updated>2024-08-29T19:19:30Z</updated>
<author>
<name>Yiming Xiang</name>
</author>
<published>2024-08-29T03:17:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89dd9bb25597621ca0500aa598140ff0858091e2'/>
<id>urn:sha1:89dd9bb25597621ca0500aa598140ff0858091e2</id>
<content type='text'>
In verifier.rst, there is a typo in section 'Register parentage chains'.
Caller saved registers are r0-r5, callee saved registers are r6-r9.

Here by context it means callee saved registers rather than caller saved
registers. This may confuse users.

Signed-off-by: Yiming Xiang &lt;kxiang@umich.edu&gt;
Link: https://lore.kernel.org/r/20240829031712.198489-1-kxiang@umich.edu
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
