Hi, I'm testing mmap() performance on a ramdisk. The kernel is 3.19-rc3. The device driver is brd, and the file system is ext2. Normal mmap() does not make sense on a ramdisk because it adds additional memory copy, so XIP is enabled to map the pages directly into application's address space. With XIP, MAP_POPULATE flag does not work. i.e. prefault fails. Basically it fails in vm_normal_page(), where it's supposed to find the struct page from pfn, but the vma has flag VM_MIXEDMAP and the method returns NULL. As I understand, VM_MIXEDMAP means the memory may not contain a struct page backing, so the code logic is reasonable. However brd driver does provide struct page for each memory page. If I modify the __get_user_pages() and let the prefault runs for all the pages, MAP_POPULATE works as expected. My question is, is there any elegant way to workaround this? I do want to make MAP_POPULATE works with XIP. This is because as the device is memory and access latency is pretty low, page fault as well as the mode switch play an important part in the software overhead. In my experiment, MAP_POPULATE provides a 3x improvement on latency when access a big file for the first time. Thanks, Andiry -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>