- 论坛徽章:
- 0
|
[ f] 恢复所以寄存器现场,也就是回到了你刚刚死循环中被键盘硬中断时的那个点,继续执行哪个死循环,也就是回到了[ b]中......如此往复无止境;
[ g] 这样用于在屏幕上打印你输入字符信息的键盘软中断便没有机会运行,也就是看上去没有响应; 就是tasklet啦:tasklet_schedule(&keyboard_tasklet);
虽然有可能打印,因为tasklet和rx softirq被ksoftirqd[cpu]线程来执行,
///如果cpu不同,即cpu(ksoftirqd for tasklet) != cpu(ksoftirqd for rx), 屏幕一定被打印。
虽然RX_SOFTIRQ 和 TASKLET_SOFTIRQ分享ksoftirqd[cpu],
由于RX_SOFTIRQ < TASKLET_SOFTIRQ, ///设计预留的缺陷??
TASKLET_SOFTIRQ实际被合法屏蔽,导致屏幕不被打印。
fortunately, in linux-2.6.24.4-rt4,
RX_SOFTIRQ 和 TASKLET_SOFTIRQ在同一个cpu上被不同线程执行,即分享cpu,
希望键盘操作流畅如水。
- Index: linux-2.6.24.4-rt4/kernel/softirq.c
- ===================================================================
- --- linux-2.6.24.4-rt4.orig/kernel/softirq.c 2008-03-24 19:05:22.000000000 -0400
- +++ linux-2.6.24.4-rt4/kernel/softirq.c 2008-03-24 19:07:14.000000000 -0400
- @@ -4,15 +4,23 @@
- * Copyright (C) 1992 Linus Torvalds
- *
- * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
- + *
- + * Softirq-split implemetation by
- + * Copyright (C) 2005 Thomas Gleixner, Ingo Molnar
- */
-
- #include <linux/module.h>
- +#include <linux/kallsyms.h>
- +#include <linux/syscalls.h>
- +#include <linux/wait.h>
- #include <linux/kernel_stat.h>
- #include <linux/interrupt.h>
- #include <linux/init.h>
- +#include <linux/delay.h>
- #include <linux/mm.h>
- #include <linux/notifier.h>
- #include <linux/percpu.h>
- +#include <linux/delay.h>
- #include <linux/cpu.h>
- #include <linux/freezer.h>
- #include <linux/kthread.h>
- @@ -46,7 +54,41 @@ EXPORT_SYMBOL(irq_stat);
-
- static struct softirq_action softirq_vec[32] __cacheline_aligned_in_smp;
-
- -static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
- +struct softirqdata {
- + int nr;
- + unsigned long cpu;
- + struct task_struct *tsk;
- +#ifdef CONFIG_PREEMPT_SOFTIRQS
- + wait_queue_head_t wait;
- + int running;
- +#endif
- +};
- +
- +static DEFINE_PER_CPU(struct softirqdata [MAX_SOFTIRQ], ksoftirqd);
复制代码
[ 本帖最后由 sisi8408 于 2008-5-10 15:35 编辑 ] |
|