Skip to content

Commit 2204355

Browse files
fenrus75Kaz205
authored andcommitted
percpu-minsize
make sure there's at least 1024 per cpu pages... a reasonably small amount for todays system
1 parent f055855 commit 2204355

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/page_alloc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7093,11 +7093,11 @@ static int zone_batchsize(struct zone *zone)
70937093

70947094
/*
70957095
* The number of pages to batch allocate is either ~0.1%
7096-
* of the zone or 1MB, whichever is smaller. The batch
7096+
* of the zone or 4MB, whichever is smaller. The batch
70977097
* size is striking a balance between allocation latency
70987098
* and zone lock contention.
70997099
*/
7100-
batch = min(zone_managed_pages(zone) >> 10, SZ_1M / PAGE_SIZE);
7100+
batch = min(zone_managed_pages(zone) >> 10, 4 * SZ_1M / PAGE_SIZE);
71017101
batch /= 4; /* We effectively *= 4 below */
71027102
if (batch < 1)
71037103
batch = 1;
@@ -7175,6 +7175,7 @@ static int zone_highsize(struct zone *zone, int batch, int cpu_online)
71757175
* historical relationship between high and batch.
71767176
*/
71777177
high = max(high, batch << 2);
7178+
high = max(high, 1024);
71787179

71797180
return high;
71807181
#else

0 commit comments

Comments
 (0)