Re: [PATCH v2] nommu: add page_align to mmap
From: Greg Ungerer <hidden>
Date: 2011-06-10 03:52:05
Hi Bob, On 09/06/11 20:30, Bob Liu wrote:
On Wed, Jun 8, 2011 at 6:19 PM, Greg Ungerer[off-list ref] wrote:quoted
quoted
quoted
quoted
quoted
When booting on a ColdFire (m68knommu) target the init process (or there abouts at least) fails. Last console messages are: ... VFS: Mounted root (romfs filesystem) readonly on device 31:0. Freeing unused kernel memory: 52k freed (0x401aa000 - 0x401b6000) Unable to mmap process text, errno 22Oh, bad news. I will try to reproduce it on my board. If you are free please enable debug in nommu.c and then we can see what caused the problem.Yep, with debug on: ... VFS: Mounted root (romfs filesystem) readonly on device 31:0. Freeing unused kernel memory: 52k freed (0x4018c000 - 0x40198000) ==> ádo_mmap_pgoff(,0,6780,5,1002,0) <== do_mmap_pgoff() = -22 Unable to mmap process text, errno 22Since I can't reproduce this problem, could you please attach the whole dmesg log with nommu debug on or you can step into to see why errno 22 is returned, is it returned by do_mmap_private()?There was no other debug messages with debug turned on in nommu.c. (I can give you the boot msgs before this if you want, but there was no nommu.c debug in it). But I did trace it into do_mmap_pgoff() to see what was failing. It fails based on the return value from: addr = file->f_op->get_unmapped_area(file, addr, len, ¡pgoff, flags);Thanks for this information. But it's a callback function. I still can't know what's the problem maybe. Would you do me a favor to do more trace to see where it callback to, fs or some driver etc..?
Its calling to romfs_get_unmapped_area() [fs/romfs/mmap-nommu.c]. It is being called with: romfs_get_unmapped_area(addr=0,len=7000,pgoff=0,flags=1002) This is failing the first size check because isize comes back as 0x6ca8, and this is smaller then len (0x7000). Thus returning -EINVAL. That code is trying to map the contents of the file /bin/init directly from the romfs filesystem (which is in RAM). The init binary is 0x6ca8 bytes in size (that is the isize above). Regards Greg ------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>