LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pingfan Liu <piliu@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Pingfan Liu <kernelfans@gmail.com>,
linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Wang Qing <wangqing@vivo.com>,
Santosh Sivaraj <santosh@fossix.org>,
Sumit Garg <sumit.garg@linaro.org>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 2/5] kernel/watchdog_hld: clarify the condition in hardlockup_detector_event_create()
Date: Thu, 16 Sep 2021 11:57:44 +0800 [thread overview]
Message-ID: <YULAuEeSSeLTcBM9@piliu.users.ipa.redhat.com> (raw)
In-Reply-To: <YUH44qrky9oM+3nU@hirez.programming.kicks-ass.net>
On Wed, Sep 15, 2021 at 03:45:06PM +0200, Peter Zijlstra wrote:
> On Wed, Sep 15, 2021 at 11:51:00AM +0800, Pingfan Liu wrote:
> > hardlockup_detector_event_create() indirectly calls
> > kmem_cache_alloc_node(), which is blockable.
> >
> > So here, the really planned context is is_percpu_thread().
> >
> > Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> > Cc: Petr Mladek <pmladek@suse.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Wang Qing <wangqing@vivo.com>
> > Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> > Cc: Santosh Sivaraj <santosh@fossix.org>
> > Cc: Sumit Garg <sumit.garg@linaro.org>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > To: linux-kernel@vger.kernel.org
> > ---
> > kernel/watchdog_hld.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c
> > index 247bf0b1582c..6876e796dbf5 100644
> > --- a/kernel/watchdog_hld.c
> > +++ b/kernel/watchdog_hld.c
> > @@ -165,10 +165,13 @@ static void watchdog_overflow_callback(struct perf_event *event,
> >
> > static int hardlockup_detector_event_create(void)
> > {
> > - unsigned int cpu = smp_processor_id();
> > + unsigned int cpu;
> > struct perf_event_attr *wd_attr;
> > struct perf_event *evt;
> >
> > + /* This function plans to execute in cpu bound kthread */
> > + BUG_ON(!is_percpu_thread());
> > + cpu = raw_smp_processor_id();
> > wd_attr = &wd_hw_attr;
> > wd_attr->sample_period = hw_nmi_get_sample_period(watchdog_thresh);
>
> This patch makes no sense.
This patch aims to disable any attempt such as using get_cpu()/put_cpu() to
shut up the check_preemption_disabled().
But if anybody is familiar with the integration of watchdog_hld and
cpuhp, he should know the right way without this BUG_ON() or warn.
Do you still think it is pointless?
Thanks,
Pingfan
next prev parent reply other threads:[~2021-09-16 3:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 3:50 [PATCH 0/5] watchdog_hld cleanup and async model for arm64 Pingfan Liu
2021-09-15 3:50 ` [PATCH 1/5] kernel/watchdog: remove useless WATCHDOG_DEFAULT Pingfan Liu
2021-09-15 3:51 ` [PATCH 2/5] kernel/watchdog_hld: clarify the condition in hardlockup_detector_event_create() Pingfan Liu
2021-09-15 4:06 ` Andrew Morton
2021-09-16 3:47 ` Pingfan Liu
2021-09-15 13:45 ` Peter Zijlstra
2021-09-16 3:57 ` Pingfan Liu [this message]
2021-09-16 8:02 ` Petr Mladek
2021-09-17 15:08 ` Pingfan Liu
2021-09-15 3:51 ` [PATCH 3/5] kernel/watchdog: adapt the watchdog_hld interface for async model Pingfan Liu
2021-09-15 14:02 ` Peter Zijlstra
2021-09-16 3:07 ` Pingfan Liu
2021-09-16 8:29 ` Petr Mladek
2021-09-16 8:36 ` Petr Mladek
2021-09-17 15:41 ` Pingfan Liu
2021-09-20 8:20 ` Petr Mladek
2021-09-22 4:26 ` Pingfan Liu
2021-09-17 14:43 ` Pingfan Liu
2021-09-15 3:51 ` [PATCH 4/5] kernel/watchdog_hld: simplify the detecting of hld watchdog Pingfan Liu
2021-09-15 3:51 ` [PATCH 5/5] arm64/watchdog_hld: enable hard lockup on arm64 platform Pingfan Liu
2021-09-17 15:11 ` Pingfan Liu
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=YULAuEeSSeLTcBM9@piliu.users.ipa.redhat.com \
--to=piliu@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kernelfans@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=santosh@fossix.org \
--cc=sumit.garg@linaro.org \
--cc=wangqing@vivo.com \
--cc=will@kernel.org \
--subject='Re: [PATCH 2/5] kernel/watchdog_hld: clarify the condition in hardlockup_detector_event_create()' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).