]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/stackdepot: allow users to evict stack traces
authorAndrey Konovalov <andreyknvl@google.com>
Mon, 20 Nov 2023 17:47:15 +0000 (18:47 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:40 +0000 (13:16 -0800)
commit3294e8cca84702d02e0bf31cc23d4b8462a4e352
tree88637ee160390569b8cd780d8e62106bd7cf1897
parentc55dff137fd30f59982bcbce54943403729ca545
lib/stackdepot: allow users to evict stack traces

Add stack_depot_put, a function that decrements the reference counter on a
stack record and removes it from the stack depot once the counter reaches
0.

Internally, when removing a stack record, the function unlinks it from the
hash table bucket and returns to the freelist.

With this change, the users of stack depot can call stack_depot_put when
keeping a stack trace in the stack depot is not needed anymore.  This
allows avoiding polluting the stack depot with irrelevant stack traces and
thus have more space to store the relevant ones before the stack depot
reaches its capacity.

Link: https://lkml.kernel.org/r/1d1ad5692ee43d4fc2b3fd9d221331d30b36123f.1700502145.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/stackdepot.h
lib/stackdepot.c