diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 09:03:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 12:42:26 -0700 |
| commit | 743a116a19a1302933c730cad31ff45f271285f1 (patch) | |
| tree | 1c385c5126a0c719bad915a172c62b7db7e0388f /tools/perf/scripts/python/stackcollapse.py | |
| parent | b2d929a1c2a887dd046e0af2d4a06dbf4e7d87a6 (diff) | |
| download | linux-next-743a116a19a1302933c730cad31ff45f271285f1.tar.gz linux-next-743a116a19a1302933c730cad31ff45f271285f1.zip | |
assoc_array: correct the documentation of get_key_chunk()'s level argument
assoc_array.rst says the level passed to get_key_chunk() will be a
multiple of ASSOC_ARRAY_KEY_CHUNK_SIZE, and asks for the chunk starting
at that bit. assoc_array_walk() after a shortcut, and both insertion
paths, pass the level of a node, which is any multiple of 4. Each then
shifts the chunk it gets back right by level & ASSOC_ARRAY_KEY_CHUNK_MASK,
so what it wants is the chunk that contains that bit.
The keyring code copes, because keyring_get_key_chunk() divides the
level by ASSOC_ARRAY_KEY_CHUNK_SIZE before using it. An implementation
written to the documentation does not: one that returns a one-word key
for level 0 and nothing for any other level files leaves under the
wrong slot the first time a node is split, and a later insertion hits
the BUG_ON() after found_slot_for_multiple_occupancy in
assoc_array_insert_into_terminal_node().
Say what the code expects. get_object_key_chunk() is documented as
"the previous function", so this covers it too.
Assisted-by: LLM
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
