[PATCH v2] KEYS: key_garbage_collector(): process in chunks
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Wed Oct 28 03:12:22 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 1024 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. Drain the graveyard before advancing key-type
> reaping.
> 4. Define KEY_GC_REAP_REQUESTED for preserving full-pass requests across
> [ ... ]
> - aarch64: chunk max: 235 ms, total time increase: 6%
>
> Tests were performed using a laptop with AMD 4650U (Zen 2 uarch) CPU.
>
> 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/20261028025306.2063007-1-jarkko@kernel.org?part=1
More information about the Linux-security-module-archive
mailing list