* mmap hw behavior @ 2009-07-08 17:03 Michal Simek 2009-07-08 17:03 ` Michal Simek 2009-07-08 17:35 ` David Miller 0 siblings, 2 replies; 10+ messages in thread From: Michal Simek @ 2009-07-08 17:03 UTC (permalink / raw) To: Linux Kernel list, lkml, Ingo Molnar, Arnd Bergmann, Paul Mundt, LTP Hi All, I wrote one email about my problem with mmap on Microblaze. (Especially mmap01 ltp test) I need to know how mmap should work with MMU or what the correct steps are. When I open temp file in application is the kernel create file descriptor table and kernel take care about setup tlb which are needed. Application get back just file descriptor. When I call calloc it is called brk kernel syscall and is created one tlb for this place. Brk allocate more memory than is requested by calloc. Application got pointer to that memory place. When I call mmap for that open file with pointer to calloc place (first parameter, + length zero) it should be one tlb invalidation for calloc and new tlb which connect open file. We check it and we don't have any tlb invalidation that's why I think that kernel do different thigs. Or is it there any copying? Or anything different? Thanks for clarification, Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
* mmap hw behavior 2009-07-08 17:03 mmap hw behavior Michal Simek @ 2009-07-08 17:03 ` Michal Simek 2009-07-08 17:35 ` David Miller 1 sibling, 0 replies; 10+ messages in thread From: Michal Simek @ 2009-07-08 17:03 UTC (permalink / raw) To: Linux Kernel list, lkml, Ingo Molnar, Arnd Bergmann, Paul Mundt, LTP Hi All, I wrote one email about my problem with mmap on Microblaze. (Especially mmap01 ltp test) I need to know how mmap should work with MMU or what the correct steps are. When I open temp file in application is the kernel create file descriptor table and kernel take care about setup tlb which are needed. Application get back just file descriptor. When I call calloc it is called brk kernel syscall and is created one tlb for this place. Brk allocate more memory than is requested by calloc. Application got pointer to that memory place. When I call mmap for that open file with pointer to calloc place (first parameter, + length zero) it should be one tlb invalidation for calloc and new tlb which connect open file. We check it and we don't have any tlb invalidation that's why I think that kernel do different thigs. Or is it there any copying? Or anything different? Thanks for clarification, Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-08 17:03 mmap hw behavior Michal Simek 2009-07-08 17:03 ` Michal Simek @ 2009-07-08 17:35 ` David Miller 2009-07-08 18:03 ` Michal Simek 1 sibling, 1 reply; 10+ messages in thread From: David Miller @ 2009-07-08 17:35 UTC (permalink / raw) To: michal.simek; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list From: Michal Simek <michal.simek@petalogix.com> Date: Wed, 08 Jul 2009 19:03:11 +0200 > When I call mmap for that open file with pointer to calloc place > (first parameter, + length zero) it should be one tlb invalidation > for calloc and new tlb which connect open file. We check it and we > don't have any tlb invalidation that's why I think that kernel do > different thigs. Or is it there any copying? Or anything different? There is no need to tlb flush the calloc area unless that memory area is actually touched by the user application and thus the page is faulted in. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-08 17:35 ` David Miller @ 2009-07-08 18:03 ` Michal Simek [not found] ` <4A54DF6F.1010405-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Michal Simek @ 2009-07-08 18:03 UTC (permalink / raw) To: David Miller; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list David Miller wrote: > From: Michal Simek <michal.simek@petalogix.com> > Date: Wed, 08 Jul 2009 19:03:11 +0200 > > >> When I call mmap for that open file with pointer to calloc place >> (first parameter, + length zero) it should be one tlb invalidation >> for calloc and new tlb which connect open file. We check it and we >> don't have any tlb invalidation that's why I think that kernel do >> different thigs. Or is it there any copying? Or anything different? >> > > There is no need to tlb flush the calloc area unless that memory area > is actually touched by the user application and thus the page is > faulted in. > That calloc area is filled by any value (in that test). Is it mean that for this case when calloc area is touched there must be tlb invalidation + remapping? Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <4A54DF6F.1010405-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>]
* Re: mmap hw behavior [not found] ` <4A54DF6F.1010405-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org> @ 2009-07-08 18:06 ` David Miller 2009-07-08 18:06 ` David Miller 2009-07-08 20:22 ` Michal Simek 0 siblings, 2 replies; 10+ messages in thread From: David Miller @ 2009-07-08 18:06 UTC (permalink / raw) To: michal.simek-g5w7nrANp4BDPfheJLI6IQ Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA, ltp-list-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, arnd-r2nGTMty4D4, linux-kernel-u79uwXL29TY76Z2rM5mHXA, lethal-M7jkjyW5wf5g9hUCZPvPmw, mingo-X9Un+BFzKDI From: Michal Simek <michal.simek-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org> Date: Wed, 08 Jul 2009 20:03:27 +0200 > David Miller wrote: >> From: Michal Simek <michal.simek-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org> >> Date: Wed, 08 Jul 2009 19:03:11 +0200 >> >> >>> When I call mmap for that open file with pointer to calloc place >>> (first parameter, + length zero) it should be one tlb invalidation >>> for calloc and new tlb which connect open file. We check it and we >>> don't have any tlb invalidation that's why I think that kernel do >>> different thigs. Or is it there any copying? Or anything different? >>> >> >> There is no need to tlb flush the calloc area unless that memory area >> is actually touched by the user application and thus the page is >> faulted in. >> > That calloc area is filled by any value (in that test). Is it mean that > for this case when calloc area is touched > there must be tlb invalidation + remapping? Yes, if the calloc area is written to by the application, there should be a tlb flush when the mmap() overrides that virtual region with a different mapping. ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-08 18:06 ` David Miller @ 2009-07-08 18:06 ` David Miller 2009-07-08 20:22 ` Michal Simek 1 sibling, 0 replies; 10+ messages in thread From: David Miller @ 2009-07-08 18:06 UTC (permalink / raw) To: michal.simek; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list From: Michal Simek <michal.simek@petalogix.com> Date: Wed, 08 Jul 2009 20:03:27 +0200 > David Miller wrote: >> From: Michal Simek <michal.simek@petalogix.com> >> Date: Wed, 08 Jul 2009 19:03:11 +0200 >> >> >>> When I call mmap for that open file with pointer to calloc place >>> (first parameter, + length zero) it should be one tlb invalidation >>> for calloc and new tlb which connect open file. We check it and we >>> don't have any tlb invalidation that's why I think that kernel do >>> different thigs. Or is it there any copying? Or anything different? >>> >> >> There is no need to tlb flush the calloc area unless that memory area >> is actually touched by the user application and thus the page is >> faulted in. >> > That calloc area is filled by any value (in that test). Is it mean that > for this case when calloc area is touched > there must be tlb invalidation + remapping? Yes, if the calloc area is written to by the application, there should be a tlb flush when the mmap() overrides that virtual region with a different mapping. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-08 18:06 ` David Miller 2009-07-08 18:06 ` David Miller @ 2009-07-08 20:22 ` Michal Simek 2009-07-09 1:15 ` David Miller 1 sibling, 1 reply; 10+ messages in thread From: Michal Simek @ 2009-07-08 20:22 UTC (permalink / raw) To: David Miller; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list David Miller wrote: > From: Michal Simek <michal.simek@petalogix.com> > Date: Wed, 08 Jul 2009 20:03:27 +0200 > > >> David Miller wrote: >> >>> From: Michal Simek <michal.simek@petalogix.com> >>> Date: Wed, 08 Jul 2009 19:03:11 +0200 >>> >>> >>> >>>> When I call mmap for that open file with pointer to calloc place >>>> (first parameter, + length zero) it should be one tlb invalidation >>>> for calloc and new tlb which connect open file. We check it and we >>>> don't have any tlb invalidation that's why I think that kernel do >>>> different thigs. Or is it there any copying? Or anything different? >>>> >>>> >>> There is no need to tlb flush the calloc area unless that memory area >>> is actually touched by the user application and thus the page is >>> faulted in. >>> >>> >> That calloc area is filled by any value (in that test). Is it mean that >> for this case when calloc area is touched >> there must be tlb invalidation + remapping? >> > > Yes, if the calloc area is written to by the application, there > should be a tlb flush when the mmap() overrides that virtual region > with a different mapping. > Can you please point me to any code which exactly do this? (for example file mm/mmap.c line from ... to ... ) Thanks, Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-08 20:22 ` Michal Simek @ 2009-07-09 1:15 ` David Miller 2009-07-09 5:40 ` Michal Simek 2009-07-09 8:57 ` Michal Simek 0 siblings, 2 replies; 10+ messages in thread From: David Miller @ 2009-07-09 1:15 UTC (permalink / raw) To: michal.simek; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list From: Michal Simek <michal.simek@petalogix.com> Date: Wed, 08 Jul 2009 22:22:22 +0200 > Can you please point me to any code which exactly do this? (for example > file mm/mmap.c line from ... to ... ) Sorry I don't have time to read the source code for you. I'd have to look it up too, just like you. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-09 1:15 ` David Miller @ 2009-07-09 5:40 ` Michal Simek 2009-07-09 8:57 ` Michal Simek 1 sibling, 0 replies; 10+ messages in thread From: Michal Simek @ 2009-07-09 5:40 UTC (permalink / raw) To: David Miller; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list David Miller wrote: > From: Michal Simek <michal.simek@petalogix.com> > Date: Wed, 08 Jul 2009 22:22:22 +0200 > > >> Can you please point me to any code which exactly do this? (for example >> file mm/mmap.c line from ... to ... ) >> > > Sorry I don't have time to read the source code for you. > I'd have to look it up too, just like you. > It is ok - I didn't want to read the code from - just if you know any functions which could help me. Thank you very much, Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mmap hw behavior 2009-07-09 1:15 ` David Miller 2009-07-09 5:40 ` Michal Simek @ 2009-07-09 8:57 ` Michal Simek 1 sibling, 0 replies; 10+ messages in thread From: Michal Simek @ 2009-07-09 8:57 UTC (permalink / raw) To: David Miller; +Cc: linux-kernel, linux-arch, mingo, arnd, lethal, ltp-list David Miller wrote: > From: Michal Simek <michal.simek@petalogix.com> > Date: Wed, 08 Jul 2009 22:22:22 +0200 > > >> Can you please point me to any code which exactly do this? (for example >> file mm/mmap.c line from ... to ... ) >> > > Sorry I don't have time to read the source code for you. > I'd have to look it up too, just like you. > I found it - Microblaze hasn't defined tlb_flush macro. Thanks for your help, Michal -- Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-07-09 8:57 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-08 17:03 mmap hw behavior Michal Simek 2009-07-08 17:03 ` Michal Simek 2009-07-08 17:35 ` David Miller 2009-07-08 18:03 ` Michal Simek [not found] ` <4A54DF6F.1010405-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org> 2009-07-08 18:06 ` David Miller 2009-07-08 18:06 ` David Miller 2009-07-08 20:22 ` Michal Simek 2009-07-09 1:15 ` David Miller 2009-07-09 5:40 ` Michal Simek 2009-07-09 8:57 ` Michal Simek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).