From: Chris Metcalf Date: Tue, 23 Jul 2013 21:18:05 +0000 (-0400) Subject: tile: clean up active hardwalls in exit_thread X-Git-Tag: next-20130731~89^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=74fc82211c80793eaebb6ed6b1fc4c05401ca72e;p=karo-tx-linux.git tile: clean up active hardwalls in exit_thread Tearing down the hardwall state in exit_thread() is a better place than in arch_release_thread_info(). Signed-off-by: Chris Metcalf --- diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c index 38ac189d9575..23562cbe3e8e 100644 --- a/arch/tile/kernel/hardwall.c +++ b/arch/tile/kernel/hardwall.c @@ -612,7 +612,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. */ 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) { struct single_step_state *step_state = info->step_state; -#ifdef CONFIG_HARDWALL - /* - * We free a thread_info from the context of the task that has - * been scheduled next, so the original task is already dead. - * Calling deactivate here just frees up the data structures. - * If the task we're freeing held the last reference to a - * hardwall fd, it would have been released prior to this point - * anyway via exit_files(), and the hardwall_task.info pointers - * would be NULL by now. - */ - hardwall_deactivate_all(info->task); -#endif - if (step_state) { /* @@ -564,7 +551,15 @@ void flush_thread(void) */ void exit_thread(void) { - /* Nothing */ +#ifdef CONFIG_HARDWALL + /* + * Remove the task from the list of tasks that are associated + * with any live hardwalls. (If the task that is exiting held + * the last reference to a hardwall fd, it would already have + * been released and deactivated at this point.) + */ + hardwall_deactivate_all(current); +#endif } void show_regs(struct pt_regs *regs)