[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4iagZy5m3FpMrQqyOi=_uCzqh5MjbW+J_xiHU1Z1BmF=g@mail.gmail.com>
Date: Sat, 28 Mar 2020 11:23:24 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: George Spelvin <lkml@....org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Qian Cai <cai@....pw>, Kees Cook <keescook@...omium.org>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux MM <linux-mm@...ck.org>
Subject: Re: [RFC PATCH v1 46/50] mm/shuffle.c: use get_random_max()
On Sat, Mar 28, 2020 at 9:43 AM George Spelvin <lkml@....org> wrote:
>
> Now that we have it, this is an example of where it helps.
I didn't get copied on the cover and this series does not seem to be
threaded in a way lore can find the cover either:
https://lore.kernel.org/r/202003281643.02SGhPmY017434@sdf.org
Mind including a short blurb about what it is and why it helps in the changelog?
>
> Signed-off-by: George Spelvin <lkml@....org>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Qian Cai <cai@....pw>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-mm@...ck.org
> ---
> mm/shuffle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/shuffle.c b/mm/shuffle.c
> index b3fe97fd66541..e0ed247f8d907 100644
> --- a/mm/shuffle.c
> +++ b/mm/shuffle.c
> @@ -135,7 +135,7 @@ void __meminit __shuffle_zone(struct zone *z)
> * in the zone.
> */
> j = z->zone_start_pfn +
> - ALIGN_DOWN(get_random_long() % z->spanned_pages,
> + ALIGN_DOWN(get_random_max(z->spanned_pages),
> order_pages);
> page_j = shuffle_valid_page(j, order);
> if (page_j && page_j != page_i)
> --
> 2.26.0
>
Powered by blists - more mailing lists