From: Stanislav Kinsburskii <skinsburskii@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kernel test robot <lkp@intel.com>,
David Hildenbrand <david@kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
mm-commits@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
Leon Romanovsky <leon@kernel.org>
Subject: Re: [akpm-mm:mm-new] BUILD SUCCESS WITH UNVERIFIED WARNING 34cacd0ac7c10dc9e34e1b9f28a2b78d335cb487
Date: Sun, 26 Jul 2026 11:41:26 -0700 [thread overview]
Message-ID: <amZU1hH_9IOeO4G8@skinsburskii> (raw)
In-Reply-To: <20260725193155.0e03a382d76a99485ca05cdd@linux-foundation.org>
On Sat, Jul 25, 2026 at 07:31:55PM -0700, Andrew Morton wrote:
>
> Thanks. A few head-scratchers for hmm people, please:
>
> On Sat, 25 Jul 2026 15:11:38 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
> > branch HEAD: 34cacd0ac7c10dc9e34e1b9f28a2b78d335cb487 mm/swap, PM: hibernate: atomically replace hibernation pin
> >
> > Unverified Warning (likely false positive, kindly check if interested):
> >
> > https://lore.kernel.org/oe-kbuild/202607021433.DYT5fDqE-lkp@intel.com
> > https://lore.kernel.org/oe-kbuild/202607120402.clBrrZQA-lkp@intel.com
> >
> > mm/hmm.c:673 hmm_do_fault() error: we previously assumed 'hmm_vma_walk->locked' could be null (see line 654)
> > mm/vmpressure.c:123 vmpressure() warn: check likely/unlikely parentheses
> >
> > Warning ids grouped by kconfigs:
> >
> > recent_errors
> > |-- microblaze-randconfig-r072-20260725
> > | `-- mm-hmm.c-hmm_do_fault()-error:we-previously-assumed-hmm_vma_walk-locked-could-be-null-(see-line-)
>
> With this microblaze config on current mainline I hit
>
> mm/hmm.c:804:25: error: implicit declaration of function 'mmu_interval_read_begin'; did you mean 'mmu_interval_check_retry'? [-Wimplicit-function-declaration]
> 804 | mmu_interval_read_begin(range->notifier);
>
> And after adding the hmm changes from mm-unstable I also hit
>
> mm/hmm.c:805:25: error: implicit declaration of function 'mmu_interval_read_begin'; did you mean 'mmu_interval_check_retry'? [-Wimplicit-function-declaration]
> 805 | mmu_interval_read_begin(range->notifier);
> | ^~~~~~~~~~~~~~~~~~~~~~~
> | mmu_interval_check_retry
>
> Both of which can be fixed with
>
> --- a/include/linux/mmu_notifier.h~a
> +++ a/include/linux/mmu_notifier.h
> @@ -576,6 +576,19 @@ static inline void _mmu_notifier_range_i
> _mmu_notifier_range_init(range, start, end)
>
> static inline bool
> +mmu_interval_check_retry(struct mmu_interval_notifier *interval_sub,
> + unsigned long seq)
> +{
> + return true;
> +}
> +
> +static inline unsigned long
> +mmu_interval_read_begin(struct mmu_interval_notifier *interval_sub)
> +{
> + return 0;
> +}
> +
> +static inline bool
> mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
> {
> return true;
>
> But I do wonder whether we should be compiling hmm at all if
> CONFIG_MMU_NOTIFIER=n?
>
Documentation/mm/hmm.rst explicitly states:
"Address space mirroring's main objective is to allow duplication of a range of
CPU page table into a device page table; HMM helps keep both synchronized. A
device driver that wants to mirror a process address space must start with the
registration of a mmu_interval_notifier"
I think making CONFIG_HMM_MIRROR dependent on the CONFIG_MMU_NOTIFIER is the right thing to do.
>
> And your hmm_do_fault() warning seems legit:
>
> if (hmm_vma_walk->locked)
> fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
>
> ...
> *hmm_vma_walk->locked = false;
>
> and the blame seems to lie with Stanislav's "mm/hmm: add
> hmm_range_fault_unlocked_timeout() for mmap lock-drop support".
>
Well, this is the same behavior as in fixup_user_fault().
The fault handler is not supposed to return either VM_FAULT_COMPLETED or
VM_FAULT_RETRY unless FAULT_FLAG_ALLOW_RETRY is set, and that flag is
set only if hmm_vma_walk->locked is not NULL.
In other words, only buggy fault handlers can trigger this NULL pointer
dereference, and I thought we had agreed that we do not try to support
those.
Let me know if you think otherwise and I'll send an update.
Thanks, Stanislav
>
next prev parent reply other threads:[~2026-07-26 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 7:11 [akpm-mm:mm-new] BUILD SUCCESS WITH UNVERIFIED WARNING 34cacd0ac7c10dc9e34e1b9f28a2b78d335cb487 kernel test robot
2026-07-26 2:31 ` Andrew Morton
2026-07-26 18:41 ` Stanislav Kinsburskii [this message]
2026-07-28 0:38 ` Andrew Morton
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=amZU1hH_9IOeO4G8@skinsburskii \
--to=skinsburskii@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mm-commits@vger.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