From: Xin Li <xin@zytor.com>
To: Wupeng Ma <mawupeng1@huawei.com>,
akpm@linux-foundation.org, dave.hansen@linux.intel.com,
luto@kernel.org, tglx@linutronix.de, peterz@infradead.org,
hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, bp@suse.de,
mingo@redhat.com, rdunlap@infradead.org, bhelgaas@google.com,
linux-mm@kvack.org
Subject: Re: [PATCH v4 0/3] Cleanup for PAT
Date: Tue, 20 Feb 2024 00:37:41 -0800 [thread overview]
Message-ID: <07d43633-d707-415d-a662-ecd3a50b12ae@zytor.com> (raw)
In-Reply-To: <20240220034835.507022-1-mawupeng1@huawei.com>
On 2/19/2024 7:48 PM, Wupeng Ma wrote:
> From: Ma Wupeng <mawupeng1@huawei.com>
>
This patch set is all about follow_phys() cleanups, so "Cleanup for PAT"
seems too generic.
> Patch #1 move follow_phys to memtype.c since only pat use this.
> Patch #2 cleanup parameter in follow_phys.
> Patch #3 drop the unnecessary WARN_ON_ONCE if follow_phys fails.
I'm more curious why follow_phys() ended up this way?
follow_phys() was introduced in commit 28b2ee20c7cba ("access_process_vm
device memory infrastructure") in 2008 for getting a physical page address
for a virtual address, and used in generic_access_phys(). And later it's
used in x86 PAT code.
Commit 03668a4debf4f ("mm: use generic follow_pte() in follow_phys()") made
follow_phys() more of a wrapper of follow_pte(), and commit 96667f8a4382d
("mm: Close race in generic_access_phys") replaced follow_phys() with
follow_pte() in generic_access_phys(). And the end result is that
follow_phys() is used in x86 PAT code only.
As follow_phys() in untrack_pfn() can be replaced with follow_pfn(), then
maybe we don't have to keep follow_phys(), and just use follow_pte() in
track_pfn_copy()?
Thanks!
Xin
>
> Changelog since v3:
> - rebase to latest linux
> - fix compile warnings
>
> Changelog since v2:
> - rebase to latest linux
>
> Changelog since v1:
> - split patch #1 into two patches based on Boris's advise
>
> Ma Wupeng (3):
> x86/mm/pat: Move follow_phys to pat-related file
> x86/mm/pat: Cleanup unused parameter in follow_phys
> x86/mm/pat: Remove WARN_ON_ONCE if follow_phys fails
>
> arch/x86/mm/pat/memtype.c | 32 ++++++++++++++++++++++++++------
> include/linux/mm.h | 2 --
> mm/memory.c | 28 ----------------------------
> 3 files changed, 26 insertions(+), 36 deletions(-)
>
next prev parent reply other threads:[~2024-02-20 8:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 3:48 Wupeng Ma
2024-02-20 3:48 ` [PATCH v4 1/3] x86/mm/pat: Move follow_phys to pat-related file Wupeng Ma
2024-02-20 3:48 ` [PATCH v4 2/3] x86/mm/pat: Cleanup unused parameter in follow_phys Wupeng Ma
2024-02-20 3:48 ` [PATCH v4 3/3] x86/mm/pat: Remove WARN_ON_ONCE if follow_phys fails Wupeng Ma
2024-02-20 8:37 ` Xin Li [this message]
2024-02-20 9:06 ` [PATCH v4 0/3] Cleanup for PAT mawupeng
2024-02-20 18:46 ` Xin Li
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=07d43633-d707-415d-a662-ecd3a50b12ae@zytor.com \
--to=xin@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mawupeng1@huawei.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@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