From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "manfred@colorfullife.com" <manfred@colorfullife.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "1vier1@web.de" <1vier1@web.de>,
"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH 3/3] kernel/irq/manage.c: disable_irq() might sleep.
Date: Fri, 23 Dec 2022 11:22:30 +0000 [thread overview]
Message-ID: <9593a9758731af70bdb6ad4f73af3ddc102571f1.camel@siemens.com> (raw)
In-Reply-To: <1540f1d0-4fda-aaf4-acda-f5aaa6952a00@colorfullife.com>
Hello Manfred,
On Fri, 2022-12-23 at 11:54 +0100, Manfred Spraul wrote:
> > I'm not sure about this, latest wait_event() inside
> > synchronize_irq()
> > has it already.
> >
> > > if (!__disable_irq_nosync(irq))
> > > synchronize_irq(irq);
> > > }
>
> That is the whole point: might_sleep() should be always called. We
> are
> clarifying an API definition. Everyone who uses disable_irq() from
> non-sleeping context should get a warning, 100% of the time.
>
> Not just within synchronize_irq() if there is an active threaded irq
> handler.
As I read it, it will warn almost always, even without threaded handler
configured, only in some error cases it will not warn. I'm just
thinking that disable_irq() might be in a hot path and this is being
checked anyway two calls deeper. But I don't have a strong opinion on
that and it looks like it has been taken into mm tree already.
--
Alexander Sverdlin
Siemens AG
www.siemens.com
next prev parent reply other threads:[~2022-12-23 11:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 15:01 [PATCH 0/3] various irq handling fixes/docu updates Manfred Spraul
2022-12-16 15:04 ` [PATCH 1/3] :lib/percpu_counter: percpu_counter_add_batch() overflow/underflow Manfred Spraul
2022-12-16 15:04 ` [PATCH 2/3] include/linux/percpu_counter.h: Race in uniprocessor percpu_counter_add() Manfred Spraul
2022-12-16 15:04 ` [PATCH 3/3] kernel/irq/manage.c: disable_irq() might sleep Manfred Spraul
2022-12-20 6:58 ` Sverdlin, Alexander
2022-12-23 10:54 ` Manfred Spraul
2022-12-23 11:22 ` Sverdlin, Alexander [this message]
2022-12-24 20:01 ` Andrew Morton
2023-01-11 18:38 ` [tip: irq/core] genirq: Add might_sleep() to disable_irq() tip-bot2 for Manfred Spraul
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=9593a9758731af70bdb6ad4f73af3ddc102571f1.camel@siemens.com \
--to=alexander.sverdlin@siemens.com \
--cc=1vier1@web.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=tglx@linutronix.de \
/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®