public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Sankara Muthukrishnan <sankara.m@gmail.com>
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH RFC] irq: Honor /proc/irq core affinity when an IRQ thread is created
Date: Sat, 3 Nov 2012 11:50:28 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.02.1211031132460.2756@ionos> (raw)
In-Reply-To: <CAFQPvXdrxEpD-LSnsZGE-s7JVHWJz5qOP=ZPiwB+UC5nXAm5Dw@mail.gmail.com>

On Wed, 5 Sep 2012, Sankara Muthukrishnan wrote:
> On Tue, Sep 4, 2012 at 10:43 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > Does the following patch fix the problem for both shared and non
> > shared interrupts ?
> 
> Thanks Thomas. Your suggestion works for non-shared. I do not have
> devices sharing interrupts on my board to quickly verify. However, I
> hacked a kernel module to simulate shared irq's and the kernel source
> (to set the affinity before waiting for interrupts in the irq thread)
> and verified that it works for "shared interrupts" also.
> 
> However, I was wondering whether we are relaxing some checks that
> setup_affinity does (like checking for flags such as
> IRQD_NO_BALANCING) by setting the flag IRQTF_AFFINITY after creating
> the kernel thread directly as you suggested. May be, it does not have
> practical implications. But, I was wondering whether it is a good idea
> to go through all the checks as the checks are done when someone
> writes to /proc/irq/.../smp_affinity file for consistency. Is the
> following patch a bad idea (basically call setup_affinity for both
> shared and non-shared interrupts)? This also works in my testing. I am
> curious why "setup_affinity" was called only under "if (!shared)" case
> in the released kernel.

The reason is that it is sufficient to do that for the first interrupt
which gets set up. If another interrupt handler gets registered in the
shared case then its pointless to call setup_affinity() as everything
is already in place. The only thing which does not follow is the
shared thread.

So now for the IRQTF_AFFINITY flag. We really want to set that
unconditionally so all irq threads even if the NO_BALANCING flag is
set move to the cpu(s) on which the interrupt is assigned
to. NO_BALANCING is just making sure that the user space irq balancer
cannot move around the interrupt, but it still has an affinity
assigned.

Thanks,

	tglx



      reply	other threads:[~2012-11-03 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 22:27 [PATCH RFC] irq: Honor /proc/irq core affinity when an IRQ thread is created Sankara Muthukrishnan
2012-09-04 15:43 ` Thomas Gleixner
2012-09-05 20:28   ` Sankara Muthukrishnan
2012-11-03 10:50     ` Thomas Gleixner [this message]

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.02.1211031132460.2756@ionos \
    --to=tglx@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=sankara.m@gmail.com \
    /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