From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: "Liu, Chuansheng" <chuansheng.liu@intel.com>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"yanmin_zhang@linux.intel.com" <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 13:30:02 +0530 [thread overview]
Message-ID: <5062B602.6000502@linux.vnet.ibm.com> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A189F97@SHSMSX101.ccr.corp.intel.com>
On 09/26/2012 12:22 PM, Liu, Chuansheng wrote:
>>> + } 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.
>>
>
> Yes, I have noticed it, used data->affinity here is just for avoiding compile warning.
> in fact affinity == data->affinity, but affinity pointer is const type,
> And cpumask_clear_cpu needs non-const type,so here I am using data->affinity,
> instead of changing code "const struct cpumask *affinity;"
>
Hmm.. Then what happens to error handling in the case that you can't set
the affinity?
ie., if we take the 'else' branch in:
if (chip->irq_set_affinity)
chip->irq_set_affinity(data, affinity, true);
else if (!(warned++))
set_affinity = 0;
In that case, we would end up with an incorrect data->affinity right?
Btw, on a slightly different note, I'm also rather surprised that the above
code doesn't care about the return value of chip->irq_set_affinity() ..
Shouldn't we warn if that fails?
Regards,
Srivatsa S. Bhat
next prev parent reply other threads:[~2012-09-26 8:00 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
2012-09-26 6:52 ` Liu, Chuansheng
2012-09-26 8:00 ` Srivatsa S. Bhat [this message]
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=5062B602.6000502@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 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.