mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: <bigeasy@linutronix.de>, chenxiang <chenxiang66@hisilicon.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: About threaded interrupt handler CPU affinity
Date: Mon, 22 Jul 2019 16:17:47 +0100	[thread overview]
Message-ID: <6fd4d706-b66d-6390-749a-8a06b17cb487@huawei.com> (raw)
In-Reply-To: <a98ba3d0-5596-664a-a1ee-5777cff0ddd9@kernel.org>

On 22/07/2019 15:41, Marc Zyngier wrote:
> Hi John,

Hi Marc,

>
> On 22/07/2019 15:14, John Garry wrote:
>> Hi Thomas,
>>
>> I have a question on commit cbf8699996a6 ("genirq: Let irq thread follow
>> the effective hard irq affinity"), if you could kindly check:
>>
>> Here we set the thread affinity to be the same as the hard interrupt
>> affinity. For an arm64 system with GIC ITS, this will be a single CPU,
>> the lowest in the interrupt affinity mask. So, in this case, effectively
>> the thread will be bound to a single CPU. I think APIC is the same for this.
>>
>> The commit message describes the problem that we solve here is that the
>> thread may become affine to a different CPU to the hard interrupt - does
>> it mean that the thread CPU mask could not cover that of the hard
>> interrupt? I couldn't follow the reason.
>
> Assume a 4 CPU system. If the interrupt affinity is on CPU0-1, you could
> end up with the effective interrupt affinity on CPU0 (which would be
> typical of the ITS), and the thread running on CPU1. Not great.

Sure, not great. But the thread can possibly still run on CPU0.

>
> The change you mentions ensures that the thread affinity is strictly
> equal to the *effective affinity* of the interrupt (or at least that's
> the way I read it).
>
>> We have experimented with fixing the thread mask to be the same as the
>> interrupt mask (we're using managed interrupts), like before, and get a
>> significant performance boost at high IO datarates on our storage
>> controller - like ~11%.
>
> My understanding is that this patch does exactly that. Does it result in
> a regression?

Not in the strictest sense for us, I don't know about others. Currently 
we use tasklets, and we find that the CPUs servicing the interrupts (and 
hence tasklets) are heavily loaded. We experience the same for when 
experimenting with threaded interrupt handlers - which would be as expected.

But, when we make the change as mentioned, our IOPS goes from ~3M -> 3.4M.

I would say that a. CPU0 not always having to deal with the interrupt 
handler+threaded part b. less context switching from a. would be factors 
in this.

Thanks,
John


>
> Thanks,
> 	
> 	M.
>



  reply	other threads:[~2019-07-22 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 14:14 John Garry
2019-07-22 14:41 ` Marc Zyngier
2019-07-22 15:17   ` John Garry [this message]
2019-07-22 15:34     ` Thomas Gleixner
2019-07-22 16:08       ` John Garry
2019-07-23 15:29         ` John Garry
2019-08-10  9:47         ` Ming Lei
2019-08-12  8:46           ` John Garry

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=6fd4d706-b66d-6390-749a-8a06b17cb487@huawei.com \
    --to=john.garry@huawei.com \
    --cc=bigeasy@linutronix.de \
    --cc=chenxiang66@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@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 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®