Re: [PATCH v3 04/26] x86/mm: split out preallocate_sub_pgd()
From: Yosry Ahmed
Date: Mon Aug 17 2026 - 20:30:25 EST
> >> +
> >> + /*
> >> + * On 4-level systems, the P4D layer is folded away and
> >> + * the above code does no preallocation. Below, go down
> >> + * to the pud _software_ level to ensure the second
> >> + * hardware level is allocated on 4-level systems too.
> >> + */
> >> + lvl = "pud";
> >> + pud = pud_alloc(mm, p4d, addr);
> >> + if (!pud)
> >> + goto failed;
> >> + return 0;
> >> +
> >> +failed:
> >> + pr_warn_ratelimited("Failed to preallocate %s\n", lvl);
> >
> > Can this possibly fire more than once? IIUC we will panic right after
> > returning.
>
> In the immediate usecase no, but once it's used for
> mm_local_map_to_user() we do actually handle failure.
Oh yeah I missed this, thanks.