linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: david.keisarschm@mail.huji.ac.il
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-mtd@lists.infradead.org,
	linux-scsi@vger.kernel.org, bpf@vger.kernel.org,
	netdev@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state
Date: Mon, 12 Dec 2022 10:35:53 +0200	[thread overview]
Message-ID: <Y5bn6XcozgjbcSkf@smile.fi.intel.com> (raw)
In-Reply-To: <b3caaa5ac5fca4b729bf1ecd0d01968c09e6d083.1670778652.git.david.keisarschm@mail.huji.ac.il>

On Mon, Dec 12, 2022 at 12:16:04AM +0200, david.keisarschm@mail.huji.ac.il wrote:
> From: David <david.keisarschm@mail.huji.ac.il>
> 
> Since the two functions
>  prandom_byte_state and prandom_u32_state
>  use the weak prng prandom_u32,
>  we added the prefix predictable_rng,
>  to their signatures so it is clear they are weak.

It's fancy indentation.

...

>  		/* Fisher-Yates shuffle */
>  		for (i = count - 1; i > 0; i--) {
> -			rand = prandom_u32_state(&state.rnd_state);
> +			rand = predictable_rng_prandom_u32_state(&state.rnd_state);

Isn't it too many "random":s encoded in the name?

I would leave either "rng" or "[p]random".

>  			rand %= (i + 1);
>  			swap_free_obj(slab, i, rand);
>  		}

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2022-12-12  8:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1670778651.git.david.keisarschm@mail.huji.ac.il>
2022-12-11 22:16 ` david.keisarschm
2022-12-12  8:35   ` Andy Shevchenko [this message]
2022-12-12 14:35   ` Jason A. Donenfeld
2022-12-14 12:33     ` Stanislaw Gruszka
2022-12-14 15:15       ` Eric Dumazet
2022-12-14 15:53         ` Andy Shevchenko
2022-12-14 15:57           ` Andy Shevchenko
2022-12-14 16:21         ` Stanislaw Gruszka
2022-12-14 18:28           ` Theodore Ts'o
2022-12-11 22:16 ` [PATCH 3/5] Replace invocation of weak PRNG in mm/slab.c david.keisarschm
2022-12-11 22:16 ` [PATCH 4/5] Replace invocation of weak PRNG inside mm/slab_common.c david.keisarschm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5bn6XcozgjbcSkf@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.keisarschm@mail.huji.ac.il \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hpa@zytor.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox