linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org
Subject: Re: How to use huge pages in drivers?
Date: Tue, 3 Sep 2019 23:28:15 +0200	[thread overview]
Message-ID: <20190903212815.GA7518@nautica> (raw)
In-Reply-To: <20190903184230.GJ29434@bombadil.infradead.org>

Matthew Wilcox wrote on Tue, Sep 03, 2019:
> > What I'd like to know is:
> >  - we know (assuming the other side isn't too bugged, but if it is we're
> > fucked up anyway) exactly what huge-page-sized physical memory range has
> > been mapped on the other side, is there a way to manually gather the
> > pages corresponding and merge them into a huge page?
> 
> You're using the word 'page' here, but I suspect what you really mean is
> "pfn" or "pte".  As you've described it, it doesn't matter what data structure
> Linux is using for the memory, since Linux doesn't know about the memory.

Correct, we're already using vmf_insert_pfn

> We have vmf_insert_pfn_pmd() which is designed to be called from your
> ->huge_fault handler.  See dev_dax_huge_fault() -> __dev_dax_pmd_fault()
> for an example.  It's a fairly new mechanism, so I don't think it's
> popular with device drivers yet.
> 
> All you really need is the physical address of the memory to make this work.

Great; I'm not sure how I had missed the pmd variant here. It's even
been around for long enough to be available on our "old" el7 kernels so
I'll be able to test this quickly.

Thanks!
-- 
Dominique


  reply	other threads:[~2019-09-03 21:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 18:26 Dominique Martinet
2019-09-03 18:42 ` Matthew Wilcox
2019-09-03 21:28   ` Dominique Martinet [this message]
2019-09-04 17:00     ` Dominique Martinet
2019-09-04 17:50       ` Matthew Wilcox
2019-09-05 15:44         ` Dominique Martinet
2019-09-05 18:15           ` Matthew Wilcox
2019-09-05 18:50             ` Dominique Martinet

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=20190903212815.GA7518@nautica \
    --to=asmadeus@codewreck.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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