public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.19-pre3 s390 ret_from_fork patch
@ 2002-03-15 18:44 Pete Zaitcev
  0 siblings, 0 replies; 2+ messages in thread
From: Pete Zaitcev @ 2002-03-15 18:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: schwidefsky, Pete Zaitcev

Greetings:

The 2.4.19-pre3 works just dandy as it is without this patch,
but it is needed for O(1) scheduler. I think Martin was going
to forward this into 2.5.x tree, where O(1) is standard.

The problem is that schedule_tail() is supposed to unlock
runqueue, but if interrupts are enabled before that happens,
a timer tick may squeeze in and deadlock. I observed such
situation myself.

So, I would like this to be in 2.4.19 for the sake of O(1) users.
Any objections?

-- Pete

diff -ur -X dontdiff linux-2.4.19-pre3/arch/s390/kernel/entry.S linux-2.4.19-pre3-390/arch/s390/kernel/entry.S
--- linux-2.4.19-pre3/arch/s390/kernel/entry.S	Tue Mar 12 10:53:36 2002
+++ linux-2.4.19-pre3-390/arch/s390/kernel/entry.S	Fri Mar 15 09:18:52 2002
@@ -254,13 +254,14 @@
 ret_from_fork:  
         basr    %r13,0
         l       %r13,.Lentry_base-.(%r13)  # setup base pointer to &entry_base
+	# not saving R14 here because we go to sysc_return ultimately
+	l	%r1,BASED(.Lschedtail)
+	basr	%r14,%r1          # call schedule_tail (unlock stuff)
         GET_CURRENT               # load pointer to task_struct to R9
         stosm   24(%r15),0x03     # reenable interrupts
         sr      %r0,%r0           # child returns 0
         st      %r0,SP_R2(%r15)   # store return value (change R2 on stack)
-        l       %r1,BASED(.Lschedtail)
-	la      %r14,BASED(sysc_return)
-        br      %r1               # call schedule_tail, return to sysc_return
+	b	BASED(sysc_return)
 
 #
 # clone, fork, vfork, exec and sigreturn need glue,
diff -ur -X dontdiff linux-2.4.19-pre3/arch/s390x/kernel/entry.S linux-2.4.19-pre3-390/arch/s390x/kernel/entry.S
--- linux-2.4.19-pre3/arch/s390x/kernel/entry.S	Tue Mar 12 10:53:36 2002
+++ linux-2.4.19-pre3-390/arch/s390x/kernel/entry.S	Fri Mar 15 09:20:33 2002
@@ -240,11 +240,11 @@
 #
         .globl  ret_from_fork
 ret_from_fork:  
+	brasl	%r14,schedule_tail
         GET_CURRENT               # load pointer to task_struct to R9
         stosm   48(%r15),0x03     # reenable interrupts
 	xc      SP_R2(8,%r15),SP_R2(%r15) # child returns 0
-	larl    %r14,sysc_return
-        jg      schedule_tail     # return to sysc_return
+	j	sysc_return
 
 #
 # clone, fork, vfork, exec and sigreturn need glue,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.4.19-pre3 s390 ret_from_fork patch
@ 2002-03-18 14:04 Martin Schwidefsky
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Schwidefsky @ 2002-03-18 14:04 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: linux-kernel


>The 2.4.19-pre3 works just dandy as it is without this patch,
>but it is needed for O(1) scheduler. I think Martin was going
>to forward this into 2.5.x tree, where O(1) is standard.
>
>The problem is that schedule_tail() is supposed to unlock
>runqueue, but if interrupts are enabled before that happens,
>a timer tick may squeeze in and deadlock. I observed such
>situation myself.
>
>So, I would like this to be in 2.4.19 for the sake of O(1) users.
>Any objections?

No, not really. My fix for 2.5.6 simply removes the stosm because
the sysc_return will disable the interrupts soon after anyway.

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-18 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-15 18:44 2.4.19-pre3 s390 ret_from_fork patch Pete Zaitcev
  -- strict thread matches above, loose matches on Subject: below --
2002-03-18 14:04 Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox