linux 3.8内核函数,linux内核函数之 blk_plug

/*

* blk_plug permits building a queue of related requests by holding the I/O

* fragments for a short period. This allows merging of sequential requests

* into single larger request. As the requests are moved from a per-task list to

* the device's request_queue in a batch, this results in improved scalability

* as the lock contention for request_queue lock is reduced.

*

* It is ok not to disable preemption when adding the request to the plug list

* or when attempting a merge, because blk_schedule_flush_list() will only flush

* the plug list when the task sleeps by itself. For details, please see

* schedule() where blk_schedule_flush_plug() is called.

*/

struct blk_plug {

unsigned long magic; /* detect uninitialized use-cases */

struct list_head list; /* requests */

struct list_head cb_list; /* md requires an unplug callback */

unsigned int should_sort; /* list to be sorted before flushing? */

};

#define BLK_MAX_REQUEST_COUNT 16

struct blk_plug_cb;

typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);

struct blk_plug_cb {

struct list_head list;

blk_plug_cb_fn callback;

void *data;

};

blk_plug构建了一个缓存碎片IO的请求队列。用于将顺序请求合并成一个大的请求。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值