Re: [PATCH mm v2 32/33] kasan: dynamically allocate stack ring entries

From: Andrey Konovalov
Date: Mon Sep 05 2022 - 16:35:21 EST


On Wed, Aug 3, 2022 at 10:09 PM Marco Elver <elver@xxxxxxxxxx> wrote:
>
> > -#define KASAN_STACK_RING_SIZE (32 << 10)
> > +#define KASAN_STACK_RING_SIZE_DEFAULT (32 << 10)
> >
>
> This could be moved to tags.c, as there are no other users elsewhere.

Will fix in v3.

> > +/* kasan.stack_ring_size=32768 */
>
> What does that comment say? Is it "kasan.stack_ring_size=<entries>"?

Yes, will clarify in v3.

> Is it already in the documentation?

Will add in v3.

> > + if (kasan_stack_collection_enabled()) {
> > + if (!stack_ring.size)
> > + stack_ring.size = KASAN_STACK_RING_SIZE_DEFAULT;
> > + stack_ring.entries = memblock_alloc(
> > + sizeof(stack_ring.entries[0]) *
> > + stack_ring.size,
> > + SMP_CACHE_BYTES);
>
> memblock_alloc() can fail. Because unlikely, stack collection should
> probably just be disabled.
>
> (minor: excessive line breaks makes the above unreadable.)

Will fix both in v3.

Thanks!