From: Conor Dooley <conor.dooley@microchip.com>
To: Changbin Du <changbin.du@huawei.com>
Cc: Guo Ren <guoren@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Hui Wang <hw.huiwang@huawei.com>,
<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
Changbin Du <changbin.du@gmail.com>, Zong Li <zong.li@sifive.com>
Subject: Re: [PATCH v3] riscv: patch: Fixup lockdep warning in stop_machine
Date: Thu, 2 Feb 2023 08:01:44 +0000 [thread overview]
Message-ID: <Y9tt6MCMXK4c8W6E@wendy> (raw)
In-Reply-To: <20230202230043.737f6z3mi2thukgz@M910t>
[-- Attachment #1.1: Type: text/plain, Size: 3180 bytes --]
On Fri, Feb 03, 2023 at 07:00:43AM +0800, Changbin Du wrote:
btw, something is wrong with your mail client or host machine.
Everything that you are sending is timestamped in the future,
as it is currently 15:57 on the 2nd in UTC+8.
> On Wed, Feb 01, 2023 at 02:01:07PM +0000, Conor Dooley wrote:
> > On Thu, Feb 02, 2023 at 05:00:31AM +0800, Changbin Du wrote:
> > > On Tue, Jan 31, 2023 at 07:50:20AM +0000, Conor Dooley wrote:
> > > > On Tue, Jan 31, 2023 at 03:26:33PM +0800, Guo Ren wrote:
> > > [snip]
> > > > > > >
> > > > > > > - /*
> > > > > > > - * Before reaching here, it was expected to lock the text_mutex
> > > > > > > - * already, so we don't need to give another lock here and could
> > > > > > > - * ensure that it was safe between each cores.
> > > > > > > - */
> > > > > > > - lockdep_assert_held(&text_mutex);
> > > > > >
> > > > > > I must admit, patches like this do concern me a little, as a someone
> > > > > > unfamiliar with the world of probing and tracing.
> > > > > > Seeing an explicit check that the lock was held, leads me to believe
> > > > > > that the original author (Zong Li I think) thought that the text_mutex
> > > > > > lock was insufficient.
> > > > > > Do you think that their fear is unfounded? Explaining why it is safe to
> > > > > > remove this assertion in the commit message would go a long way towards
> > > > > > easing my anxiety!
> > > > > >
> > > > > > Also, why delete the comment altogether? The comment provides some
> > > > > > information that doesn't appear to become invalid, even with the
> > > > > > assertion removed?
> > > > > Stop_machine separated the mutex context and made a lockdep warning.
> > > > > So text_mutex can't be used here. We need to find another check
> > > > > solution. I agree with the patch.
> > > >
> > > > Whether or not you agree with the change is not the point (with your SoB
> > > > I'd hope you agree with it).
> > > > I understand that you two are trying to fix a false positive lockdep
> > > > warning, but what I am asking for an explanation as to why the original
> > > > author's fear is unfounded.
> > > > Surely, having added the assertion, they were not thinking of the same
> > > > code path that you guys are hitting the false positive on?
> > > >
> > > The assertion is reasonable since the fixmap entry is shared. The text_mutex
> > > does should be held before entering that function. But the false positive cases
> > > make some functions (ftrace for example) difficult to use due to warning log
> > > storm.
> > >
> > > Either the lockdep should be fixed for stop_machine, or remove the assertion
> > > simply now (we can keep the comments). (or do the assertion conditionly?)
> >
> > How would you suggest checking it conditionally?
> >
> Please refer to a early patch from Palmer Dabbelt.
> https://lore.kernel.org/all/20220322022331.32136-1-palmer@rivosinc.com/
Oh cool, thanks for that.
Why not resend that approach, with your suggested fixup for
ftrace_init_nop() then?
It looks more complex, but is less worrisome & has an R-b from Steven
already.
Thanks,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor.dooley@microchip.com>
To: Changbin Du <changbin.du@huawei.com>
Cc: Guo Ren <guoren@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Hui Wang <hw.huiwang@huawei.com>,
<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
Changbin Du <changbin.du@gmail.com>, Zong Li <zong.li@sifive.com>
Subject: Re: [PATCH v3] riscv: patch: Fixup lockdep warning in stop_machine
Date: Thu, 2 Feb 2023 08:01:44 +0000 [thread overview]
Message-ID: <Y9tt6MCMXK4c8W6E@wendy> (raw)
In-Reply-To: <20230202230043.737f6z3mi2thukgz@M910t>
[-- Attachment #1: Type: text/plain, Size: 3180 bytes --]
On Fri, Feb 03, 2023 at 07:00:43AM +0800, Changbin Du wrote:
btw, something is wrong with your mail client or host machine.
Everything that you are sending is timestamped in the future,
as it is currently 15:57 on the 2nd in UTC+8.
> On Wed, Feb 01, 2023 at 02:01:07PM +0000, Conor Dooley wrote:
> > On Thu, Feb 02, 2023 at 05:00:31AM +0800, Changbin Du wrote:
> > > On Tue, Jan 31, 2023 at 07:50:20AM +0000, Conor Dooley wrote:
> > > > On Tue, Jan 31, 2023 at 03:26:33PM +0800, Guo Ren wrote:
> > > [snip]
> > > > > > >
> > > > > > > - /*
> > > > > > > - * Before reaching here, it was expected to lock the text_mutex
> > > > > > > - * already, so we don't need to give another lock here and could
> > > > > > > - * ensure that it was safe between each cores.
> > > > > > > - */
> > > > > > > - lockdep_assert_held(&text_mutex);
> > > > > >
> > > > > > I must admit, patches like this do concern me a little, as a someone
> > > > > > unfamiliar with the world of probing and tracing.
> > > > > > Seeing an explicit check that the lock was held, leads me to believe
> > > > > > that the original author (Zong Li I think) thought that the text_mutex
> > > > > > lock was insufficient.
> > > > > > Do you think that their fear is unfounded? Explaining why it is safe to
> > > > > > remove this assertion in the commit message would go a long way towards
> > > > > > easing my anxiety!
> > > > > >
> > > > > > Also, why delete the comment altogether? The comment provides some
> > > > > > information that doesn't appear to become invalid, even with the
> > > > > > assertion removed?
> > > > > Stop_machine separated the mutex context and made a lockdep warning.
> > > > > So text_mutex can't be used here. We need to find another check
> > > > > solution. I agree with the patch.
> > > >
> > > > Whether or not you agree with the change is not the point (with your SoB
> > > > I'd hope you agree with it).
> > > > I understand that you two are trying to fix a false positive lockdep
> > > > warning, but what I am asking for an explanation as to why the original
> > > > author's fear is unfounded.
> > > > Surely, having added the assertion, they were not thinking of the same
> > > > code path that you guys are hitting the false positive on?
> > > >
> > > The assertion is reasonable since the fixmap entry is shared. The text_mutex
> > > does should be held before entering that function. But the false positive cases
> > > make some functions (ftrace for example) difficult to use due to warning log
> > > storm.
> > >
> > > Either the lockdep should be fixed for stop_machine, or remove the assertion
> > > simply now (we can keep the comments). (or do the assertion conditionly?)
> >
> > How would you suggest checking it conditionally?
> >
> Please refer to a early patch from Palmer Dabbelt.
> https://lore.kernel.org/all/20220322022331.32136-1-palmer@rivosinc.com/
Oh cool, thanks for that.
Why not resend that approach, with your suggested fixup for
ftrace_init_nop() then?
It looks more complex, but is less worrisome & has an R-b from Steven
already.
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-02-02 8:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 23:26 [PATCH v3] riscv: patch: Fixup lockdep warning in stop_machine Changbin Du
2023-01-30 23:26 ` Changbin Du
2023-01-30 15:09 ` Conor Dooley
2023-01-30 15:09 ` Conor Dooley
2023-01-31 7:26 ` Guo Ren
2023-01-31 7:26 ` Guo Ren
2023-01-31 7:50 ` Conor Dooley
2023-01-31 7:50 ` Conor Dooley
2023-02-01 21:00 ` Changbin Du
2023-02-01 21:00 ` Changbin Du
2023-02-01 14:01 ` Conor Dooley
2023-02-01 14:01 ` Conor Dooley
2023-02-02 23:00 ` Changbin Du
2023-02-02 23:00 ` Changbin Du
2023-02-02 8:01 ` Conor Dooley [this message]
2023-02-02 8:01 ` Conor Dooley
2023-02-02 11:39 ` Changbin Du
2023-02-02 11:39 ` Changbin Du
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=Y9tt6MCMXK4c8W6E@wendy \
--to=conor.dooley@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=changbin.du@gmail.com \
--cc=changbin.du@huawei.com \
--cc=guoren@kernel.org \
--cc=hw.huiwang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=zong.li@sifive.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 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.