[uClinux-dev] "wrong zone alignment" warning and &_end_kernel in 2.4.20

Erwin Authried eauth at softsys.co.at
Wed Mar 12 09:10:01 EST 2003

Am Mit, 2003-03-12 um 11.50 schrieb Markus Pietrek:
> Hi folks,
> when booting uClinux-2.4.20 on a NetARM+50 or NS7520 (armnommu) I receive the 
> kernel warning "BUG: wrong zone alignment, it will crash". The code for this 
> warning is in mmnommu/page_alloc.c
> void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap,
> 	unsigned long *zones_size, unsigned long zone_start_paddr, 
> 	unsigned long *zholes_size, struct page *lmem_map)
> ...
> 		if ((zone_start_paddr >> PAGE_SHIFT) & (zone_required_alignment-1))
> 			printk("BUG: wrong zone alignment, it will crash %x %x %x %x\n", 
> zone_start_paddr, PAGE_SHIFT, zone_required_alignment, MAX_ORDER );
> ...
> The zone 1 is starting directly after the kernel, which is located at 0x0.
> zone_start_paddr == PAGE_OFFSET == &_end_kernel == 1376256
> PAGE_SHIFT == 12
> MAX_ORDER == 10
> zone_required_alignment == 0x1ff
> I don't understand the reason of this function. But to get rid of this message 
> I would have to align _end_kernel at a 2MB boundary, wasting 600kb memory. 
> Are there other, better ways?
Let the memory start at location zero instead. This wastes only a small
amount of memory for the page table entries, on the other hand it allows
to reuse the memory of the init section (free_initmem()). The alignment
is required for the buddy allocator, you should take the warning


More information about the uClinux-dev mailing list