The end of tasklets

Controlling Deferred Execution in the Kernel

内核中的延迟执行控制

A common problem in kernel development is controlling when a specific task should be done. Kernel code often executes in contexts where some actions (sleeping, for example, or calling into filesystems) are not possible.

内核开发中的一个常见问题是如何控制特定任务的执行时机。内核代码经常在一些受限的上下文中执行,在这些情况下,某些操作(例如休眠或调用文件系统)是不可行的。

Other actions, while possible, may prevent the kernel from taking care of a more important task in a timely manner.

此外,即使某些操作可以执行,它们也可能会阻碍内核及时处理更重要的任务。

The kernel community has developed a number of deferred-execution mechanisms designed to ensure that every task is handled at the right time.

为了解决这一问题,内核社区开发了多种延迟执行机制,以确保每项任务都能在适当的时机执行。

One of those mechanisms, tasklets, has been eyed for removal for years; that removal might just happen in the near future.

其中之一——tasklet 机制,多年来一直被认为应该移除;这种移除可能在不久的将来成为现实。

Deferred Execution in Interrupt Handlers

中断处理程序中的延迟执行

One context where deferred execution is often needed is interrupt handlers.

延迟执行最常见的应用场景之一是中断处理程序。

An interrupt diverts a CPU from whatever it was doing at the time and must be handled as quickly as possible; sleeping in an interrupt handler is not even remotely an option.

中断会打断 CPU 当前正在执行的任务,因此必须尽快处理;在中断处理程序中休眠是绝对不允许的。

So interrupt handlers typically just make a note of what needs to be done, then arrange for the actual work to be done in a more forgiving context.

因此,中断处理程序通常只是记录需要执行的任务,并安排在一个更宽松的上下文中执行实际工作。

There are se

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值