[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <202003281643.02SGhPmY017434@sdf.org>
Date: Thu, 3 Oct 2019 05:51:56 -0400
From: George Spelvin <lkml@....org>
To: linux-kernel@...r.kernel.org, lkml@....org
Cc: Dan Williams <dan.j.williams@...el.com>, Qian Cai <cai@....pw>,
Kees Cook <keescook@...omium.org>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Subject: [RFC PATCH v1 46/50] mm/shuffle.c: use get_random_max()
Now that we have it, this is an example of where it helps.
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