On Mon, Jan 05, 2009 at 03:17:12PM -0800, Ravikiran G Thirumalai wrote: > On Mon, Jan 05, 2009 at 02:47:46PM +0000, Mel Gorman wrote: > >I'm not aware of plans. The problem is that overriding mmap() is > >trickier than other functions like shmget() as the library itself is > >using it. For example, you would figure out how to distinguish between a > >mmap() call that came from the application and the mmap() call the > >library is making to back a region with huge pages. > > Yes, but we can try and catch as many allocations as possible by > trapping all non libc requests to mmap with MAP_ANONYMOUS flags, and if they > are at/above the huge page size for the architecture, then change it to mmap > backed by huge pages... Since libhugetlbfs would be LD_PRELOADed, all app > requests get to libhugetlb first, and that is how we can distinguish them > from libc/libhugetlb initiated mmaps no? >
Good poing, restricting any special action to MAP_ANONYMOUS would make things easier as you know those calls are never libhugetlbfs because those calls will always be mapping a file. I still don't see how you would distinguish the call came from libc, but maybe it does not matter. It's worth trying out for sure to see what sort of problems are encountered. -- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab ------------------------------------------------------------------------------ _______________________________________________ Libhugetlbfs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel
