您的位置:首页 > 产品设计 > UI/UE

What’s different between deferrable functions and work queues

2013-05-14 10:51 465 查看
Tasklets and work queues implement deferrable functionality and replace the older bottom-half mechanism for drivers.

The BH interface is ancient, and it showed. Each BH must be statically defined, and

there are a maximum of 32. Because the handlers must all be defined at compile-time,

modules could not directly use the BH interface.They could piggyback off an existing

BH, however. Over time, this static requirement and the maximum of 32 bottom halves

became a major hindrance to their use.

All BH handlers are strictly serialized—no two BH handlers, even of different types,

can run concurrently.This made synchronization easy, but it wasn’t beneficial to multi-

processor scalability. Performance on large SMP machines was sub par.A driver using the

BH interface did not scale well to multiple processors.The networking layer, in particular,

suffered.

Work queues are a different form of deferring work from what we have looked at so far.

Work queues defer work into a kernel thread—this bottom half always runs in process

context.Thus, code deferred to a work queue has all the usual benefits of process context.

Most important, work queues are schedulable and can therefore sleep.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: