Re: [PATCH] mm/kfence: select random number before taking raw lock

From: Jason A. Donenfeld
Date: Thu Jun 09 2022 - 08:30:00 EST


On Thu, Jun 9, 2022 at 2:27 PM Marco Elver <elver@xxxxxxxxxx> wrote:
> The compiler should elide this branch entirely if
> CONFIG_KFENCE_STRESS_TEST_FAULTS=0, but not sure it'll always do so
> now. My suggestion is to make both new bools consts, to help out the
> compiler a little.
>
> Otherwise looks good, thanks for the quick fix!

Disassembling reveals it still does elide. (gcc 11.3) But I'll make
them const just in case and send a v2.

Jason