Patchwork SPARC32: wrong scheduling of freshly created processes (bug in ret_from_fork)

login
register
mail settings
Submitter Kirill Tkhai
Date March 31, 2011, 7:49 a.m.
Message ID <1301557791.5962.19.camel@hp>
Download mbox | patch
Permalink /patch/89024/
State Accepted
Delegated to: David Miller
Headers show

Comments

Kirill Tkhai - March 31, 2011, 7:49 a.m.
SPARC32: Pass task_struct to schedule_tail() in ret_from_fork

Hello, Dave.

We have to pass task_struct of previous process to function
schedule_tail(). Currently in ret_from_fork previous thread_info
is passed:

switch_to: mov %g6, %g3 /* previous thread_info in g6 */

ret_from_fork: call    schedule_tail
                mov    %g3, %o0 /* previous thread_info is passed */

void schedule_tail(struct task_struct *prev);

Signed-off-by: Tkhai Kirill <tkhai@yandex.ru>


--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- arch/sparc/kernel/entry.S.orig	2011-03-27 22:37:20.000000000 +0400
+++ arch/sparc/kernel/entry.S	2011-03-29 20:52:00.165292813 +0400
@@ -1283,7 +1283,7 @@  linux_syscall_trace:
 	.globl	ret_from_fork
 ret_from_fork:
 	call	schedule_tail
-	 mov	%g3, %o0
+	 ld	[%g3 + TI_TASK], %o0
 	b	ret_sys_call
 	 ld	[%sp + STACKFRAME_SZ + PT_I0], %o0