From: Henry N. <hen...@ar...> - 2011-04-24 17:33:18
|
Hello Kaikuo, mostly all changes on the schedulers would chrash coLinux. The only good tested scheduler is "deadline". The second problem is that, only CONFIG_PREEMPT=y works. Some functions may not be safe for non PREEMPT. coLinux works in cooperative with Windows, that means it can never be Real Time. After RT to coLinux you needs to fix some interrupt handlers. Some functions needs to call Windows, and after back from Windows we have counted some timer ticks, that needs to inject into the system timer. That will do with __do_IRQ. Here the RT-patch seems to forbid this. Lock into the patch for __do_IRQ: +#ifdef CONFIG_PREEMPT_RT + printk(KERN_WARNING "__do_IRQ called for irq %d. " + "PREEMPT_RT will crash your system soon\n", irq); + printk(KERN_WARNING "I hope you have a fire-extinguisher handy!\n"); +#endif So, if you have enabled CONFIG_PREEMPT_RT, then coLinux OS-switcher code does not work. You should disable CONFIG_PREEMPT_RT and enable CONFIG_PREEMPT=y. Or you needs to rewrite the timer injections. The condition of this problem you will find in linux-2.6.33-source/kernel/cooperative.c: static void co_handle_jiffies(long count) { ... while (count > 0) { irq_enter(); __do_IRQ(TIMER_IRQ); irq_exit(); count--; } This is the Proxy-IRQ, that is called after switching back from Windows to Linux. This function will adjust the jiffies and timer for the delay the CPU was in Windows. An other problem can be the CONFIG_TINY_RCU. The only supported RCU was Tiny. With all others I had problems, at the time the kernel was ported. Please disable CONFIG_TREE_PREEMPT_RCU and enable CONFIG_TINY_RCU=y. Why you need this RealTime patch for SCHED_FIFO? SCHED_FIFO exist also in the unpatched kernel, I found lots of entries with "SCHED_FIFO". Henry On 24.04.2011 14:16, Kaikuo ZHUO wrote: > I tried to use "SCHED_FIFO" pthreads in the colinux system ,and it seems to have some problems. > > > What I did is as follows: > > download the kernel source "linux-2.6.33.7-source" and make using "make kernel" in the colinux source tree > download and apply the rt patch for 2.6.33.7: ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/older/patch-2.6.33.7. > make menuconfig under "~/colinux-dev/build/linux-2.6.33.7-build" > change some code to follow the RT's style, replace some functions, such as : replace something like compat_rw_sempaphore and DECLARE_MUTEX > and finally I get a kernel, but it crash immediately when I use to boot with a debian squeeze dist. and may last a few seconds and crash. > > Does anyone know what happened? > > Here is the crash log: > ////////////////////////////////////////////////////////////////////// > I hope you have a fire-extinguisher handy! > __do_IRQ called for irq 0. PREEMPT_RT will crash your system soon > I hope you have a fire-extinguisher handy! > __do_IRQ called for irq 0. PREEMPT_RT will crash your system soon > I hope you have a fire-extinguisher handy! > __do_IRQ called for irq 0. PREEMPT_RT will crash your system soon > I hope you have a fire-extinguisher handy! > 522.64 BogoMIPS (lpj=2613248) > Mount-cache hash table entries: 512 > Performance Events: Core2 events, Intel PMU driver. > ... version: 2 > ... bit width: 40 > ... generic registers: 2 > ... value mask: 000000ffffffffff > ... max period: 000000007fffffff > ... fixed-purpose events: 3 > ... event mask: 0000000700000003 > CPU: Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz stepping 0d > Checking 'hlt' instruction... __do_IRQ called for irq 0. PREEMPT_RT will crash y > our system soon > I hope you have a fire-extinguisher handy! > OK. > __do_IRQ called for irq 0. PREEMPT_RT will crash your system soon > I hope you have a fire-extinguisher handy! > __do_IRQ called for irq 0. PREEMPT_RT will crash your system soon > I hope you have a fire-extinguisher handy! > NET: Registered protocol family 16 > colinux: Linux VM terminated > colinux: Kernel panic: Attempted to kill init! > > D:\colinux>console: Monitor848: Detached > > the .config I use is as follows: > diff .config linux-2.6.33.7-config > --------------------------------- > 3,4c3,4 > < # Linux kernel version: 2.6.33.7-rt29 > < # Sat Apr 23 03:15:56 2011 > --- >> # Linux kernel version: 2.6.33.7 >> # Sun Feb 6 22:23:55 2011 > 23,24c23,24 > < CONFIG_RWSEM_GENERIC_SPINLOCK=y > < CONFIG_ASM_SEMAPHORES=y > --- >> # CONFIG_RWSEM_GENERIC_SPINLOCK is not set >> CONFIG_RWSEM_XCHGADD_ALGORITHM=y > 80,84c80,81 > < CONFIG_TREE_PREEMPT_RCU=y > < # CONFIG_TINY_RCU is not set > < # CONFIG_RCU_TRACE is not set > < CONFIG_RCU_FANOUT=32 > < # CONFIG_RCU_FANOUT_EXACT is not set > --- >> # CONFIG_TREE_PREEMPT_RCU is not set >> CONFIG_TINY_RCU=y > 281,282d277 > < # CONFIG_PREEMPT_DESKTOP is not set > < CONFIG_PREEMPT_RT=y > 284,285d278 > < CONFIG_PREEMPT_SOFTIRQS=y > < CONFIG_PREEMPT_HARDIRQS=y > 363a357 >> CONFIG_HAVE_ATOMIC_IOMAP=y > 1228a1223 >> # CONFIG_DEBUG_SHIRQ is not set > 1240a1236 >> # CONFIG_DEBUG_MUTEXES is not set > 1261d1256 > < CONFIG_RCU_CPU_STALL_DETECTOR=y > > > > ------------------------------------------------------------------------------ > Fulfilling the Lean Software Promise > Lean software platforms are now widely adopted and the benefits have been > demonstrated beyond question. Learn why your peers are replacing JEE > containers with lightweight application servers - and what you can gain > from the move. http://p.sf.net/sfu/vmware-sfemails > _______________________________________________ > coLinux-devel mailing list > coL...@li... > https://lists.sourceforge.net/lists/listinfo/colinux-devel > -- Henry N. |