共 21 篇文章
显示摘要每页显示  条
softirq,tasklet和workqueue的分析今天看了《深入理解Linux内核》的中断和异常一章,对Softirq,tasklet和workqueue做一个简单的总结和分析。要问为什么,那是因为// __local_bh_disable() 函数设置了一个标志当作互斥量,而这个// 标志正是上面的 irq_exit() 和 do_softirq() 函数中的// in_interrupt() 函数判断的条件之一,也就是说 in_inter...
软中断 tasklet 并发性分析softirq:软中断由编译期间静态分配,不像tasklet那样动态注册或去除一个软中断不会抢占另外一个软中断。tasklet:『同一时间里,相同类型的tasklet只能有一个执行(其他不同类型的tasklet可以同时进行, 在不同的CPU上),由TASKLET_STATE_RUN来控制的。
softirq,tasklet和workqueue的分析softirq,tasklet和workqueue的分析。要问为什么,那是因为 // __local_bh_disable() 函数设置了一个标志当作互斥量,而这个 // 标志正是上面的 irq_exit() 和 do_softirq() 函数中的 // in_interrupt() 函数判断的条件之一,也就是说 in_interrupt() // 函数不仅检测硬中断而且还判断了软中断。tasklet是建立...
内核的等待队列。typedef struct __wait_queue_head wait_queue_head_t;* @q: the waitqueue唤醒的队列的队列头 * @mode: which threads 唤醒那种类型的等待队列,如:可中断和不可中断 * @nr_exclusive: how many wake-one or wake-many threads to wake up * @key: is directly passed to the wakeup function */void fastcall __wake_up(wai...
不论是哪个版本,都将调用__do_softirq函数: asmlinkage void __do_softirq(void){ struct softirq_action *h; __u32 pending; int max_restart = MAX_SOFTIRQ_RESTART; int cpu; //保存位图 pending = local_softirq_pending(); //进程记帐 account_system_vtime(current); //关闭本地CPU下半部。
module中调用spin_lock_irqsave没锁住内核理解] 为什么我的spin_lock_irqsave()没有锁住时钟中断?1.#include <linux/kernel.h>2.#include <linux/init.h>3.#include <linux/module.h>4.#include <linux/spinlock.h>5.23.module_init(init_test);QUOTE:from userspace, before insmod, interrupt is enable : 1from ke...
irq_desc_t *desc = irq_desc + irq;/*用于统计,kstat_this_cpu是一个per-cpu变量*/ if (CHECK_IRQ_PER_CPU(desc->status)) { irqreturn_t action_ret; /* * No locking required for CPU-local interrupts: */ if (desc->handler->ack) desc->handler->ack(irq); action_ret ...
这里的可屏蔽是指是否能够通过CPU标志寄存器的关中断标志IF位来屏蔽中断,CPU指令流水操作的最后一步执行中断检测,如果标志寄存器中的IF位为1,就检查INTR上是否有信号,如果IF为0,就不会去理会INTR线上的信号。首先将当前特权级CPL(存放在cs寄存器的低两位)与段描述符(存放在GDT中)的描述符特权级DPL比较,如果CPL小于DPL,就产生一个“G...
struct irq_desc *desc = irq_to_desc(i);这样,例如 IRQ号是0 (从init_IRQ()调用,它对应的中断向量是FIRST_EXTERNAL_VECTOR)的中断通过中断门后会触发 interrput[0],从而执行:desc = irq_to_desc(irq);desc->handle_irq(irq, desc);execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)desc->handle_irq=handle_leve...
struct timer_data test_data;void test_timer_fn(unsigned long arg){ struct timer_data *data = (struct timer_data *)arg;}void test_timer_fn1(unsigned long arg){ struct timer_data *data = (struct timer_data *)arg;//if (queue_work(test_workqueue, &test_work) == 0) { if (queue_work(test_workqueue, ...
帮助 | 留言交流 | 联系我们 | 服务条款 | 下载网文摘手 | 下载手机客户端
北京六智信息技术股份有限公司 Copyright© 2005-2024 360doc.com , All Rights Reserved
京ICP证090625号 京ICP备05038915号 京网文[2016]6433-853号 京公网安备11010502030377号
返回
顶部