[PATCH v6 13/13] KEYS: key_garbage_collector(): process in chunks
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 12 04:31:46 UTC 2026
> key_garbage_collector() has a design that is not resistant enough for
> workqueue lockups. The duration scales up relative to the number of items
> in the serial tree, which causes a reoccuring theme of being guilty of
> causing workqueue lockups.
>
> Resolve the problem by processing in chunks:
>
> 1. Declare a static variable key_gc_work, which owns the garbage collection
> in-flight state, and key_schedule_gc_work() for re-scheduling the work.
> 2. Define KEY_GC_CHUNK_SIZE, set to 64 keys, as the bound for the number
> of items scanned and destroyed.
> 3. Define KEY_GC_DESTROYING to mark resume to destruction without repeating
> the RCU grace period.
> 4. Define KEY_GC_REAP_REQUESTED for preserving full-pass requests across
> the continuations.
> [ ... ]
> decline.
>
> Fixes: 0c061b5707ab ("KEYS: Correctly destroy key payloads when their keytype is removed")
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd-test.git/tree/package/keygcbench
> Signed-off-by: Jarkko Sakkinen <jarkko at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112040242.247168-1-jarkko@kernel.org?part=13
More information about the Linux-security-module-archive
mailing list