[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHmME9q1bdSeX5Eu+sNfJkch+odKTWFZ53Jo-ma98SDqouEF6w@mail.gmail.com>
Date: Sat, 5 Feb 2022 13:50:42 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Sultan Alsawaf <sultan@...neltoast.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
"Theodore Ts'o" <tytso@....edu>,
Jonathan Neuschäfer <j.neuschaefer@....net>
Subject: Re: [PATCH RFC v1] random: do not take spinlocks in irq handler
Hi Sultan,
On Sat, Feb 5, 2022 at 5:02 AM Sultan Alsawaf <sultan@...neltoast.com> wrote:
> The __this_cpu_{ATOMIC_OP}() functions are for atomically performing a single
> per-CPU operation for the current CPU from contexts that permit CPU migration.
> Since this code is safe from CPU migrations (add_interrupt_randomness() runs in
> hardirq context), the atomic per-CPU helpers are unneeded. Instead of using
> __this_cpu_inc_return() and __this_cpu_or(), we can operate on the per-CPU
> pointer directly without any extra safety (e.g., `++fast_pool->count` can be
> used in place of `__this_cpu_inc_return(irq_randomness.count)`).
Oh, right, thanks. We're already in irq so we don't have to worried
about load,add,store being cut up in any way. I'll go back to simple
increments for v3.
Jason
Powered by blists - more mailing lists