Re: [PATCH v2] random: unify cycles_t and jiffies usage and types
From: Jason A. Donenfeld
Date: Fri Feb 25 2022 - 08:40:18 EST
On Fri, Feb 25, 2022 at 8:06 AM Dominik Brodowski
<linux@xxxxxxxxxxxxxxxxxxxx> wrote:
> maybe "flags, now = jiffies" is a bit more reader-friendly?
Good idea. Will do.
> > enum { MIX_INFLIGHT = 1U << 31 };
> > + cycles_t cycles = random_get_entropy();
> > + unsigned long now = jiffies;
> > struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
> > struct pt_regs *regs = get_irq_regs();
> > - unsigned long now = jiffies;
> > - cycles_t cycles = random_get_entropy();
> > unsigned int new_count;
> >
> > if (cycles == 0)
>
>
> Why do you change the ordering here?
So that get_cycles() is called as closest to the actual interrupt as
possible, and so that we retain the order as elsewhere of reading
cycles before jiffies.
v+1 on its way.
Jason