Skip to contentSkip to conversation

mm-swap-use-prandom_u32_max.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 2, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/swapfile.c: use prandom_u32_max()
has been removed from the -mm tree. Its filename was
mm-swap-use-prandom_u32_max.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Huang Ying <[email protected]>
Subject: mm/swapfile.c: use prandom_u32_max()

To improve the code readability and take advantage of the common implementation.

---

 mm/swapfile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swapfile.c renamed from mm/swapfile.c~mm-swap-use-prandom_u32_max +1 -1
@@ -3209,7 +3209,7 @@ SYSCALL_DEFINE2(swapon, const char __use
 		 * select a random position to start with to help wear leveling
 		 * SSD
 		 */
-		p->cluster_next = 1 + (prandom_u32() % p->highest_bit);
+		p->cluster_next = 1 + prandom_u32_max(p->highest_bit);
 		nr_cluster = DIV_ROUND_UP(maxpages, SWAPFILE_CLUSTER);
 
 		cluster_info = kvcalloc(nr_cluster, sizeof(*cluster_info),

_

Patches currently in -mm which might be from [email protected] are