OS学习笔记:Lecture 8

本文探讨了操作系统中中断处理的基本原则及其对系统性能的影响。介绍了中断处理程序仅做最少的工作并快速返回,将非关键任务推迟到稍后通过软中断或工作队列处理。讨论了软中断的静态分配及限制,并提出使用任务项来动态创建和销毁处理程序的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

System calls

 

Review:

Interrupt 只能嵌套两次

 

Bottomhalf (in linux)

Interrupt handling Philosophy

  1. Do as little as possible
  2. Defer non-critical actions till later

Interrupt handlers have no process context - cannot sleep

 

Top and bottom halves

Top-half: do minimum work and return (ISR)

Do it now!

Bottom-half: deferred processing

Do it later!

Softirqs

Statically allocated

Limited number

Can be executed simultaneously on multiple CPUs

Re-entrant

Do its own locking

Rescheduling

Softirq 的 handler 可能自己去设一个 softirq

Solution: quota + ksoftirqd

Tasklets

Softirq is static: cannot add a new type of softirq

Can be created and destroyed dynamically

Trouble: hard to get right; careful about sleeping

Work queues

Have a process context

Always run by kernel threads

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值