[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34d76192-d00b-409a-8a1b-11a6c8433d66@zytor.com>
Date: Tue, 20 Feb 2024 10:46:37 -0800
From: Xin Li <xin@...or.com>
To: mawupeng <mawupeng1@...wei.com>, akpm@...ux-foundation.org,
dave.hansen@...ux.intel.com, luto@...nel.org, tglx@...utronix.de,
peterz@...radead.org, hpa@...or.com
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, bp@...e.de, mingo@...hat.com,
rdunlap@...radead.org, bhelgaas@...gle.com, linux-mm@...ck.org
Subject: Re: [PATCH v4 0/3] Cleanup for PAT
On 2/20/2024 1:06 AM, mawupeng wrote:
> On 2024/2/20 16:37, Xin Li wrote:
>> On 2/19/2024 7:48 PM, Wupeng Ma wrote:
>> 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.
>
> Thanks for the explanation. I have a better understanding of the history of
> this function.
>
"git blame" tells the story.
>>
>> As follow_phys() in untrack_pfn() can be replaced with follow_pfn(), then
>
> Yes, this can be replaced with follow_pfn().
>
>> maybe we don't have to keep follow_phys(), and just use follow_pte() in
>> track_pfn_copy()?
>
> As follow_phys() will return unsigned long *prot which is need in track_pfn_copy(),
> we need to do something with this.
Commit 96667f8a4382d did that already.
> Can we replace follow_pfn with follow_phys()?
Sorry, I don't get your point.
Thanks!
Xin
Powered by blists - more mailing lists