Re: [RFC PATCH 1/1] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()

From: Daniel Latypov
Date: Thu Jun 02 2022 - 12:53:37 EST


On Thu, Jun 2, 2022 at 9:27 AM Javier Martinez Canillas
<javierm@xxxxxxxxxx> wrote:
> > +CFLAGS_drm_format_helper_test.o += $(DISABLE_STRUCTLEAK_PLUGIN)
> >
>
> A comment on why this is needed would useful.

Ah, I think that should not be necessary anymore.
We added this to some tests to mitigate against compilers that didn't
optimize away stack-local structs used internally in KUNIT_EXPECT*.
Functions with ~30 or so EXPECTs could get flagged for excessively
large stack frames.

But in 5.18, I had some patches to reduce the naive stack usage from
[48..88] => [8..32] bytes per EXPECT.
I also have some RFC patches out to get it down to [0, 24] bytes.

So going forward, this should only be necessary if you have something
like 100s of EXPECTs in a single function (in which case you should
also consider splitting that function up).

Daniel