Re: [PATCH 6/9] mm, page_alloc: cache pageset high and batch in struct zone

From: Vlastimil Babka
Date: Tue Oct 06 2020 - 18:31:47 EST


On 9/25/20 12:34 PM, David Hildenbrand wrote:
On 22.09.20 16:37, Vlastimil Babka wrote:
@@ -6300,6 +6310,8 @@ static __meminit void zone_pcp_init(struct zone *zone)
* offset of a (static) per cpu variable into the per cpu area.
*/
zone->pageset = &boot_pageset;
+ zone->pageset_high = BOOT_PAGESET_HIGH;
+ zone->pageset_batch = BOOT_PAGESET_BATCH;

I do wonder if copying from any cpuvar inside boot_pageset is cleaner.

zone->pageset_high = &this_cpu_ptr(zone->pageset)->pcp.high;

Uh I don't know. That would be like admitting they can be different than what was initialized. But then they could be also different depending on what cpu we happen to run it on. It's why I added the #define BOOT_PAGESET_* in the first place - to ensure same value used in two places. Makes sense?