All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: schwidefsky@de.ibm.com, Pete Zaitcev <zaitcev@redhat.com>
Subject: 2.4.19-pre3 s390 ret_from_fork patch
Date: Fri, 15 Mar 2002 13:44:20 -0500	[thread overview]
Message-ID: <20020315134420.F24597@devserv.devel.redhat.com> (raw)

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,

             reply	other threads:[~2002-03-15 18:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 18:44 Pete Zaitcev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-18 14:04 2.4.19-pre3 s390 ret_from_fork patch Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020315134420.F24597@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.