public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Chuansheng Liu <chuansheng.liu@intel.com>
Cc: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, yanmin_zhang@linux.intel.com,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] x86/fixup_irq: Clean the offlining CPU from the irq affinity mask
Date: Wed, 26 Sep 2012 12:14:18 +0530	[thread overview]
Message-ID: <5062A442.2030207@linux.vnet.ibm.com> (raw)
In-Reply-To: <1348669924.19514.6.camel@cliu38-desktop-build>

On 09/26/2012 08:02 PM, Chuansheng Liu wrote:
> 
> When one CPU is going offline, and fixup_irqs() will re-set the
> irq affinity in some cases, we should clean the offlining CPU from
> the irq affinity.
> 
> The reason is setting offlining CPU as of the affinity is useless.
> Moreover, the smp_affinity value will be confusing when the
> offlining CPU come back again.
> 
> Example:
> For irq 93 with 4 CPUS, the default affinity f(1111),
> normal cases: 4 CPUS will receive the irq93 interrupts.
> 
> When echo 0 > /sys/devices/system/cpu/cpu3/online, just CPU0,1,2 will
> receive the interrupts.
> 
> But after the CPU3 is online again, we will not set affinity,the result
> will be:
> the smp_affinity is f, but still just CPU0,1,2 can receive the interrupts.
> 
> So we should clean the offlining CPU from irq affinity mask
> in fixup_irqs().
> 
> Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
> ---
>  arch/x86/kernel/irq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> index d44f782..671d462 100644
> --- a/arch/x86/kernel/irq.c
> +++ b/arch/x86/kernel/irq.c
> @@ -239,6 +239,7 @@ void fixup_irqs(void)
>  	struct irq_desc *desc;
>  	struct irq_data *data;
>  	struct irq_chip *chip;
> +	int cpu = smp_processor_id();
> 
>  	for_each_irq_desc(irq, desc) {
>  		int break_affinity = 0;
> @@ -271,7 +272,8 @@ void fixup_irqs(void)
>  		if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
>  			break_affinity = 1;
>  			affinity = cpu_online_mask;
> -		}
> +		} else if (cpumask_test_cpu(cpu, data->affinity))
> +			cpumask_clear_cpu(cpu, data->affinity);
> 

You meant to use 'affinity' (instead of data->affinity) in the above 2 statements
right? Note that we do chip->irq_set_affinity(data, affinity, true); further down.

Regards,
Srivatsa S. Bhat

>  		chip = irq_data_get_irq_chip(data);
>  		if (!irqd_can_move_in_process_context(data) && chip->irq_mask)
> 


  reply	other threads:[~2012-09-26  6:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 14:32 [PATCH] x86/fixup_irq: Clean the offlining CPU from the irq affinity mask Chuansheng Liu
2012-09-26  6:44 ` Srivatsa S. Bhat [this message]
2012-09-26  6:52   ` Liu, Chuansheng
2012-09-26  8:00     ` Srivatsa S. Bhat
2012-09-26  8:10       ` Liu, Chuansheng
2012-09-26  8:51         ` Srivatsa S. Bhat
2012-09-26  8:17       ` Liu, Chuansheng
2012-09-26  8:27         ` Srivatsa S. Bhat
2012-09-26  8:41           ` Liu, Chuansheng
2012-09-26  8:23       ` Liu, Chuansheng

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=5062A442.2030207@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=chuansheng.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yanmin_zhang@linux.intel.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