Re: [PATCH v2] nommu: add page_align to mmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Greg

On Wed, Jun 8, 2011 at 12:47 PM, Greg Ungerer <gerg@xxxxxxxxxxxx> wrote:
> Hi Bob,
>
> On 07/06/11 16:19, Bob Liu wrote:
>>
>> On Fri, Jun 3, 2011 at 2:37 PM, Greg Ungerer<gerg@xxxxxxxxxxxx> Âwrote:
>>>
>>> Hi Bob,
>>>
>>> On 06/05/11 16:03, Bob Liu wrote:
>>>>
>>>> Currently on nommu arch mmap(),mremap() and munmap() doesn't do
>>>> page_align()
>>>> which isn't consist with mmu arch and cause some issues.
>>>>
>>>> First, some drivers' mmap() function depends on vma->vm_end - vma->start
>>>> is
>>>> page aligned which is true on mmu arch but not on nommu. eg: uvc camera
>>>> driver.
>>>>
>>>> Second munmap() may return -EINVAL[split file] error in cases when end
>>>> is
>>>> not
>>>> page aligned(passed into from userspace) but vma->vm_end is aligned dure
>>>> to
>>>> split or driver's mmap() ops.
>>>>
>>>> This patch add page align to fix those issues.
>>>
>>> This is actually causing me problems on head at the moment.
>>> git bisected to this patch as the cause.
>>>
>>> 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 22
>>>
>>
>> Oh, 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 22
>

Since 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()?

Thanks!

> I can confirm that the PAGE_ALIGN(len) change in do_mmap_pgoff()
> is enough to cause this too.
>
> Regards
> Greg
>
>
>
>
>>> I haven't really debugged it any further yet. But that error message
>>> comes from fs/binfmt_flat.c, it is reporting a failed do_mmap() call.
>>>
>>> Reverting that this patch and no more problem.
>>>
>>> Regards
>>> Greg
>>>
>
> ------------------------------------------------------------------------
> Greg Ungerer Â-- ÂPrincipal Engineer    ÂEMAIL:   gerg@xxxxxxxxxxxx
> 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
>

-- 
Regards,
--Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]