---
name: "blk_start_plug"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/blk_start_plug"
---

# blk\_start\_plug(9)

initialize blk\_plug and track it inside the task\_struct

## NAME

blk\_start\_plug - initialize blk\_plug and track it inside the task\_struct

## SYNOPSIS

**void blk\_start\_plug(struct blk\_plug \*** *plug***);**

## ARGUMENTS

*plug*

The struct blk\_plug that needs to be initialized

## DESCRIPTION

Tracking blk\_plug inside the task\_struct will help with auto-flushing the pending I/O should the task end up blocking between **blk\_start\_plug** and **blk\_finish\_plug**. This is important from a performance perspective, but also ensures that we don't deadlock. For instance, if the task is blocking for a memory allocation, memory reclaim could end up wanting to free a page belonging to that request that is currently residing in our private plug. By flushing the pending I/O when the process goes to sleep, we avoid this kind of deadlock.

## COPYRIGHT
