Re: [PATCH v16 03/20] unwind_user/sframe: Store .sframe section data in per-mm maple tree
From: Steven Rostedt
Date: Wed May 27 2026 - 16:24:57 EST
On Thu, 21 May 2026 16:25:29 +0200
Jens Remus <jremus@xxxxxxxxxxxxx> wrote:
> int sframe_remove_section(unsigned long sframe_start)
> {
> - return -ENOSYS;
> + struct mm_struct *mm = current->mm;
> + struct sframe_section *sec;
> + unsigned long index = 0;
> + bool found = false;
> + int ret = 0;
> +
> + guard(srcu)(&sframe_srcu);
> +
> + mt_for_each(&mm->sframe_mt, sec, index, ULONG_MAX) {
> + if (sec->sframe_start == sframe_start) {
> + found = true;
> + ret |= __sframe_remove_section(mm, sec);
Because this is all internal data, the __sframe_remove_section() should
never fail. Perhaps we should add a WARN_ON() if it does?
if (sec->sframe_start == sframe_start) {
ret |= __sframe_remove_section(mm, sec);
WARN_ON(!found && ret);
found = true;
-- Steve
> + }
> + }
> +
> + if (!found || ret)
> + return -EINVAL;
> +
> + return 0;
> +}
> +