lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] random: unify cycles_t and jiffies usage and types
On Fri, Feb 25, 2022 at 8:06 AM Dominik Brodowski
<linux@dominikbrodowski.net> 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

\
 
 \ /
  Last update: 2022-02-25 14:41    [W:0.058 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site