Skip to content

bdflush

Intro

bdflush - System call that schedules kernel tasks related to buffer flushing.

Description

The bdflush system call works by writing an argument in to the /proc/sys/vm/bdflush file. Each argument value is taken as an instruction for the bdflush daemon to execute specific buffer-related tasks. This system call responds to pressure from an mmapped buffer pool, not just from the files being written to disk. This can improve performance when dealing with heavy write I/O operations.

However, bdflush system calls should be used with care. It can come with a great performance boost, but can also lead to much higher memory usage and potential latency spikes in subsequent system calls.

Arguments

  • func:int[K] - The parameter value is used by the bdflush daemon to determine what to do.
  • buffer_pages:unsigned int[K] - Number of pages to write-back per task.
  • read_pages: unsigned int[K] - Number of pages to clean per task.

Available Tags

  • K - Originated from kernel-space.

Hooks

sys_dobdflush

Type

Kprobe + Kretprobe.

Purpose

To collect information about bdflush system calls.

Example Use Case

The bdflush system call can be used when dealing with high-throughput write I/O operations, such as file transfers. This system call can be used to bring the performance back in line with what is expected.

Issues

The bdflush system call can lead to excessive memory usage and latency spikes in subsequent system calls, which can reduce performance even further.

  • open()
  • read()
  • write()

This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.