[PATCH v2 7/7] ARM: implement support for vmap'ed stacks

Arnd Bergmann arnd at arndb.de
Mon Oct 18 08:43:48 PDT 2021


On Mon, Oct 18, 2021 at 5:33 PM Nicolas Pitre <nico at fluxnic.net> wrote:
> On Mon, 18 Oct 2021, Ard Biesheuvel wrote:
> > +      * This means that the counter is going to max out at ~250 for the
> > +      * typical case. If it overflows, something entirely unexpected has
> > +      * occurred so let's throw a warning if that happens.
> > +      */
> > +     WARN_ON(++init_mm.context.vmalloc_seq == UINT_MAX);
>
> I don't understand the logic here. Yes, changes are not that frequent
> and this is pretty unlikely to ever wrap. But given an infinite run
> time, it could wrap and that woule be OK.

As far as I can tell, Ard is correct that it cannot wrap: each of the
~250 entries can only change from invalid to valid once, and we
can never reassign it after that. It might be correct to argue that
an overflow is not a bug, but if it were to happen, then the theory of
how this is meant to work is wrong, and we should look again.

        Arnd



More information about the linux-arm-kernel mailing list