[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1470924405-25728-1-git-send-email-hch@lst.de>
Date: Thu, 11 Aug 2016 07:06:45 -0700
From: Christoph Hellwig <hch@....de>
To: tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH for-4.8] irq/affinity: use get/put_online_cpus
Without locking out CPU mask operations we might end up with an inconsistent
view of the cpumask in the function.
Signed-off-by: Christoph Hellwig <hch@....de>
---
kernel/irq/affinity.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index f689593..32f6cfc 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -39,6 +39,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs)
return NULL;
}
+ get_online_cpus();
if (max_vecs >= num_online_cpus()) {
cpumask_copy(affinity_mask, cpu_online_mask);
*nr_vecs = num_online_cpus();
@@ -56,6 +57,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs)
}
*nr_vecs = vecs;
}
+ put_online_cpus();
return affinity_mask;
}
--
2.1.4
Powered by blists - more mailing lists