From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
To: Oliver Sang <oliver.sang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
lkp@lists.01.org, lkp@intel.com
Subject: Re: [mm] 408579cd62: WARNING:suspicious_RCU_usage
Date: Tue, 4 Jul 2023 14:04:32 -0400 [thread overview]
Message-ID: <20230704180432.mapeimtivfe5l5kd@revolver> (raw)
In-Reply-To: <20230704152548.afqtyylbrxzunq55@revolver>
* Liam R. Howlett <Liam.Howlett@Oracle.com> [230704 11:25]:
> * Oliver Sang <oliver.sang@intel.com> [230704 09:51]:
...
> > > Ok, that is indeed a very different stack trace.
> > >
> > > So maybe the fix is a real fix, but the first complaint shut up
> > > lockdep, so this is the *second* and unrelated complaint.
> > >
> > > And indeed: it turns out that do_vma_munmap() does this:
> > >
> > > ret = do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
> > > validate_mm(mm);
> > >
> > > and so we have *another* validate_mm() that is now done outside the lock.
> > >
> > > That one is actually pretty pointless. We've *just* validated the mm
> > > already inside do_vmi_align_munmap(), except we only did it in one of
> > > the two return cases.
> > >
> > > So I think the fix is to just move that validate_mm() into the other
> > > return case of do_vmi_align_munmap(), and remove it from the caller.
> > >
> > > IOW, something like the attached (NOTE! This is in *addition* to the
> > > previous patch, which is the same as the one you quoted, just with
> > > slightly different whitespace as commit ae80b4041984: "mm: validate
> > > the mm before dropping the mmap lock").
> >
> > Thanks a lot for guidance!
> > I applied below patch directly upon ae80b4041984, and confirmed the
> > WARNING gone. Thanks
> >
>
> Thanks for testing this.
>
> I can clean more of this up now that the mmap locking has been changed.
> For instance, we can drop a number of checks before a write (and all
> read cases, if any remain) since there is no alteration without the
> write lock.
Thanks Linus for fixing the two issues causing rcu warnings - my testing
had lockdep & maple tree debug, so I'm still working on why my testing
failed on the initial patch.
For the time being, I've used the config from the bot to test a larger
cleanup of this code. I'll send it through the mm development as to get
better test coverage.
Regards,
Liam
prev parent reply other threads:[~2023-07-04 18:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 2:04 kernel test robot
2023-07-03 4:34 ` Linus Torvalds
2023-07-03 17:00 ` Conor Dooley
2023-07-03 17:07 ` Linus Torvalds
2023-07-03 17:20 ` Conor Dooley
2023-07-03 17:34 ` Marc Zyngier
2023-07-03 17:46 ` Linus Torvalds
2023-07-03 18:11 ` Palmer Dabbelt
2023-07-03 18:33 ` Marc Zyngier
2023-07-04 1:46 ` Oliver Sang
2023-07-04 2:29 ` Linus Torvalds
2023-07-04 13:51 ` Oliver Sang
2023-07-04 15:25 ` Liam R. Howlett
2023-07-04 18:04 ` Liam R. Howlett [this message]
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=20230704180432.mapeimtivfe5l5kd@revolver \
--to=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lkp@lists.01.org \
--cc=oliver.sang@intel.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®