Skip to content

Commit 1d5e464

Browse files
Vladimir Isaevvineetgarc
authored andcommitted
ARC: mm: Use max_high_pfn as a HIGHMEM zone border
Commit 4af22de ("arc: fix memory initialization for systems with two memory banks") fixed highmem, but for the PAE case it causes bug messages: | BUG: Bad page state in process swapper pfn:80000 | page:(ptrval) refcount:0 mapcount:1 mapping:00000000 index:0x0 pfn:0x80000 flags: 0x0() | raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000 | raw: 00000000 | page dumped because: nonzero mapcount | Modules linked in: | CPU: 0 PID: 0 Comm: swapper Not tainted 5.12.0-rc5-00003-g1e43c377a79f #1 This is because the fix expects highmem to be always less than lowmem and uses min_low_pfn as an upper zone border for highmem. max_high_pfn should be ok for both highmem and highmem+PAE cases. Fixes: 4af22de ("arc: fix memory initialization for systems with two memory banks") Signed-off-by: Vladimir Isaev <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: [email protected] #5.8 onwards Signed-off-by: Vineet Gupta <[email protected]>
1 parent c5f756d commit 1d5e464

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

arch/arc/mm/init.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,16 @@ void __init setup_arch_memory(void)
157157
min_high_pfn = PFN_DOWN(high_mem_start);
158158
max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz);
159159

160-
max_zone_pfn[ZONE_HIGHMEM] = min_low_pfn;
160+
/*
161+
* max_high_pfn should be ok here for both HIGHMEM and HIGHMEM+PAE.
162+
* For HIGHMEM without PAE max_high_pfn should be less than
163+
* min_low_pfn to guarantee that these two regions don't overlap.
164+
* For PAE case highmem is greater than lowmem, so it is natural
165+
* to use max_high_pfn.
166+
*
167+
* In both cases, holes should be handled by pfn_valid().
168+
*/
169+
max_zone_pfn[ZONE_HIGHMEM] = max_high_pfn;
161170

162171
high_memory = (void *)(min_high_pfn << PAGE_SHIFT);
163172

0 commit comments

Comments
 (0)