From: Matthew Wilcox <willy@infradead.org>
To: Chen Haixiang <chenhaixiang3@huawei.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hughd@google.com,
louhongxiang@huawei.com, wangbin224@huawei.com,
liuyuntao10@huawei.com
Subject: Re: [PATCH] support tmpfs hugepage PMD is not split when COW
Date: Wed, 10 Jan 2024 12:44:06 +0000 [thread overview]
Message-ID: <ZZ6RFoXNLGdpx9IQ@casper.infradead.org> (raw)
In-Reply-To: <20240110092028.1777-1-chenhaixiang3@huawei.com>
On Wed, Jan 10, 2024 at 05:20:28PM +0800, Chen Haixiang wrote:
> +++ b/include/linux/mm.h
> @@ -573,6 +573,7 @@ struct vm_operations_struct {
> unsigned long end, unsigned long newflags);
> vm_fault_t (*fault)(struct vm_fault *vmf);
> vm_fault_t (*huge_fault)(struct vm_fault *vmf, unsigned int order);
> + vm_fault_t (*shmem_huge_fault)(struct vm_fault *vmf, pmd_t orig_pmd);
No new operation for this.
> +++ b/mm/memory.c
> @@ -4942,6 +4942,13 @@ static inline vm_fault_t wp_huge_pmd(struct vm_fault *vmf)
> }
> }
>
> + if (vmf->vma->vm_ops->shmem_huge_fault) {
> + vm_fault_t ret = vmf->vma->vm_ops->shmem_huge_fault(vmf, vmf->orig_pmd);
> +
> + if (!(ret & VM_FAULT_FALLBACK))
> + return ret;
> + }
Why would you do this when ->huge_fault is called in the stanza above?
next prev parent reply other threads:[~2024-01-10 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 9:20 Chen Haixiang
2024-01-10 12:00 ` David Hildenbrand
2024-01-10 12:44 ` Matthew Wilcox [this message]
2024-01-11 0:03 ` kernel test robot
2024-01-11 2:10 ` kernel test robot
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=ZZ6RFoXNLGdpx9IQ@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=chenhaixiang3@huawei.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=liuyuntao10@huawei.com \
--cc=louhongxiang@huawei.com \
--cc=wangbin224@huawei.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