From: sashiko-bot@kernel.org
To: "Alexander Gordeev" <agordeev@linux.ibm.com>
Cc: "Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH v7 1/4] mm: Make lazy MMU mode context-aware
Date: Mon, 17 Aug 2026 11:49:01 +0000 [thread overview]
Message-ID: <20260817114902.3771F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <5ee7bee9fa47e623a8cecb11b97392d38adb843a.1786956464.git.agordeev@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Setting `walk->action = ACTION_AGAIN` when `pte_offset_map_lock()` fails creates an infinite loop for non-present PMD migration entries.
--
--- Patch [1]: [PATCH v7 1/4] mm: Make lazy MMU mode context-aware ---
commit 1d7b684aa5a3ef0f53973a6ad48d5f71e845692f
Author: Alexander Gordeev <agordeev@linux.ibm.com>
mm: Make lazy MMU mode context-aware
This commit introduces lazy_mmu_mode_enable_with_ptes(), which provides the
process address space and page table being operated on. This enables s390
and other architectures to apply specific optimizations when entering lazy
MMU mode.
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 5c54aebe21182..b8c8d7dda0950 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -2883,7 +2883,7 @@ static int pagemap_scan_pmd_entry(pmd_t *pmd, unsigned long start,
> return 0;
> }
>
> - lazy_mmu_mode_enable();
> + lazy_mmu_mode_enable_with_ptes(vma->vm_mm, start, end, start_pte);
[Severity: High]
This is a pre-existing issue, but since you are modifying
pagemap_scan_pmd_entry() here, I wanted to ask about the page table lock
failure path just above this change.
If the lock fails to map the page table (for instance, because of a
non-present PMD migration entry during concurrent transparent hugepage
migration), the code sets the walk action to retry:
if (!pte) {
walk->action = ACTION_AGAIN;
return 0;
}
Because pte_offset_map_lock() will fail non-transiently for migration
entries, does setting ACTION_AGAIN here create an infinite loop?
Could a local user trigger this by reading /proc/pid/pagemap concurrently
with a page migration, causing the thread to hang indefinitely? It seems
that gracefully skipping the failure by returning 0 without setting
ACTION_AGAIN might be safer.
This same ACTION_AGAIN retry pattern on lock failure appears in several
other callbacks:
- smaps_pte_range(), clear_refs_pte_range(), and pagemap_pmd_range() in
fs/proc/task_mmu.c
- mincore_pte_range() in mm/mincore.c
- mlock_pte_range() in mm/mlock.c
- queue_folios_pte_range() in mm/mempolicy.c
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1786956464.git.agordeev@linux.ibm.com?part=1
next prev parent reply other threads:[~2026-08-17 11:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 11:32 [PATCH v7 0/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:32 ` [PATCH v7 1/4] mm: Make lazy MMU mode context-aware Alexander Gordeev
2026-08-17 11:49 ` sashiko-bot [this message]
2026-08-17 11:33 ` [PATCH v7 2/4] s390/mm: Batch PTE updates in lazy MMU mode Alexander Gordeev
2026-08-17 11:48 ` sashiko-bot
2026-08-17 11:33 ` [PATCH v7 3/4] mm/kasan: Introduce helpers for lazy MMU mode sanitizer Alexander Gordeev
2026-08-17 11:43 ` sashiko-bot
2026-08-17 11:33 ` [PATCH v7 4/4] s390/mm: Lazy " Alexander Gordeev
2026-08-17 11:40 ` sashiko-bot
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=20260817114902.3771F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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