lkml.org 
[lkml]   [2022]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] random: avoid reading two cache lines on irq randomness
On 2022-09-23 20:28:49 [+0200], Jason A. Donenfeld wrote:
> In order to avoid reading and dirtying two cache lines on every IRQ, move
> the work_struct to the bottom of the fast_pool struct. add_interrupt_
> randomness() always touches .pool and .count, which are currently split,
> because .mix pushes everything down. Instead, move .mix to the bottom,
> so that .pool and .count are always in the first cache line, since the
> .mix is only accessed when the pool is full.
>
> Fixes: 58340f8e952b ("random: defer fast pool mixing to worker")
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Sultan Alsawaf <sultan@kerneltoast.com>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Yup, makes sense.

Sebastian

\
 
 \ /
  Last update: 2022-09-28 13:38    [W:0.049 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site