[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUK+O0QI4o0CoVeT@piliu.users.ipa.redhat.com>
Date: Thu, 16 Sep 2021 11:47:07 +0800
From: Pingfan Liu <piliu@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Pingfan Liu <kernelfans@...il.com>, linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>, Wang Qing <wangqing@...o.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Santosh Sivaraj <santosh@...six.org>,
Sumit Garg <sumit.garg@...aro.org>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH 2/5] kernel/watchdog_hld: clarify the condition in
hardlockup_detector_event_create()
On Tue, Sep 14, 2021 at 09:06:27PM -0700, Andrew Morton wrote:
> On Wed, 15 Sep 2021 11:51:00 +0800 Pingfan Liu <kernelfans@...il.com> wrote:
>
> > hardlockup_detector_event_create() indirectly calls
> > kmem_cache_alloc_node(), which is blockable.
> >
> > So here, the really planned context is is_percpu_thread().
> >
> > ...
> >
> > --- 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());
>
> Can we avoid adding the BUG()? Find a way to emit a WARNing and then
> permit the kernel to continue?
>
Yes, WARN_ON() can work in this case.
Thanks,
Pingfan
Powered by blists - more mailing lists