All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Shepherd <mcs@astro.caltech.edu>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: Setting the priority of an IRQ thread
Date: Tue, 16 Jun 2009 23:09:47 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0906162232100.21049@goblin.caltech.edu> (raw)
In-Reply-To: <alpine.LFD.2.00.0906170706220.2800@localhost.localdomain>


On Wed, 17 Jun 2009, Thomas Gleixner wrote:
>> It seems much more friendly and efficient for my driver to provide
>> applications with an ioctl that tells it to set the priority of its
>> IRQ thread.
>
> Wrong. That information is already available in sysfs and there is no
> reason to use an ioctl for that.

Could you point out where please? Searching sysfs I see the following
two files that contain the IRQ numbers of two of the boards that my
driver handles:

  /bus/pci/drivers/accpcidio/0000:03:02.0/irq
  /bus/pci/drivers/accpcidio/0000:03:03.0/irq

However, I don't see how a user application could figure out which of
these corresponded to the board that it opened using a particular
device file. Only the device driver knows which device file is
associated with a given PCI device ID, and that isn't recorded in
sysfs.

>> Note that none of this would be necessary if the IRQ thread of a
>> device automatically inherited the priority of the highest priority
>> realtime thread that has requested (and not yet free'd) its IRQ. Not
>> doing so, leads to a form of priority inversion.
>
> Eek. That's even more wrong. Why should the priority of a user task
> influence the priority of a device driver irq thread ? That's a
> question of policy and policies are set from user space. The kernel
> merily provides the interfaces.

Agreed. I didn't think this through properly.

> Also why do you claim that the user task requests/frees the drivers
> irq ? That depends on the driver, i.e. if it is implemented to request
> the irq on open(), and can not be generalized.

I was just saying that it is common for device drivers not to request
IRQs until a user application calls their open methods, and that in
such cases only the application and the driver know when is the right
time to search for the newly created IRQ thread. An external script
whose job it was to start the realtime program, and set the priorities
of associated IRQs, would have a hard time doing this reliably.

Martin

  reply	other threads:[~2009-06-17  6:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 22:44 Setting the priority of an IRQ thread Martin Shepherd
2009-06-16  3:54 ` Suresh Kumar SHUKLA
2009-06-16  7:59   ` Martin Shepherd
2009-06-16 18:27     ` Uwe Kleine-König
2009-06-16 21:25       ` Martin Shepherd
2009-06-16 21:54       ` Martin Shepherd
2009-06-17  5:21         ` Thomas Gleixner
2009-06-17  6:09           ` Martin Shepherd [this message]
2009-06-17  9:00             ` Thomas Gleixner
2009-06-18  1:08               ` Martin Shepherd
2009-06-16 22:28       ` Thomas Gleixner
2009-06-17  1:12         ` GeunSik Lim
2009-06-17  2:27           ` Martin Shepherd
2009-06-17  5:28             ` Thomas Gleixner
2009-06-17  3:27         ` Martin Shepherd
2009-06-17  5:38           ` Thomas Gleixner
2009-06-17  9:17         ` Thomas Gleixner
2009-06-17 11:21           ` Remy Bohmer
2009-06-17 13:32             ` GeunSik Lim
2009-06-17 15:45               ` Thomas Gleixner
2009-06-17 13:54             ` Leon Woestenberg
2009-06-17 15:35             ` Thomas Gleixner
2009-06-17 20:14               ` Remy Bohmer
2009-06-17 23:32                 ` Thomas Gleixner
2009-06-18 11:05                 ` Suresh Kumar SHUKLA
2009-06-17  8:27     ` Thomas Pfaff
     [not found] <4A37E0CE020000D90003727B@sinclair.provo.novell.com>
2009-06-16 22:13 ` Peter Morreale

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=Pine.LNX.4.64.0906162232100.21049@goblin.caltech.edu \
    --to=mcs@astro.caltech.edu \
    --cc=linux-rt-users@vger.kernel.org \
    --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 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.