The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] Real-Time Preemption, -RT-2.6.12-rc6-V0.7.47-20
Date: Tue, 07 Jun 2005 21:02:05 +0200	[thread overview]
Message-ID: <42A5EF2D.5030905@stud.feec.vutbr.cz> (raw)
In-Reply-To: <20050607110409.GA14613@elte.hu>

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

Ingo Molnar wrote:
>  - performance feature: i've implemented a new scheduler feature called 
>    'delayed preemption', [...]

So far it's only for i386. On x84_64 the kernel doesn't compile.
Attached is my attempt to make it work on x86_64.
The diff is against RT-V0.7.47-26.

Warning: I don't know what I'm doing! But at least it compiles and boots 
for me.

Michich

[-- Attachment #2: rt-x86_64-delayed-preemption.diff --]
[-- Type: text/plain, Size: 3013 bytes --]

diff -Nurp -X linux-RT.mich/Documentation/dontdiff linux-RT/arch/x86_64/kernel/entry.S linux-RT.mich/arch/x86_64/kernel/entry.S
--- linux-RT/arch/x86_64/kernel/entry.S	2005-06-07 19:07:30.000000000 +0200
+++ linux-RT.mich/arch/x86_64/kernel/entry.S	2005-06-07 20:48:26.000000000 +0200
@@ -211,8 +211,8 @@ sysret_check:		
 	/* Handle reschedules */
 	/* edx:	work, edi: workmask */	
 sysret_careful:
-	bt $TIF_NEED_RESCHED,%edx
-	jnc sysret_signal
+	testl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edx
+	jz sysret_signal
 	sti
 	pushq %rdi
 	call schedule
@@ -231,7 +231,7 @@ sysret_signal:
 	leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
 	xorl %esi,%esi # oldset -> arg2
 	call ptregscall_common
-1:	movl $_TIF_NEED_RESCHED,%edi
+1:	movl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edi
 	jmp sysret_check
 	
 	/* Do syscall tracing */
@@ -280,8 +280,8 @@ int_with_check:
 	/* First do a reschedule test. */
 	/* edx:	work, edi: workmask */
 int_careful:
-	bt $TIF_NEED_RESCHED,%edx
-	jnc  int_very_careful
+	testl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edx
+	jz int_very_careful
 	sti
 	pushq %rdi
 	call schedule
@@ -310,7 +310,7 @@ int_signal:
 	movq %rsp,%rdi		# &ptregs -> arg1
 	xorl %esi,%esi		# oldset -> arg2
 	call do_notify_resume
-1:	movl $_TIF_NEED_RESCHED,%edi	
+1:	movl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edi	
 int_restore_rest:
 	RESTORE_REST
 	cli
@@ -478,8 +478,8 @@ bad_iret:
 	
 	/* edi: workmask, edx: work */	
 retint_careful:
-	bt    $TIF_NEED_RESCHED,%edx
-	jnc   retint_signal
+	testl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edx
+	jz    retint_signal
 	sti
 	pushq %rdi
 	call  schedule
@@ -499,7 +499,7 @@ retint_signal:
 	call do_notify_resume
 	RESTORE_REST
 	cli
-	movl $_TIF_NEED_RESCHED,%edi
+	movl $(_TIF_NEED_RESCHED|_TIF_NEED_RESCHED_DELAYED),%edi
 	GET_THREAD_INFO(%rcx)
 	jmp retint_check
 
diff -Nurp -X linux-RT.mich/Documentation/dontdiff linux-RT/include/asm-x86_64/thread_info.h linux-RT.mich/include/asm-x86_64/thread_info.h
--- linux-RT/include/asm-x86_64/thread_info.h	2005-06-07 14:05:32.000000000 +0200
+++ linux-RT.mich/include/asm-x86_64/thread_info.h	2005-06-07 19:12:01.000000000 +0200
@@ -103,6 +103,7 @@ static inline struct thread_info *stack_
 #define TIF_IRET		5	/* force IRET */
 #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
 #define TIF_SECCOMP		8	/* secure computing */
+#define TIF_NEED_RESCHED_DELAYED	9	/* rescheduling necessary upon return to userspace */
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_IA32		17	/* 32bit process */ 
 #define TIF_FORK		18	/* ret_from_fork */
@@ -117,6 +118,7 @@ static inline struct thread_info *stack_
 #define _TIF_IRET		(1<<TIF_IRET)
 #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
 #define _TIF_SECCOMP		(1<<TIF_SECCOMP)
+#define _TIF_NEED_RESCHED_DELAYED	(1<<TIF_NEED_RESCHED_DELAYED)
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 #define _TIF_IA32		(1<<TIF_IA32)
 #define _TIF_FORK		(1<<TIF_FORK)

  parent reply	other threads:[~2005-06-07 19:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07 11:04 [patch] Real-Time Preemption, -RT-2.6.12-rc6-V0.7.47-20 Ingo Molnar
2005-06-07 11:31 ` Steven Rostedt
2005-06-07 11:34   ` Ingo Molnar
2005-06-07 11:51 ` Michal Schmidt
2005-06-07 12:05   ` Ingo Molnar
2005-06-07 15:54 ` Esben Nielsen
2005-06-07 16:04   ` Ingo Molnar
2005-06-07 16:30     ` Michal Schmidt
2005-06-07 17:30     ` Peter Zijlstra
2005-06-07 19:05       ` Ingo Molnar
2005-06-07 19:02 ` Michal Schmidt [this message]
2005-06-07 19:25   ` Ingo Molnar

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=42A5EF2D.5030905@stud.feec.vutbr.cz \
    --to=xschmi00@stud.feec.vutbr.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox