From: Oscar Salvador <osalvador@suse.de>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: akpm@linux-foundation.org, hughd@google.com, willy@infradead.org,
david@redhat.com, 21cnbao@gmail.com, ryan.roberts@arm.com,
ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm: mincore: use folio_pte_batch() to batch process large folios
Date: Thu, 27 Mar 2025 11:49:28 +0100 [thread overview]
Message-ID: <Z-UtOF97qjcm4Hgu@localhost.localdomain> (raw)
In-Reply-To: <7ad05bc9299de5d954fb21a2da57f46dd6ec59d0.1742960003.git.baolin.wang@linux.alibaba.com>
On Wed, Mar 26, 2025 at 11:38:11AM +0800, Baolin Wang wrote:
> @@ -118,16 +120,31 @@ static int mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> walk->action = ACTION_AGAIN;
> return 0;
> }
> - for (; addr != end; ptep++, addr += PAGE_SIZE) {
> + for (; addr != end; ptep += step, addr += step * PAGE_SIZE) {
> pte_t pte = ptep_get(ptep);
>
> + step = 1;
> /* We need to do cache lookup too for pte markers */
> if (pte_none_mostly(pte))
> __mincore_unmapped_range(addr, addr + PAGE_SIZE,
> vma, vec);
> - else if (pte_present(pte))
> - *vec = 1;
> - else { /* pte is a swap entry */
> + else if (pte_present(pte)) {
> + if (pte_batch_hint(ptep, pte) > 1) {
AFAIU, you will only batch if the CONT_PTE is set, but that is only true for arm64,
and so we lose the ability to batch in e.g: x86 when we have contiguous
entries, right?
So why not have folio_pte_batch take care of it directly without involving
pte_batch_hint here?
--
Oscar Salvador
SUSE Labs
next prev parent reply other threads:[~2025-03-27 10:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 3:38 [PATCH 0/2] Fix mincore() tmpfs test failure Baolin Wang
2025-03-26 3:38 ` [PATCH 1/2] selftests: mincore: fix tmpfs mincore " Baolin Wang
2025-03-27 14:36 ` Zi Yan
2025-03-30 19:47 ` Baolin Wang
2025-04-01 12:54 ` David Hildenbrand
2025-04-07 3:49 ` Baolin Wang
2025-04-07 7:49 ` David Hildenbrand
2025-04-07 8:35 ` Baolin Wang
2025-03-26 3:38 ` [PATCH 2/2] mm: mincore: use folio_pte_batch() to batch process large folios Baolin Wang
2025-03-27 10:49 ` Oscar Salvador [this message]
2025-03-27 11:54 ` Baolin Wang
2025-03-27 14:08 ` Ryan Roberts
2025-03-28 13:10 ` Oscar Salvador
2025-03-30 19:57 ` Baolin Wang
2025-04-01 10:45 ` Ryan Roberts
2025-04-01 13:04 ` David Hildenbrand
2025-04-07 6:33 ` Baolin Wang
2025-04-14 13:46 ` Ryan Roberts
2025-05-07 5:12 ` Dev Jain
2025-05-07 9:48 ` Baolin Wang
2025-05-07 9:54 ` David Hildenbrand
2025-05-07 10:03 ` Baolin Wang
2025-05-07 11:14 ` Ryan Roberts
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=Z-UtOF97qjcm4Hgu@localhost.localdomain \
--to=osalvador@suse.de \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.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;
as well as URLs for NNTP newsgroup(s).