linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] mmap of  device file with huge pages
@ 2016-08-09  9:58 Yehuda Yitschak
  2016-08-09 17:39 ` Dave Hansen
  0 siblings, 1 reply; 4+ messages in thread
From: Yehuda Yitschak @ 2016-08-09  9:58 UTC (permalink / raw)
  To: linux-mm@kvack.org; +Cc: Shadi Ammouri

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

Hello everyone

I am trying mmap  kernel buffers associated with a device file (like /dev/mem) using huge pages.
I couldn't find any mechanism to do this.

On the kernel side I allocate a contiguous 2M buffer using alloc_pages.

A regular mmap with MAP_HUGETLB flag will only accept anonymous mappings or hugetlbfs files but not device files.
So, I think I need to make sure the mapping uses huge pages in my device file's mmap hook.
Usually these kind of mmap fops use remap_pfn_range but I couldn't find a way to make remap_pfn_range use huge pages.

I also tried to make Transparent huge pages recognize the mapping done with remap_pfn_range and collapse them to a huge page but that didn't work. Not sure why

I would appreciate any advice on this issue

Thanks !

-------------------
Yehuda Yitschak
Marvell Semiconductor Ltd.


[-- Attachment #2: Type: text/html, Size: 3227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-10 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09  9:58 [QUESTION] mmap of device file with huge pages Yehuda Yitschak
2016-08-09 17:39 ` Dave Hansen
2016-08-10  7:36   ` Yehuda Yitschak
2016-08-10 16:20     ` Dave Hansen

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).