linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: will@kernel.org, mike.kravetz@oracle.com,
	songmuchun@bytedance.com, anshuman.khandual@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] arm64/hugetlb: Simplify the huge_ptep_set_access_flags()
Date: Fri, 17 Jun 2022 18:46:22 +0100	[thread overview]
Message-ID: <Yqy97gXI4Nqb7dYo@arm.com> (raw)
In-Reply-To: <d81f1c3215000d0f238900dbfa0a0976d8d00cd3.1653470369.git.baolin.wang@linux.alibaba.com>

On Wed, May 25, 2022 at 06:31:09PM +0800, Baolin Wang wrote:
> After commit bc5dfb4fd7bd ("arm64/hugetlb: Implement arm64 specific
> huge_ptep_get()"), the arm64 specific huge_ptep_get() will always
> consider the subpages' dirty and young state for CONT-PTE/PMD hugetlb,
> so there is no need to check them again when setting the access flags
> for CONT-PTE/PMD hugetlb in huge_ptep_set_access_flags().
> 
> Meanwhile this also fixes an issue when users want to make the CONT-PTE/PMD
> hugetlb's pte entry old, which will be failed to make the pte entry old
> since the original code will always consider the subpages' young state
> if the subpages' young state is set. For example, we will make the
> CONT-PTE/PMD hugetlb pte entry old in DAMON to monitoring the accesses,
> but we'll failed to monitoring the actual accesses of the CONT-PTE/PMD
> hugetlb page, due to we can not make its pte old.
> 
> Thus remove the code considering the subpages' dirty and young state in
> huge_ptep_set_access_flags() to fix this issue and simplify the function.

The ptep_set_access_flags() semantics (non-huge) never clear the access
flag, so mkold is not allowed. I think damon_hugetlb_mkold() is wrong in
assuming that huge_ptep_set_access_flags() allows a young->old huge pte
transition.

-- 
Catalin


  parent reply	other threads:[~2022-06-17 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 10:31 Baolin Wang
2022-06-09 15:44 ` Will Deacon
2022-06-10  3:57   ` Baolin Wang
2022-06-17 17:46 ` Catalin Marinas [this message]
2022-06-18  4:17   ` Baolin Wang

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=Yqy97gXI4Nqb7dYo@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=songmuchun@bytedance.com \
    --cc=will@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