held,
> so we should get pmdval and do pmd_same() check to ensure the stability of
> pvmw->pmd.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
Thanks.
should get pgt_pmd and do pmd_same() check after the ptl held.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
Thanks.
> On Sep 24, 2024, at 16:57, Qi Zheng wrote:
>
>
>
> On 2024/9/24 16:52, Muchun Song wrote:
>>> On Sep 24, 2024, at 15:29, Qi Zheng wrote:
>>>
>>>
>>>
>>> On 2024/9/24 15:14, Muchun Song wrote:
>>>>> On Sep 24, 2
> On Sep 24, 2024, at 15:29, Qi Zheng wrote:
>
>
>
> On 2024/9/24 15:14, Muchun Song wrote:
>>> On Sep 24, 2024, at 14:11, Qi Zheng wrote:
>>> In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after
>>> acquring the ptl, so co
> On Sep 24, 2024, at 16:33, Qi Zheng wrote:
>
>
>
> On 2024/9/24 16:25, Muchun Song wrote:
>>> On Sep 24, 2024, at 14:11, Qi Zheng wrote:
>>>
>>> In the caller of map_pte(), we may modify the pvmw->pte after acquiring
>>> the pvmw
> On Sep 24, 2024, at 14:11, Qi Zheng wrote:
>
> In the caller of map_pte(), we may modify the pvmw->pte after acquiring
> the pvmw->ptl, so convert it to using pte_offset_map_rw_nolock(). At
> this time, the pte_same() check is not performed after the pvmw->ptl held,
> so we should get pmdva
_mapping, so there is no concurrency with retract_page_tables(). In
> addition, we already hold the exclusive mmap_lock, so this new_pte page is
> stable, so there is no need to get pmdval and do pmd_same() check.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
tables() are using vma->anon_vma to be exclusive, so the PTE
> page is stable, there is no need to get pmdval and do pmd_same() check.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
> On Sep 24, 2024, at 14:11, Qi Zheng wrote:
> In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after
> acquring the ptl, so convert it to using pte_offset_map_rw_nolock(). At
> this time, the pte_same() check is not performed after the PTL held. So we
> should get pgt_pmd and
vert pte_offset_map_nolock() into the above
> two functions one by one, and finally completely delete it.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
On 2024/9/4 16:40, Qi Zheng wrote:
Currently, the usage of pte_offset_map_nolock() can be divided into the
following two cases:
1) After acquiring PTL, only read-only operations are performed on the PTE
page. In this case, the RCU lock in pte_offset_map_nolock() will ensure
that the P
> On Sep 4, 2024, at 16:40, Qi Zheng wrote:
>
> Now no users are using the pte_offset_map_nolock(), remove it.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
Thanks.
al and do pmd_same() check to ensure the stability of pmd entry.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
Thanks.
; pmd_same() check, just pass a dummy variable to it.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
Thanks.
On 2024/9/4 16:40, Qi Zheng wrote:
In the caller of map_pte(), we may modify the pvmw->pte after acquiring
the pvmw->ptl, so convert it to using pte_offset_map_rw_nolock(). At
this time, the pte_same() check is not performed after the pvmw->ptl held,
so we should get pmdval and do pmd_same() c
On 2024/9/4 16:40, Qi Zheng wrote:
In move_ptes(), we may modify the new_pte after acquiring the new_ptl, so
convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE
page in retract_page_tables() without holding the read lock of mmap_lock,
so we still need to do a pmd_same() c
On 2024/9/4 16:40, Qi Zheng wrote:
In copy_pte_range(), we may modify the src_pte entry after holding the
src_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may
free the PTE page in retract_page_tables() without holding the read lock
of mmap_lock, so we still need to get pmdv
> On Sep 5, 2024, at 14:41, Qi Zheng wrote:
>
>
>
> On 2024/9/5 14:32, Muchun Song wrote:
>>> On Aug 30, 2024, at 14:54, Qi Zheng wrote:
>>>
>>>
>>>
>>> On 2024/8/29 16:10, Muchun Song wrote:
>>>> On 2024/8/22 15:1
> On Aug 30, 2024, at 14:54, Qi Zheng wrote:
>
>
>
> On 2024/8/29 16:10, Muchun Song wrote:
>> On 2024/8/22 15:13, Qi Zheng wrote:
>>> In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after
>>> acquring the ptl, so convert it to using
gt; to do pmd_same() check, just pass a dummy variable to it.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
On 2024/8/22 15:13, Qi Zheng wrote:
In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after
acquring the ptl, so convert it to using pte_offset_map_rw_nolock(). At
this time, the write lock of mmap_lock is not held, and the pte_same()
check is not performed after the PTL held.
; pmd_same() check, just pass a dummy variable to it.
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
A nit below.
> ---
> mm/memory.c | 12 ++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 93c0c25
: Qi Zheng
Reviewed-by: Muchun Song
> On Aug 22, 2024, at 15:13, Qi Zheng wrote:
>
> In filemap_fault_recheck_pte_none(), we just do pte_none() check, so
> convert it to using pte_offset_map_ro_nolock().
>
> Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
On 2024/8/22 15:13, Qi Zheng wrote:
In assert_pte_locked(), we just get the ptl and assert if it was already
held, so convert it to using pte_offset_map_ro_nolock().
Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
modified
concurrently. Therefore, in order to ensure the stability if pmd entry,
use pte_offset_map_rw_nolock() to replace pte_offset_map_nolock(),
and do
pmd_same() check after holding the PTL.
Signed-off-by: Qi Zheng
Reviewed-by: Muchun Song
---
arch/arm/mm/fault-armv.c | 9 -
1
On 2024/8/22 15:13, Qi Zheng wrote:
Currently, the usage of pte_offset_map_nolock() can be divided into the
following two cases:
1) After acquiring PTL, only read-only operations are performed on the PTE
page. In this case, the RCU lock in pte_offset_map_nolock() will ensure
that the
> On Mar 19, 2024, at 04:03, pet...@redhat.com wrote:
>
> From: Peter Xu
>
> Please refer to the previous patch on the reasoning for x86. Now sparc is
> the only architecture that will allow swap entries to be reported as
> pXd_huge(). After this patch, all architectures should forbid swap
t; Returned address is 0x7e00 whose pfn is 600
>> *#
>>
>> Result on x86 with patch (page size 4K)
>> *# ./hugepage-vmemmap
>> Returned address is 0x7fc7c2c0 whose pfn is 1dac00
>> *#
>>
>> Signed-off-by: Donet Tom
>> Reported
> On Jan 2, 2024, at 13:37, Peter Xu wrote:
>
> On Mon, Dec 25, 2023 at 02:29:53PM +0800, Muchun Song wrote:
>>> @@ -1355,6 +1355,10 @@ static inline int pmd_write(pmd_t pmd)
>>> #endif /* pmd_write */
>>> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>>
> On Jan 2, 2024, at 13:39, Peter Xu wrote:
>
> On Mon, Dec 25, 2023 at 02:34:48PM +0800, Muchun Song wrote:
>> Reviewed-by: Muchun Song
>
> You're using the old email address here. Do you want me to also use the
> linux.dev one that you suggested me to use?
y: Christoph Hellwig
> Signed-off-by: Peter Xu
Reviewed-by: Muchun Song
Thanks.
On 2023/12/19 15:55, pet...@redhat.com wrote:
From: Peter Xu
ARM defines pmd_thp_or_huge(), detecting either a THP or a huge PMD. It
can be a helpful helper if we want to merge more THP and hugetlb code
paths. Make it a generic default implementation, only exist when
CONFIG_MMU. Arch can
> Signed-off-by: Baolin Wang
> Signed-off-by: Mike Kravetz
Acked-by: Muchun Song
Thanks.
GENERAL_HUGETLB is defined.
> Architectures which provide their own versions of huge_pte_offset can also
> provide their own version of hugetlb_mask_last_page.
>
> Signed-off-by: Mike Kravetz
> Tested-by: Baolin Wang
> Reviewed-by: Baolin Wang
It'll be more efficient, Thanks.
Acked-by: Muchun Song
age. Meanwhile adding a VM_BUG_ON()
> to make sure the passed hugetlb page is poisoned in try_to_unmap().
>
> Signed-off-by: Baolin Wang
Reviewed-by: Muchun Song
Thanks.
On Sun, May 08, 2022 at 09:09:55PM +0800, Baolin Wang wrote:
>
>
> On 5/8/2022 7:09 PM, Muchun Song wrote:
> > On Sun, May 08, 2022 at 05:36:39PM +0800, Baolin Wang wrote:
> > > It is incorrect to use ptep_clear_flush() to nuke a hugetlb page
> > > table when
e hugetlb.
>
> Signed-off-by: Baolin Wang
This looks fine to me.
Reviewed-by: Muchun Song
Thanks.
eparation patch, which changes the huge_ptep_clear_flush()
> to return the original pte to help to nuke a hugetlb page table.
>
> Signed-off-by: Baolin Wang
> Acked-by: Mike Kravetz
Reviewed-by: Muchun Song
But one nit below:
[...]
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
&
39 matches
Mail list logo