linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Minchan Kim <minchan@kernel.org>
Cc: hughd@google.com, kirill@shutemov.name, linux-mm <linux-mm@kvack.org>
Subject: Re: THP handling with driver compound page on fault
Date: Sat, 30 Jan 2021 02:09:11 +0000	[thread overview]
Message-ID: <20210130020911.GG308988@casper.infradead.org> (raw)
In-Reply-To: <YBS7FzpU9vo0xjAA@google.com>

On Fri, Jan 29, 2021 at 05:49:11PM -0800, Minchan Kim wrote:
> On Sat, Jan 30, 2021 at 01:28:44AM +0000, Matthew Wilcox wrote:
> > On Fri, Jan 29, 2021 at 05:22:24PM -0800, Minchan Kim wrote:
> > > Hi Mattew,
> > > 
> > > On Sat, Jan 30, 2021 at 01:00:02AM +0000, Matthew Wilcox wrote:
> > > > On Fri, Jan 29, 2021 at 04:13:07PM -0800, Minchan Kim wrote:
> > > > > A custom driver overrides (vm_operations_struct.fault) and map their
> > > > > compound page(__GFP_COMP) to page table on userprocess on demand.
> > > > 
> > > > You're looking to backport:
> > > > 
> > > > commit d01ac3c35214ce362f50cada37cb7bab8c801896
> > > > Author: Matthew Wilcox (Oracle) <willy@infradead.org>
> > > > Date:   Thu Oct 15 20:05:26 2020 -0700
> > > > 
> > > >     mm/memory: remove page fault assumption of compound page size
> > > > 
> > > 
> > > I guess you meant the check below.
> > > 
> > > 	if (compound_order(page) != HPAGE_PMD_ORDER)
> > > 
> > > What happens if driver allcoated HPAGE_PMD_ORDER size?
> > 
> > ... then it should be fine to map it with a PMD entry?
> 
> I don't think so because following logic assumes it's THP page,
> for example, page_add_file_rmap, count_vm_event(THP_FILE_MAPPED)
> in do_set_pmd.
> 
> Isn't it bug?

Clearly nobody's actually tested it, but I think in principle, if a
device driver returns a PMD sized page (and it's appropriately aligned),
it should be mapped with a PMD entry.


  reply	other threads:[~2021-01-30  2:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30  0:13 THP handling with driver compound page on fault Minchan Kim
2021-01-30  1:00 ` Matthew Wilcox
2021-01-30  1:22   ` Minchan Kim
2021-01-30  1:28     ` Matthew Wilcox
2021-01-30  1:49       ` Minchan Kim
2021-01-30  2:09         ` Matthew Wilcox [this message]
2021-01-30  2:40           ` Minchan Kim

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=20210130020911.GG308988@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.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;
as well as URLs for NNTP newsgroup(s).