sched-O1-2.4.17-I3.patch, need help
Hi all,
Curious to test the patch of the new scheduler-0(1) on the palin, I need your help.
I apply successfully the original patch against kernel 2.4.17-pa11 and after analysing its contents it appear that there are some i386 specific patches. There is the two which are problems for me because there are in asm section (and I do not undertand what the first makes):
include/asm-i386/bitops.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/bitops.h.orig Tue Aug 21 14:26:16 2001 +8 -0
@@ -75,6 +75,14 @@ :"=m" (ADDR) :"Ir" (nr)); } + +static __inline__ void __clear_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__( + "btrl %1,%0" + :"=m" (ADDR) + :"Ir" (nr)); +} #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier()
This second seems to me that I can transpose as it is but want your advice:
include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/mmu_context.h.orig Tue Aug 21 14:26:23 2001 +22 -0
@@ -7,6 +7,28 @@ #include <asm/pgalloc.h> /* + * Every architecture must define this function. It's the fastest + * way of searching a 168-bit bitmap where the first 128 bits are + * unlikely to be set. It's guaranteed that at least one of the 168 + * bits is cleared. + */ +#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(unsigned long *b) +{ + unsigned int rt; + + rt = b[0] & b[1] & b[2] & b[3]; + if (unlikely(rt != 0xffffffff)) + return find_first_zero_bit(b, MAX_RT_PRIO); + + if (b[4] != ~0) + return ffz(b[4]) + MAX_RT_PRIO; + return ffz(b[5]) + 32 + MAX_RT_PRIO; +} +/* * possibly do the LDT unload here? */ #define destroy_context(mm) do { } while(0)
And what do you about this one (how to implement it on hppa?):
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 renamed from arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47 2002 +1 -4
@@ -123,15 +123,12 @@ void cpu_idle (void) { /* endless idle loop with no priority at all */ - init_idle(); - current->nice = 20; - current->counter = -100; while (1) { void (*idle)(void) = pm_idle; if (!idle) idle = default_idle; - while (!current->need_resched) + if (!current->need_resched) idle(); schedule(); check_pgt_cache();
Thanks in advance for your help,
Joel
PS: please make me in CC.
-------------------------------------------------
This mail sent through Tiscalinet Webmail (http://webmail.tiscali.be)
include/asm-i386/bitops.h Wed Jan 16 00:52:28 2002 line 85
Quoted 8 lines · On Fri, Jan 18, 2002 at 08:19:38AM +0100, [email protected] wrote:
include/asm-i386/bitops.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/bitops.h.orig Tue Aug 21 14:26:16 2001 +8
-0+ +static __inline__ void __clear_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__( + "btrl %1,%0" + :"=m" (ADDR) + :"Ir" (nr)); +}
__clear_bit is simply a lockless clear_bit. it's the same difference between __set_bit and set_bit.
Quoted 13 lines
/*
+ * Every architecture must define this function. It's the fastest
+ * way of searching a 168-bit bitmap where the first 128 bits are
+ * unlikely to be set. It's guaranteed that at least one of the 168
+ * bits is cleared.
+ */include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/mmu_context.h.orig Tue Aug 21 14:26:23 2001 +7
-0+#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(unsigned long *b) +{ + unsigned int rt;
include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 line 31
Quoted 10 lines
include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/mmu_context.h.orig Tue Aug 21 14:26:23 2001 +10
-0+ + rt = b[0] & b[1] & b[2] & b[3]; + if (unlikely(rt != 0xffffffff)) + return find_first_zero_bit(b, MAX_RT_PRIO); + + if (b[4] != ~0) + return ffz(b[4]) + MAX_RT_PRIO; + return ffz(b[5]) + 32 + MAX_RT_PRIO; +} +/*
hrm -- actually a little tricky. Yes, this function for 32-bit compiles, but not for 64-bit compiles (long changes size, and of course that means it can be done more quickly on 64-bit quantities instead of 32-bit).
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 line 128
Quoted 11 lines
And what do you about this one (how to implement it on hppa?):
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 renamed from arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47 2002 +0
-3@@ -123,15 +123,12 @@ void cpu_idle (void) { /* endless idle loop with no priority at all */ - init_idle(); - current->nice = 20; - current->counter = -100;
yup, delete these.
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 line 134
Quoted 9 lines
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 renamed from arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47 2002 +1
-1while (1) { void (*idle)(void) = pm_idle; if (!idle) idle = default_idle; - while (!current->need_resched) + if (!current->need_resched) idle(); schedule(); check_pgt_cache();
Dunno.
Signature · 1 line
Revolutions do not require corporate support.
Matt,
Thanks a lot.
Anyway it is far much more difficult then I innocently believe. Struct changes ask also changes on other parts as offset.c, traps.c,... Also I would need much more works and help...
Hmm... about traps.c I always forgot to ask you:
at line 174 it was writen "... cr30 do not correspond..." would it not be read "... cr31 ..."?
Thanks again for help,
Joel
Quoting Matthew Wilcox <[email protected]>:
Quoted 68 lines · On Fri, Jan 18, 2002 at 08:19:38AM +0100, [email protected] wrote:
include/asm-i386/bitops.h Wed Jan 16 00:52:28 2002 line 85
Quoted 8 lines
include/asm-i386/bitops.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/bitops.h.orig Tue Aug 21 14:26:16 2001 +8
-0+ +static __inline__ void __clear_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__( + "btrl %1,%0" + :"=m" (ADDR) + :"Ir" (nr)); +}
__clear_bitis simply a locklessclear_bit. it's the same difference between__set_bitandset_bit.Quoted 13 lines
/*
+ * Every architecture must define this function. It's the fastest
+ * way of searching a 168-bit bitmap where the first 128 bits are
+ * unlikely to be set. It's guaranteed that at least one of the 168
+ * bits is cleared.
+ */include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/mmu_context.h.orig Tue Aug 21 14:26:23 2001 +7
-0+#if MAX_RT_PRIO != 128 || MAX_PRIO != 168 +# error update this function. +#endif + +static inline int sched_find_first_zero_bit(unsigned long *b) +{ + unsigned int rt;include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 line 31
Quoted 10 lines
include/asm-i386/mmu_context.h Wed Jan 16 00:52:28 2002 renamed from include/asm-i386/mmu_context.h.orig Tue Aug 21 14:26:23 2001 +10
-0+ + rt = b[0] & b[1] & b[2] & b[3]; + if (unlikely(rt != 0xffffffff)) + return find_first_zero_bit(b, MAX_RT_PRIO); + + if (b[4] != ~0) + return ffz(b[4]) + MAX_RT_PRIO; + return ffz(b[5]) + 32 + MAX_RT_PRIO; +} +/*hrm -- actually a little tricky. Yes, this function for 32-bit compiles,
but not for 64-bit compiles (long changes size, and of course that means
it can be done more quickly on 64-bit quantities instead of 32-bit).Quoted 3 lines
And what do you about this one (how to implement it on hppa?):
--- linux/arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47
2002
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 line 128
Quoted 8 lines
+++
linux/arch/i386/kernel/process.cWed Jan 16 00:52:28 2002arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 renamed from arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47 2002 +0
-3@@ -123,15 +123,12 @@ void cpu_idle (void) { /* endless idle loop with no priority at all */ - init_idle(); - current->nice = 20; - current->counter = -100;yup, delete these.
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 line 134
Quoted 9 lines
arch/i386/kernel/process.c Wed Jan 16 00:52:28 2002 renamed from arch/i386/kernel/process.c.orig Sun Jan 6 13:55:47 2002 +1
-1while (1) { void (*idle)(void) = pm_idle; if (!idle) idle = default_idle; - while (!current->need_resched) + if (!current->need_resched) idle(); schedule(); check_pgt_cache();
Quoted 6 lines
Dunno.
Signature · 1 line
Revolutions do not require corporate support.
-------------------------------------------------
This mail sent through Tiscalinet Webmail (http://webmail.tiscali.be)