mmap hw behavior
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
Signature · 3 lines
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
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 19:03:11 +0200
Quoted 5 lines
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.
Quoted 11 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 19:03:11 +0200Quoted 6 lines
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?
Quoted 4 lines
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
Signature · 3 lines
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
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 20:03:27 +0200
Quoted 12 lines
Quoted 11 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 19:03:11 +0200Quoted 6 lines
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?
Quoted 7 lines
Quoted 4 lines
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.
Quoted 23 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 20:03:27 +0200Quoted 19 lines
Quoted 17 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 19:03:11 +0200Quoted 7 lines
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.
Quoted 9 lines
Quoted 4 lines
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
Signature · 3 lines
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
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 22:22:22 +0200
Quoted 2 lines
Can you please point me to any code which exactly do this? (for example file
mm/mmap.cline 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.
Quoted 11 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 22:22:22 +0200Quoted 3 lines
Can you please point me to any code which exactly do this? (for example file
mm/mmap.cline 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
Signature · 3 lines
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
Quoted 11 lines · David Miller
From: Michal Simek <[email protected]>
Date: Wed, 08 Jul 2009 22:22:22 +0200Quoted 3 lines
Can you please point me to any code which exactly do this? (for example file
mm/mmap.cline 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
Signature · 3 lines
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