summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/hardwall.c
diff options
context:
space:
mode:
authorChris Metcalf2013-07-23 23:18:05 +0200
committerChris Metcalf2013-07-31 17:49:48 +0200
commit7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1 (patch)
tree93b965e43300b1f0a0538c924a3a9b43a371a299 /arch/tile/kernel/hardwall.c
parentedac: Remove redundant platform_set_drvdata() (diff)
downloadkernel-qcow2-linux-7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1.tar.gz
kernel-qcow2-linux-7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1.tar.xz
kernel-qcow2-linux-7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1.zip
tile: various minor cleanups to hardwall subsystem
First, clean up active hardwalls in exit_thread(). This is a better place than in arch_release_thread_info(). Second, mask out any non-online cpus from the cpumask after validating any required semantics of the cpu set. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/hardwall.c')
-rw-r--r--arch/tile/kernel/hardwall.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c
index 38ac189d9575..7db8893d4fc5 100644
--- a/arch/tile/kernel/hardwall.c
+++ b/arch/tile/kernel/hardwall.c
@@ -540,6 +540,14 @@ static struct hardwall_info *hardwall_create(struct hardwall_type *hwt,
}
}
+ /*
+ * Eliminate cpus that are not part of this Linux client.
+ * Note that this allows for configurations that we might not want to
+ * support, such as one client on every even cpu, another client on
+ * every odd cpu.
+ */
+ cpumask_and(&info->cpumask, &info->cpumask, cpu_online_mask);
+
/* Confirm it doesn't overlap and add it to the list. */
spin_lock_irqsave(&hwt->lock, flags);
list_for_each_entry(iter, &hwt->list, list) {
@@ -612,7 +620,7 @@ static int hardwall_activate(struct hardwall_info *info)
/*
* Deactivate a task's hardwall. Must hold lock for hardwall_type.
- * This method may be called from free_task(), so we don't want to
+ * This method may be called from exit_thread(), so we don't want to
* rely on too many fields of struct task_struct still being valid.
* We assume the cpus_allowed, pid, and comm fields are still valid.
*/