Re: [PATCH v3] random: remove batched entropy locking

From: Jason A. Donenfeld
Date: Fri Feb 04 2022 - 11:12:37 EST


Hi Sebastian,

On Fri, Feb 4, 2022 at 4:57 PM Sebastian Andrzej Siewior
<bigeasy@xxxxxxxxxxxxx> wrote:
> Does this compile and work?

It does, yes.

> From the looks of it, this should be:
>
> local_lock_irqsave(&batched_entropy_u64.lock, flags);
> batch = this_cpu_ptr(&batched_entropy_u64);

I wasn't aware you could reference percpu things statically like that
without going through the ptr helper. Anyway, I'll switch to yours, as
taking that lock prior seems better anyway.

>
> and we could do s/this_cpu_ptr/raw_cpu_ptr/

Ack.

Jason