aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-07-23 17:18:05 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-07-31 11:49:48 -0400
commit7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1 (patch)
tree93b965e43300b1f0a0538c924a3a9b43a371a299
parent8e42e211e4fef2b2026c7f99092542f00dd817f3 (diff)
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>
-rw-r--r--arch/tile/kernel/hardwall.c10
-rw-r--r--arch/tile/kernel/process.c23
2 files changed, 18 insertions, 15 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,
540 } 540 }
541 } 541 }
542 542
543 /*
544 * Eliminate cpus that are not part of this Linux client.
545 * Note that this allows for configurations that we might not want to
546 * support, such as one client on every even cpu, another client on
547 * every odd cpu.
548 */
549 cpumask_and(&info->cpumask, &info->cpumask, cpu_online_mask);
550
543 /* Confirm it doesn't overlap and add it to the list. */ 551 /* Confirm it doesn't overlap and add it to the list. */
544 spin_lock_irqsave(&hwt->lock, flags); 552 spin_lock_irqsave(&hwt->lock, flags);
545 list_for_each_entry(iter, &hwt->list, list) { 553 list_for_each_entry(iter, &hwt->list, list) {
@@ -612,7 +620,7 @@ static int hardwall_activate(struct hardwall_info *info)
612 620
613/* 621/*
614 * Deactivate a task's hardwall. Must hold lock for hardwall_type. 622 * Deactivate a task's hardwall. Must hold lock for hardwall_type.
615 * This method may be called from free_task(), so we don't want to 623 * This method may be called from exit_thread(), so we don't want to
616 * rely on too many fields of struct task_struct still being valid. 624 * rely on too many fields of struct task_struct still being valid.
617 * We assume the cpus_allowed, pid, and comm fields are still valid. 625 * We assume the cpus_allowed, pid, and comm fields are still valid.
618 */ 626 */
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 8ac304484f98..8d6c51d55762 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -74,19 +74,6 @@ void arch_release_thread_info(struct thread_info *info)
74{ 74{
75 struct single_step_state *step_state = info->step_state; 75 struct single_step_state *step_state = info->step_state;
76 76
77#ifdef CONFIG_HARDWALL
78 /*
79 * We free a thread_info from the context of the task that has
80 * been scheduled next, so the original task is already dead.
81 * Calling deactivate here just frees up the data structures.
82 * If the task we're freeing held the last reference to a
83 * hardwall fd, it would have been released prior to this point
84 * anyway via exit_files(), and the hardwall_task.info pointers
85 * would be NULL by now.
86 */
87 hardwall_deactivate_all(info->task);
88#endif
89
90 if (step_state) { 77 if (step_state) {
91 78
92 /* 79 /*
@@ -564,7 +551,15 @@ void flush_thread(void)
564 */ 551 */
565void exit_thread(void) 552void exit_thread(void)
566{ 553{
567 /* Nothing */ 554#ifdef CONFIG_HARDWALL
555 /*
556 * Remove the task from the list of tasks that are associated
557 * with any live hardwalls. (If the task that is exiting held
558 * the last reference to a hardwall fd, it would already have
559 * been released and deactivated at this point.)
560 */
561 hardwall_deactivate_all(current);
562#endif
568} 563}
569 564
570void show_regs(struct pt_regs *regs) 565void show_regs(struct pt_regs *regs)