mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next] irq: Clear CPU mask in affinity_hint when none is provided
@ 2010-05-05 20:56 Peter P Waskiewicz Jr
  2010-05-12  9:27 ` [tip:irq/core] genirq: " tip-bot for Peter P Waskiewicz Jr
  0 siblings, 1 reply; 2+ messages in thread
From: Peter P Waskiewicz Jr @ 2010-05-05 20:56 UTC (permalink / raw)
  To: tglx, davem, arjan, bhutchings; +Cc: netdev, linux-kernel

When an interrupt is disabled and torn down, the CPU mask
returned through affinity_hint right now is all CPUs.  Also, for
drivers that don't provide an affinity_hint mask, this can be
misleading.  There should be no hint at all, meaning an empty
CPU mask.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---

 kernel/irq/proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index e1e7408..9ffa24d 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -45,7 +45,7 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
 	if (desc->affinity_hint)
 		cpumask_copy(mask, desc->affinity_hint);
 	else
-		cpumask_setall(mask);
+		cpumask_clear(mask);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	seq_cpumask(m, mask);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:irq/core] genirq: Clear CPU mask in affinity_hint when none is provided
  2010-05-05 20:56 [PATCH linux-next] irq: Clear CPU mask in affinity_hint when none is provided Peter P Waskiewicz Jr
@ 2010-05-12  9:27 ` tip-bot for Peter P Waskiewicz Jr
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Peter P Waskiewicz Jr @ 2010-05-12  9:27 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peter.p.waskiewicz.jr, tglx

Commit-ID:  4308ad801193f14ff42cb746da37cf07e35f0d08
Gitweb:     http://git.kernel.org/tip/4308ad801193f14ff42cb746da37cf07e35f0d08
Author:     Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
AuthorDate: Wed, 5 May 2010 13:56:42 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 12 May 2010 11:23:34 +0200

genirq: Clear CPU mask in affinity_hint when none is provided

When an interrupt is disabled and torn down, the CPU mask returned
through affinity_hint right now is all CPUs. Also, for drivers that
don't provide an affinity_hint mask, this can be misleading. There
should be no hint at all, meaning an empty CPU mask.

[ tglx: use zalloc_cpumask_var instead of clearing it under the lock ]

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: davem@davemloft.net
Cc: arjan@linux.jf.intel.com
Cc: bhutchings@solarflare.com
LKML-Reference: <20100505205638.5426.87189.stgit@ppwaskie-hc2.jf.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/proc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 4f9427a..09a2ee5 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -38,14 +38,12 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
 	unsigned long flags;
 	cpumask_var_t mask;
 
-	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+	if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
 		return -ENOMEM;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	if (desc->affinity_hint)
 		cpumask_copy(mask, desc->affinity_hint);
-	else
-		cpumask_setall(mask);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	seq_cpumask(m, mask);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-12  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05 20:56 [PATCH linux-next] irq: Clear CPU mask in affinity_hint when none is provided Peter P Waskiewicz Jr
2010-05-12  9:27 ` [tip:irq/core] genirq: " tip-bot for Peter P Waskiewicz Jr

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