From: Dan Carpenter <dan.carpenter@oracle.com>
To: Thomas Garnier <thgarnie@google.com>
Cc: Linux-MM <linux-mm@kvack.org>
Subject: Re: mm: reorganize SLAB freelist randomization
Date: Mon, 6 Jun 2016 23:11:56 +0300 [thread overview]
Message-ID: <20160606201156.GB32247@mwanda> (raw)
In-Reply-To: <CAJcbSZEcW8u2Mx0awZO_8g38pnSAYfPR8e37oBEDPvFZQWv_fQ@mail.gmail.com>
On Mon, Jun 06, 2016 at 01:01:45PM -0700, Thomas Garnier wrote:
> No, the for loop is correct. Fisher-Yates shuffles algorithm is as follow:
>
> -- To shuffle an array a of n elements (indices 0..n-1):
> for i from na??1 downto 1 do
> j random integer such that 0 <= j <= i
> exchange a[j] and a[i]
>
> https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
Thanks for looking at this. :)
regards,
dan carpenter
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-06-06 20:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 19:52 mm: reorganize SLAB freelist randomization Dan Carpenter
2016-06-06 20:01 ` Thomas Garnier
2016-06-06 20:11 ` Dan Carpenter [this message]
2016-06-06 20:12 ` Thomas Garnier
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=20160606201156.GB32247@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-mm@kvack.org \
--cc=thgarnie@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.