From: tip-bot for Jiang Liu <liuj97@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
chenkeping@huawei.com, jiang.liu@huawei.com, liuj97@gmail.com,
tglx@linutronix.de
Subject: [tip:irq/core] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
Date: Fri, 30 Mar 2012 14:31:34 -0700 [thread overview]
Message-ID: <tip-f5cb92ac82d06cb583c1f66666314c5c0a4d7913@git.kernel.org> (raw)
In-Reply-To: <1333120296-13563-2-git-send-email-jiang.liu@huawei.com>
Commit-ID: f5cb92ac82d06cb583c1f66666314c5c0a4d7913
Gitweb: http://git.kernel.org/tip/f5cb92ac82d06cb583c1f66666314c5c0a4d7913
Author: Jiang Liu <liuj97@gmail.com>
AuthorDate: Fri, 30 Mar 2012 23:11:33 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 30 Mar 2012 23:13:46 +0200
genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
irq_move_masked_irq() checks the return code of
chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is
also a valid return code, which is there to avoid a redundant copy of
the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid
the redundant copy, we also fail to adjust the thread affinity of an
eventually threaded interrupt handler.
Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return
values correctly by checking the valid return values seperately.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Keping Chen <chenkeping@huawei.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/migration.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index 4742090..c3c8975 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data *idata)
* masking the irqs.
*/
if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
- < nr_cpu_ids))
- if (!chip->irq_set_affinity(&desc->irq_data,
- desc->pending_mask, false)) {
+ < nr_cpu_ids)) {
+ int ret = chip->irq_set_affinity(&desc->irq_data,
+ desc->pending_mask, false);
+ switch (ret) {
+ case IRQ_SET_MASK_OK:
cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
+ case IRQ_SET_MASK_OK_NOCOPY:
irq_set_thread_affinity(desc);
}
+ }
cpumask_clear(desc->pending_mask);
}
next prev parent reply other threads:[~2012-03-30 21:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 15:11 [PATCH v3 0/4] normalize return value of chip->irq_set_affinity() Jiang Liu
2012-03-30 15:11 ` [PATCH v3 1/4] IRQ: correctly handle return value from chip->irq_set_affinity() in irq_move_masked_irq() Jiang Liu
2012-03-30 21:31 ` tip-bot for Jiang Liu [this message]
2012-03-30 15:11 ` [PATCH v3 2/4] IRQ: introduce irq_do_set_affinity() to reduce duplicated code Jiang Liu
2012-05-24 20:53 ` [tip:irq/core] genirq: Introduce " tip-bot for Jiang Liu
2012-03-30 15:11 ` [PATCH v3 3/4] IRQ,x86: normalize return value of chip->irq_set_affinity() method Jiang Liu
2012-03-30 21:23 ` Thomas Gleixner
2012-03-31 16:22 ` Jiang Liu
2012-04-01 16:33 ` [PATCH 1/4] IRQ,x86: remove redundant memory copy operations in chip->irq_set_affinity() Jiang Liu
2012-04-01 16:33 ` [PATCH 2/4] IRQ,x86: normalize return value of chip->irq_set_affinity() method Jiang Liu
2012-04-01 16:33 ` [PATCH 3/4] IRQ,IA64: remove redundant memory copy operations in chip->irq_set_affinity() Jiang Liu
2012-04-01 16:33 ` [PATCH 4/4] IRQ,IA64: normalize return value of chip->irq_set_affinity() method Jiang Liu
2012-05-24 21:23 ` [tip:x86/cleanups] x86: Return IRQ_SET_MASK_OK_NOCOPY from irq affinity functions tip-bot for Jiang Liu
2012-03-30 15:11 ` [PATCH v3 4/4] IRQ,IA64: normalize return value of chip->irq_set_affinity() method Jiang Liu
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=tip-f5cb92ac82d06cb583c1f66666314c5c0a4d7913@git.kernel.org \
--to=liuj97@gmail.com \
--cc=chenkeping@huawei.com \
--cc=hpa@zytor.com \
--cc=jiang.liu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@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
Powered by JetHome