1BLK_START_PLUG(9) Block Devices BLK_START_PLUG(9)
2
3
4
6 blk_start_plug - initialize blk_plug and track it inside the
7 task_struct
8
10 void blk_start_plug(struct blk_plug * plug);
11
13 plug
14 The struct blk_plug that needs to be initialized
15
17 Tracking blk_plug inside the task_struct will help with auto-flushing
18 the pending I/O should the task end up blocking between blk_start_plug
19 and blk_finish_plug. This is important from a performance perspective,
20 but also ensures that we don't deadlock. For instance, if the task is
21 blocking for a memory allocation, memory reclaim could end up wanting
22 to free a page belonging to that request that is currently residing in
23 our private plug. By flushing the pending I/O when the process goes to
24 sleep, we avoid this kind of deadlock.
25
27Kernel Hackers Manual 3.10 June 2019 BLK_START_PLUG(9)