mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Esben Haabendal <esbenhaabendal@gmail.com>
Cc: Marc Zyngier <maz@misterjones.org>,
	Esben Haabendal <eha@doredevelopment.dk>,
	linux-kernel@vger.kernel.org, mingo@elte.hu,
	joachim.eastwood@jotron.com
Subject: Re: [RFC][PATCH] irq: support IRQ_NESTED_THREAD with non-threaded interrupt handlers
Date: Sat, 5 Jun 2010 20:52:32 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1006051915290.2933@localhost.localdomain> (raw)
In-Reply-To: <AANLkTimlSBEhl58CNuScKjxbqdTwTYgqo7vrHTcd1x9G@mail.gmail.com>

Esben,

On Sat, 5 Jun 2010, Esben Haabendal wrote:

> On Sat, Jun 5, 2010 at 5:33 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Sat, 5 Jun 2010, Marc Zyngier wrote:
> >> You may want to give request_any_context_irq() a try (available since the
> >> latest merge window). It still requires your driver to be changed, but it
> >> should then work in both threaded and non-threaded cases.
> >
> > And it nicely annotates that somebody looked at the driver in
> > question. That's the rule of least surprise and does not impose checks
> > on the fast path.
> 
> What in particular should I be looking for in a driver before changing
> from request_irq() to request_any_context_irq() ?

Whether the irq handler relies on interrupts being disabled is the
most important thing. There are other constraints like
enable_irq/disable_irq calls from the driver code, which are not
allowed to run in atomic context for interrupt hanging of a i2c irq
controller.

> As for not checking in the fast path, it should be noted that this is "only"
> in handle_nested_irq(), which is only used in few interupt controller
> drivers, all of which I assume are generally not considered very "fast".

Fair enough. Still I fundamentaly dislike the automagic handling of
this and especially the irq disabled portion of it.
 
> Unless all interrupt handlers should be rewritten to be able to in both
> thread and interrupt context, I fail to se the conflict between the patch
> proposed and the work being done on request_any_context_irq().

It's not a question of conflict. It's a question of semantics.

We had and still have enough surprises in preempt-rt where we force
thread all handlers which were caused by various assumptions in the
handler code. I really prefer that the system yells in such a case
instead of letting run people into hard to debug problems silently.

The sanity check there makes the problem entirely obvious and forces
people to look at the driver for the following reasons:

 - the code has been audited for thread safety

 - the annotation of request_any_context_irq() documents that the
   audit has been done.

 - the annotation of request_any_context_irq() makes other people who
   are changing the code aware of the fact that it _is_ used in
   threaded context on some hardware.

 - in some drivers a cleanup can be done based on the threaded code,
   e.g. for drivers which use their own worker threads or rely heavily
   on workqueues.

Thanks,

	tglx

  reply	other threads:[~2010-06-05 18:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 21:19 Esben Haabendal
2010-06-04 21:46 ` Thomas Gleixner
2010-06-05 13:56   ` Esben Haabendal
2010-06-05 14:10     ` Marc Zyngier
2010-06-05 15:33       ` Thomas Gleixner
2010-06-05 17:01         ` Esben Haabendal
2010-06-05 18:52           ` Thomas Gleixner [this message]
2010-06-05 19:48             ` Esben Haabendal
2010-06-05 20:14               ` Thomas Gleixner
2010-06-06 19:50                 ` Esben Haabendal
2010-06-06 22:08                   ` Thomas Gleixner
2010-06-07 12:34                     ` Esben Haabendal
2010-06-07 15:06                       ` Thomas Gleixner
2010-06-07 21:28                         ` Esben Haabendal
2010-06-07 23:18                           ` Thomas Gleixner
2010-06-08 14:15                             ` Esben Haabendal
2010-06-08  6:58                           ` Thomas Gleixner
2010-06-08  7:23                             ` Esben Haabendal
2010-06-05 16:53       ` Esben Haabendal
2010-06-05 17:18         ` Marc Zyngier
2010-06-05 19:38           ` Esben Haabendal

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=alpine.LFD.2.00.1006051915290.2933@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=eha@doredevelopment.dk \
    --cc=esbenhaabendal@gmail.com \
    --cc=joachim.eastwood@jotron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@misterjones.org \
    --cc=mingo@elte.hu \
    /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®