From patchwork Thu Mar 24 12:58:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 602255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qXpBV4vq8z9s6n for ; Sun, 27 Mar 2016 18:12:02 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ak4pb-0000M1-Tp; Sun, 27 Mar 2016 07:09:51 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aj4qf-0002qw-Ii; Thu, 24 Mar 2016 12:59:29 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B6B34ADBA; Thu, 24 Mar 2016 12:58:18 +0000 (UTC) From: Jiri Slaby To: akpm@linux-foundation.org Subject: [PATCH 3/4] exit_thread: accept a task parameter to be exited Date: Thu, 24 Mar 2016 13:58:13 +0100 Message-Id: <1458824294-29733-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160324_055850_747418_55EE8B55 X-CRM114-Status: GOOD ( 16.03 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.135.220.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Sun, 27 Mar 2016 00:09:50 -0700 X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, linux-s390@vger.kernel.org, Rich Felker , Benjamin Herrenschmidt , Aurelien Jacquiot , Peter Zijlstra , Catalin Marinas , Will Deacon , David Howells , Max Filippov , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, Guan Xuetao , Jiri Slaby , Lennox Wu , Hans-Christian Egtvedt , Jonas Bonn , Chen Liqin , Jesper Nilsson , linux-am33-list@redhat.com, Russell King , linux-c6x-dev@linux-c6x.org, Yoshinori Sato , linux-sh@vger.kernel.org, Michael Ellerman , Helge Deller , x86@kernel.org, "James E.J. Bottomley" , Ingo Molnar , Geert Uytterhoeven , Mark Salter , Matt Turner , linux-snps-arc@lists.infradead.org, Haavard Skinnemoen , uclinux-h8-devel@lists.sourceforge.jp, Fenghua Yu , James Hogan , Chris Metcalf , user-mode-linux-devel@lists.sourceforge.net, Steven Miao , Heiko Carstens , Jeff Dike , linux-alpha@vger.kernel.org, adi-buildroot-devel@lists.sourceforge.net, Mikael Starvik , linux-m68k@lists.linux-m68k.org, Ivan Kokshaysky , user-mode-linux-user@lists.sourceforge.net, nios2-dev@lists.rocketboards.org, Thomas Gleixner , linux-xtensa@linux-xtensa.org, linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , Chris Zankel , Michal Simek , Tony Luck , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linux-cris-kernel@axis.com, Vineet Gupta , linux-kernel@vger.kernel.org, Ralf Baechle , Richard Kuo , Richard Weinberger , Martin Schwidefsky , Ley Foon Tan , Koichi Yasutake , linuxppc-dev@lists.ozlabs.org, "David S. Miller" MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We need to call exit_thread from copy_process in a fail path. So make it accept task_struct as a parameter. Signed-off-by: Jiri Slaby Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Haavard Skinnemoen Cc: Hans-Christian Egtvedt Cc: Steven Miao Cc: Mark Salter Cc: Aurelien Jacquiot Cc: Mikael Starvik Cc: Jesper Nilsson Cc: Yoshinori Sato Cc: Richard Kuo Cc: Tony Luck Cc: Fenghua Yu Cc: Geert Uytterhoeven Cc: James Hogan Cc: Michal Simek Cc: Ralf Baechle Cc: David Howells Cc: Koichi Yasutake Cc: Ley Foon Tan Cc: Jonas Bonn Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Chen Liqin Cc: Lennox Wu Cc: Rich Felker Cc: "David S. Miller" Cc: Chris Metcalf Cc: Jeff Dike Cc: Richard Weinberger Cc: Guan Xuetao Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Chris Zankel Cc: Max Filippov Cc: Peter Zijlstra Cc: linux-alpha@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: adi-buildroot-devel@lists.sourceforge.net Cc: linux-c6x-dev@linux-c6x.org Cc: linux-cris-kernel@axis.com Cc: uclinux-h8-devel@lists.sourceforge.jp Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-metag@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-am33-list@redhat.com Cc: nios2-dev@lists.rocketboards.org Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: user-mode-linux-devel@lists.sourceforge.net Cc: user-mode-linux-user@lists.sourceforge.net Cc: linux-xtensa@linux-xtensa.org --- arch/alpha/kernel/process.c | 2 +- arch/arc/kernel/process.c | 2 +- arch/arm/kernel/process.c | 4 ++-- arch/arm64/kernel/process.c | 2 +- arch/avr32/kernel/process.c | 4 ++-- arch/blackfin/include/asm/processor.h | 2 +- arch/c6x/kernel/process.c | 2 +- arch/cris/arch-v10/kernel/process.c | 2 +- arch/cris/arch-v32/kernel/process.c | 4 ++-- arch/frv/include/asm/processor.h | 2 +- arch/h8300/include/asm/processor.h | 2 +- arch/hexagon/kernel/process.c | 2 +- arch/ia64/kernel/perfmon.c | 4 ++-- arch/ia64/kernel/process.c | 14 +++++++------- arch/m32r/kernel/process.c | 4 ++-- arch/m68k/include/asm/processor.h | 2 +- arch/metag/include/asm/processor.h | 2 +- arch/metag/kernel/process.c | 6 +++--- arch/microblaze/include/asm/processor.h | 4 ++-- arch/mips/kernel/process.c | 2 +- arch/mn10300/kernel/process.c | 4 ++-- arch/nios2/include/asm/processor.h | 2 +- arch/openrisc/include/asm/processor.h | 2 +- arch/parisc/kernel/process.c | 2 +- arch/powerpc/kernel/process.c | 2 +- arch/s390/kernel/process.c | 4 ++-- arch/score/kernel/process.c | 2 +- arch/sh/kernel/process_32.c | 2 +- arch/sh/kernel/process_64.c | 4 ++-- arch/sparc/kernel/process_32.c | 12 ++++++------ arch/sparc/kernel/process_64.c | 4 ++-- arch/tile/kernel/process.c | 4 ++-- arch/um/kernel/process.c | 2 +- arch/unicore32/kernel/process.c | 2 +- arch/x86/kernel/process.c | 3 +-- arch/xtensa/kernel/process.c | 4 ++-- include/linux/sched.h | 2 +- kernel/exit.c | 2 +- 38 files changed, 63 insertions(+), 64 deletions(-) diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 84d13263ce46..1e044d1f7525 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c @@ -214,7 +214,7 @@ EXPORT_SYMBOL(start_thread); * Free current thread data structures etc.. */ void -exit_thread(void) +exit_thread(struct task_struct *me) { } diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c index a3f750e76b68..70944dfab6c6 100644 --- a/arch/arc/kernel/process.c +++ b/arch/arc/kernel/process.c @@ -186,7 +186,7 @@ void flush_thread(void) /* * Free any architecture-specific thread data structures, etc. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 4adfb46e3ee9..e8ecd02bf7ea 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -193,9 +193,9 @@ EXPORT_SYMBOL_GPL(thread_notify_head); /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - thread_notify(THREAD_NOTIFY_EXIT, current_thread_info()); + thread_notify(THREAD_NOTIFY_EXIT, task_thread_info(me)); } void flush_thread(void) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 80624829db61..84b288c85e4a 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -203,7 +203,7 @@ void show_regs(struct pt_regs * regs) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 42a53e740a7e..ea21d0e99b6b 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c @@ -62,9 +62,9 @@ void machine_restart(char *cmd) /* * Free current thread data structures etc */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - ocd_disable(current); + ocd_disable(me); } void flush_thread(void) diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h index 7acd46653df3..7aa6cd0ac8d9 100644 --- a/arch/blackfin/include/asm/processor.h +++ b/arch/blackfin/include/asm/processor.h @@ -78,7 +78,7 @@ static inline void release_thread(struct task_struct *dead_task) /* * Free current thread data structures etc.. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/c6x/kernel/process.c b/arch/c6x/kernel/process.c index 3ae9f5a166a0..4b2dfb1d330d 100644 --- a/arch/c6x/kernel/process.c +++ b/arch/c6x/kernel/process.c @@ -82,7 +82,7 @@ void flush_thread(void) { } -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 02b783457be0..2aaaccc3883c 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c @@ -39,7 +39,7 @@ void default_idle(void) * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { /* Nothing needs to be done. */ } diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index c7ce784a393c..5f55d15366ea 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c @@ -33,9 +33,9 @@ void default_idle(void) */ extern void deconfigure_bp(long pid); -void exit_thread(void) +void exit_thread(struct task_struct *me) { - deconfigure_bp(current->pid); + deconfigure_bp(me->pid); } /* diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h index ae8d423e79d9..cff4440abcee 100644 --- a/arch/frv/include/asm/processor.h +++ b/arch/frv/include/asm/processor.h @@ -99,7 +99,7 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ... /* * Free current thread data structures etc.. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/h8300/include/asm/processor.h b/arch/h8300/include/asm/processor.h index 54e3fd83c336..d79f99c645ad 100644 --- a/arch/h8300/include/asm/processor.h +++ b/arch/h8300/include/asm/processor.h @@ -113,7 +113,7 @@ static inline void release_thread(struct task_struct *dead_task) /* * Free current thread data structures etc.. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c index a9ebd471823a..228b77433fe8 100644 --- a/arch/hexagon/kernel/process.c +++ b/arch/hexagon/kernel/process.c @@ -139,7 +139,7 @@ void release_thread(struct task_struct *dead_task) /* * Free any architecture-specific thread data structures, etc. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 9cd607b06964..2436ad5f92c1 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -4542,8 +4542,8 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg /* - * called only from exit_thread(): task == current - * we come here only if current has a context attached (loaded or masked) + * called only from exit_thread() + * we come here only if the task has a context attached (loaded or masked) */ void pfm_exit_thread(struct task_struct *task) diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index b51514957620..445f09fb2820 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -570,22 +570,22 @@ flush_thread (void) } /* - * Clean up state associated with current thread. This is called when + * Clean up state associated with a thread. This is called when * the thread calls exit(). */ void -exit_thread (void) +exit_thread (struct task_struct *me) { - ia64_drop_fpu(current); + ia64_drop_fpu(me); #ifdef CONFIG_PERFMON /* if needed, stop monitoring and flush state to perfmon context */ - if (current->thread.pfm_context) - pfm_exit_thread(current); + if (me->thread.pfm_context) + pfm_exit_thread(me); /* free debug register resources */ - if (current->thread.flags & IA64_THREAD_DBG_VALID) - pfm_release_debug_registers(current); + if (me->thread.flags & IA64_THREAD_DBG_VALID) + pfm_release_debug_registers(me); #endif } diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index e69221d581d5..00a41866b05e 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c @@ -104,10 +104,10 @@ void show_regs(struct pt_regs * regs) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { /* Nothing to do. */ - DPRINTK("pid = %d\n", current->pid); + DPRINTK("pid = %d\n", me->pid); } void flush_thread(void) diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index 20dda1d4b860..57ef5d420307 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h @@ -156,7 +156,7 @@ static inline void release_thread(struct task_struct *dead_task) /* * Free current thread data structures etc.. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h index 0838ca699764..daf7943168f0 100644 --- a/arch/metag/include/asm/processor.h +++ b/arch/metag/include/asm/processor.h @@ -134,7 +134,7 @@ static inline void release_thread(struct task_struct *dead_task) #define copy_segments(tsk, mm) do { } while (0) #define release_segments(mm) do { } while (0) -extern void exit_thread(void); +extern void exit_thread(struct task_struct *me); /* * Return saved PC of a blocked thread. diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c index 7f546183a0f0..f5c507c3d804 100644 --- a/arch/metag/kernel/process.c +++ b/arch/metag/kernel/process.c @@ -345,10 +345,10 @@ void flush_thread(void) /* * Free current thread data structures etc. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - clear_fpu(¤t->thread); - clear_dsp(¤t->thread); + clear_fpu(&me->thread); + clear_dsp(&me->thread); } /* TODO: figure out how to unwind the kernel stack here to figure out diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 497a988d79c2..41300e76aac0 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -71,7 +71,7 @@ static inline void release_thread(struct task_struct *dead_task) } /* Free all resources held by a thread. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } @@ -128,7 +128,7 @@ static inline void release_thread(struct task_struct *dead_task) } /* Free current thread data structures etc. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 92880cee449e..26f90e9ea288 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -73,7 +73,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) regs->regs[29] = sp; } -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 74a96ccf7451..99d73b5c2d33 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c @@ -103,9 +103,9 @@ void show_regs(struct pt_regs *regs) /* * free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - exit_fpu(current); + exit_fpu(me); } void flush_thread(void) diff --git a/arch/nios2/include/asm/processor.h b/arch/nios2/include/asm/processor.h index c2ba45c159c7..a8443c158d65 100644 --- a/arch/nios2/include/asm/processor.h +++ b/arch/nios2/include/asm/processor.h @@ -76,7 +76,7 @@ static inline void release_thread(struct task_struct *dead_task) } /* Free current thread data structures etc.. */ -static inline void exit_thread(void) +static inline void exit_thread(struct task_struct *me) { } diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h index 4d235e3d2534..26a8f3760a71 100644 --- a/arch/openrisc/include/asm/processor.h +++ b/arch/openrisc/include/asm/processor.h @@ -88,7 +88,7 @@ unsigned long get_wchan(struct task_struct *p); * Free current thread data structures etc.. */ -extern inline void exit_thread(void) +extern inline void exit_thread(struct task_struct *me) { /* Nothing needs to be done. */ } diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 809905a811ed..5750fe642202 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -147,7 +147,7 @@ EXPORT_SYMBOL(pm_power_off); /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 612df305886b..bb6da7f3c27b 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1326,7 +1326,7 @@ void show_regs(struct pt_regs * regs) show_instructions(regs); } -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 7fabc985a7dd..b86625490090 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -70,9 +70,9 @@ extern void kernel_thread_starter(void); /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - exit_thread_runtime_instr(current); + exit_thread_runtime_instr(me); } void flush_thread(void) diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c index a1519ad3d49d..de22a45558d6 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c @@ -56,7 +56,7 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) regs->regs[0] = sp; } -void exit_thread(void) {} +void exit_thread(struct task_struct *me) {} /* * When a process does an "exec", machine state like FPU and debug diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 2885fc9d9dcd..4e360f2be5fd 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c @@ -79,7 +79,7 @@ EXPORT_SYMBOL(start_thread); /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index e2062e643341..8bb717f5bfc9 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c @@ -288,7 +288,7 @@ void show_regs(struct pt_regs *regs) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { /* * See arch/sparc/kernel/process.c for the precedent for doing @@ -307,7 +307,7 @@ void exit_thread(void) * which it would get safely nulled. */ #ifdef CONFIG_SH_FPU - if (last_task_used_math == current) { + if (last_task_used_math == me) { last_task_used_math = NULL; } #endif diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index c5113c7ce2fd..00ade5a2f5e8 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c @@ -184,21 +184,21 @@ unsigned long thread_saved_pc(struct task_struct *tsk) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { #ifndef CONFIG_SMP - if(last_task_used_math == current) { + if (last_task_used_math == me) { #else - if (test_thread_flag(TIF_USEDFPU)) { + if (test_ti_thread_flag(task_thread_info(me), TIF_USEDFPU)) { #endif /* Keep process from leaving FPU in a bogon state. */ put_psr(get_psr() | PSR_EF); - fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, - ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); + fpsave(&me->thread.float_regs[0], &me->thread.fsr, + &me->thread.fpqueue[0], &me->thread.fpqdepth); #ifndef CONFIG_SMP last_task_used_math = NULL; #else - clear_thread_flag(TIF_USEDFPU); + clear_ti_thread_flag(task_thread_info(me), TIF_USEDFPU); #endif } } diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index 46a59643bb1c..5cb4077f5cb8 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c @@ -417,9 +417,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk) } /* Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - struct thread_info *t = current_thread_info(); + struct thread_info *t = task_thread_info(me); if (t->utraps) { if (t->utraps[0] < 2) diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index b5f30d376ce1..94080d327efc 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c @@ -541,7 +541,7 @@ void flush_thread(void) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { #ifdef CONFIG_HARDWALL /* @@ -550,7 +550,7 @@ void exit_thread(void) * the last reference to a hardwall fd, it would already have * been released and deactivated at this point.) */ - hardwall_deactivate_all(current); + hardwall_deactivate_all(me); #endif } diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 48af59aae129..06eb532965d1 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -103,7 +103,7 @@ void interrupt_end(void) tracehook_notify_resume(regs); } -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index b008e9961465..7c23697bc2ed 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c @@ -204,7 +204,7 @@ void show_regs(struct pt_regs *regs) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { } diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 2915d54e9dd5..55c97e4ef71b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -97,9 +97,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) /* * Free current thread data structures etc.. */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { - struct task_struct *me = current; struct thread_struct *t = &me->thread; unsigned long *bp = t->io_bitmap_ptr; struct fpu *fpu = &t->fpu; diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 5bbfed81c97b..6f3b54eb346c 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c @@ -115,10 +115,10 @@ void arch_cpu_idle(void) /* * This is called when the thread calls exit(). */ -void exit_thread(void) +void exit_thread(struct task_struct *me) { #if XTENSA_HAVE_COPROCESSORS - coprocessor_release_all(current_thread_info()); + coprocessor_release_all(task_thread_info(me)); #endif } diff --git a/include/linux/sched.h b/include/linux/sched.h index af5cc4768026..db4daa3aa894 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2648,7 +2648,7 @@ static inline int copy_thread_tls( } #endif extern void flush_thread(void); -extern void exit_thread(void); +extern void exit_thread(struct task_struct *); extern void exit_files(struct task_struct *); extern void __cleanup_sighand(struct sighand_struct *); diff --git a/kernel/exit.c b/kernel/exit.c index fd90195667e1..75b34fe835b2 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -746,7 +746,7 @@ void do_exit(long code) disassociate_ctty(1); exit_task_namespaces(tsk); exit_task_work(tsk); - exit_thread(); + exit_thread(tsk); /* * Flush inherited counters to the parent - before the parent