linux tasklet 4
引用 2 楼 cokeliu 的回复:
谢谢! 请问是否每调用一次tasklet_schedule(B task); B task任务被加到链表上只会被执行一次?
是的,只被加一次
第一次tasklet_schedule(B task)给他一个状态TASK_STATE_SCHED
作标记,以后的tasklet_schedule(B task)会检查这个标记
http://os.inf.tu-dresden.de/l4env/doc/html/dde_linux/group__mod__softirq.html
Deferred Activities
[Linux DDE Common
]
This module emulates deferred activities
at interrupt level inside the Linux kernel.
More...
Softirqs
This is from include/linux/interrupt.h
Softirqs are multithreaded, not serialized BH-like activities. Several
softirqs may run on several CPUs simultaneously - no matter if they are
of the same type.
Properties:
If raise_softirq()
is called, then softirq is guarenteed to be executed on this CPU.
On schedule()
do_softirq() is called if any softirq is active on this CPU.
Softirqs are not serialized in any way.
Linux (2.4.20) has only 4 softirqs:
HI_SOFTIRQ
NET_TX_SOFTIRQ
and NET_RX_SOFTIRQ
TASKLET_SOFTIRQ
Relevant for Linux DDE are for now only the first and the latter - NET_*
softirqs allow transparent mutli-threading in Linux' network code. HI_SOFTIRQ
is for high priority bottom halves as old-style
BHs and sound related drivers. It triggers execution of tasklet_hi_action()
. TASKLET_SOFTIRQ
runs lower priority bottom halves (e.g. in the console subsystem). It triggers execution of tasklet_action()
.
Todo:
only the implementation of tasklets is done in Linux DDE
void
raise_softirq
(int nr)
Raise Softirq.
Tasklets
This is from kernel/softirq.c and include/linux/interrupt.h)
Tasklets are the multithreaded analogue of BHs.
Main feature differing them of generic softirqs: one tasklet is running only on one CPU simultaneously.
Main feature differing them of BHs: different tasklets may be run simultaneously on different CPUs.
Properties:
If tasklet_schedule()
is called, then tasklet is guaranteed to be executed on some cpu at least on
相关文档:
目录和文件操作
查看当前目录相对于根目录的位置
pwd
查看当前目录内容
ls
以长格式查看当前目录内容。对应每个文件的条目将包括连接数目、所有者、大小、最后修改时间、权限等内容
ls -l
改变当前目录。目的目录名可用相对路径表示,也可以用绝对路径表示。
cd [目的目录名]
转移到上一级目录
c ......
1. gcc的__attribute__编绎属性
要了解Linux Kernel代码的分段信息,需要了解一下gcc的__attribute__的编绎属性,__attribute__主要用于改变所声明或定义的函数或数据的特性,它有很多子项,用于改变作用对象的特性。比如对函数,noline将禁止进行内联扩展、noreturn表示没有返回值、pure表明函数除返回值外,不会通过其它 ......
errno变量(需include errno.h)会被赋一个整数值,不同的值表示不同的含义,
可以通过查看该值推测出错的原因。但是errno是一个数字,代表的具体含义
还要到errno.h中去阅读宏定义。有下面几种方法可以方便的得到错误信息
(一)
#include <stdio.h>
void perror(const char *s)
perror()用来将上一个函数发生错误的 ......
http://hi.baidu.com/styl_007/blog/item/82b833f475036ce67609d7b6.html
中断处理的tasklet(小任务)机制-不过如此
2009-08-10 18:30
中断服务程序一般都是在中断请求关闭的条件下执行的
,
以避免嵌套而使中断控制复杂化。但是,中断是一个随机事件,它随时会到来,如果关中断的时间太长,
CPU
就不能及时响应其 ......