linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: willy@infradead.org, hughd@google.com, kirill@shutemov.name
Cc: linux-mm <linux-mm@kvack.org>
Subject: THP handling with driver compound page on fault
Date: Fri, 29 Jan 2021 16:13:07 -0800	[thread overview]
Message-ID: <YBSkk0sZOQxgDNSO@google.com> (raw)

Hi Folks,

A custom driver overrides (vm_operations_struct.fault) and map their
compound page(__GFP_COMP) to page table on userprocess on demand.

Here problem is

page fault occur:

__do_fault
	vma->vm_ops->fault <- driver returns their compould page 

finish_fault
	alloc_set_pte
		PageTransCompound(page)
			do_set_pmd
				map the page as THP page

Since it's not a THP page, system goes random crash after a while due to
conflict of VM THP handling with the driver compound page handling.
Even though it happens in old kernel with backporting THP pagecache,
I think it's still valid on recent kernel.

What's the best way to fix it? Driver don't do that or VM need to
deal with it?

Thank you.


             reply	other threads:[~2021-01-30  0:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30  0:13 Minchan Kim [this message]
2021-01-30  1:00 ` THP handling with driver compound page on fault 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
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=YBSkk0sZOQxgDNSO@google.com \
    --to=minchan@kernel.org \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --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;
as well as URLs for NNTP newsgroup(s).