~xdavidwu/linux-xdavidwu-xps

ref: 3efac9c8047bdd068b0d0d379843751b26b9a4c2 linux-xdavidwu-xps/percpu-minsize.patch -rw-r--r-- 1.0 KiB
3efac9c8Pinghao Wu 6.14 13 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
make sure there's at least 1024 per cpu pages... a reasonably small amount
for todays system

--- linux-5.15/mm/page_alloc.c~	2021-10-31 20:53:10.000000000 +0000
+++ linux-5.15/mm/page_alloc.c	2021-11-23 17:37:43.046267744 +0000
@@ -6848,6 +6848,7 @@
 	 * historical relationship between high and batch.
 	 */
 	high = max(high, batch << 2);
+	high = max(high, 1024);
 
 	return high;
 #else
--- linux-5.15/mm/page_alloc.c~	2021-11-23 17:37:43.000000000 +0000
+++ linux-5.15/mm/page_alloc.c	2021-11-23 17:41:40.539264437 +0000
@@ -6766,11 +6766,11 @@
 
 	/*
 	 * The number of pages to batch allocate is either ~0.1%
-	 * of the zone or 1MB, whichever is smaller. The batch
+	 * of the zone or 4MB, whichever is smaller. The batch
 	 * size is striking a balance between allocation latency
 	 * and zone lock contention.
 	 */
-	batch = min(zone_managed_pages(zone) >> 10, (1024 * 1024) / PAGE_SIZE);
+	batch = min(zone_managed_pages(zone) >> 10, 4 * (1024 * 1024) / PAGE_SIZE);
 	batch /= 4;		/* We effectively *= 4 below */
 	if (batch < 1)
 		batch = 1;