From: SeongJae Park <sj@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: SeongJae Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@Oracle.com>,
David Hildenbrand <david@redhat.com>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Brendan Higgins <brendanhiggins@google.com>,
David Gow <davidgow@google.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/damon/tests/vaddr-kunit: init maple tree without MT_FLAGS_LOCK_EXTERN
Date: Wed, 4 Sep 2024 11:53:47 -0700 [thread overview]
Message-ID: <20240904185347.2253-1-sj@kernel.org> (raw)
In-Reply-To: <34f3e9bd-9323-43cc-8371-00d8847d8664@roeck-us.net>
On Wed, 4 Sep 2024 11:41:28 -0700 Guenter Roeck <linux@roeck-us.net> wrote:
> On 9/4/24 10:29, SeongJae Park wrote:
> > damon_test_three_regions_in_vmas() initializes a maple tree with
> > MM_MT_FLAGS. The flags contains MT_FLAGS_LOCK_EXTERN, which means
> > mt_lock of the maple tree will not be used. And therefore the maple
> > tree initialization code skips initialization of the mt_lock. However,
> > __link_vmas(), which adds vmas for test to the maple tree, uses the
> > mt_lock. In other words, the uninitialized spinlock is used. The
> > problem becomes clear when spinlock debugging is turned on, since it
> > reports spinlock bad magic bug.
> >
> > Fix the issue by excluding MT_FLAGS_LOCK_EXTERN from the maple tree
> > initialization flags. Note that we don't use empty flags to make it
> > further similar to the usage of mm maple tree, and to be prepared for
> > possible future changes, as suggested by Liam.
> >
> > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > Closes: https://lore.kernel.org/1453b2b2-6119-4082-ad9e-f3c5239bf87e@roeck-us.net
> > Fixes: d0cf3dd47f0d ("damon: convert __damon_va_three_regions to use the VMA iterator")
> > Suggested-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> > Signed-off-by: SeongJae Park <sj@kernel.org>
> > ---
> > Changes from v1
> > (https://lore.kernel.org/20240904004534.1189-1-sj@kernel.org)
> > - Keep lock usage and update the initialization flags (Liam)
>
> Not sure I understand how this is better. Is the resulting rcu warning
> considered to be irrelevant or a separate problem ?
I believe it's a separate potential problem (warning) that deserves a look.
Meanwhile, this patch is fixing an issue that is definitely a bug, so better to
fix right now, imho.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2024-09-04 18:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 17:29 [PATCH v2] mm/damon/tests/vaddr-kunit: init maple tree without MT_FLAGS_LOCK_EXTERN SeongJae Park
2024-09-04 18:41 ` Guenter Roeck
2024-09-04 18:53 ` SeongJae Park [this message]
2024-09-04 19:28 ` Liam R. Howlett
2024-09-04 19:58 ` Guenter Roeck
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=20240904185347.2253-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=Liam.Howlett@Oracle.com \
--cc=akpm@linux-foundation.org \
--cc=brendanhiggins@google.com \
--cc=damon@lists.linux.dev \
--cc=david@redhat.com \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@roeck-us.net \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.