From: Yehuda Yitschak <yehuday@marvell.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: Shadi Ammouri <shadi@marvell.com>
Subject: [QUESTION] mmap of device file with huge pages
Date: Tue, 9 Aug 2016 09:58:32 +0000 [thread overview]
Message-ID: <85d8c7bb8bcc4a30865a4512dd174cf8@IL-EXCH02.marvell.com> (raw)
[-- 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 --]
next reply other threads:[~2016-08-09 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 9:58 Yehuda Yitschak [this message]
2016-08-09 17:39 ` [QUESTION] mmap of device file with huge pages Dave Hansen
2016-08-10 7:36 ` Yehuda Yitschak
2016-08-10 16:20 ` Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85d8c7bb8bcc4a30865a4512dd174cf8@IL-EXCH02.marvell.com \
--to=yehuday@marvell.com \
--cc=linux-mm@kvack.org \
--cc=shadi@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).