[LTP] [PATCH v4 13/31] testcases: sysfs: Add sys_bdi01

Petr Vorel pvorel@suse.cz
Thu Sep 3 18:05:00 CEST 2026


Hi Cyril,

...
> +++ b/testcases/kernel/sysfs/class/bdi/sys_bdi01.c
> @@ -0,0 +1,101 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) 2026 Cyril Hrubis <chrubis@suse.cz>
> + */
> +
> +/*\
> + * Sanity checks for the backing device info (BDI) attributes exported under
> + * /sys/class/bdi/<id>/.
> + *
> + * For every BDI the test verifies that:
> + *
> + * - min_ratio <= max_ratio (both are percentages)
> + * - min_ratio_fine <= max_ratio_fine (both are in parts-per-million, i.e.
> + *   100% == 1000000)
> + * - min_bytes <= max_bytes on kernel 6.2 or later, when max_bytes is set
> + *   (0 means ``no limit``)
> + * - stable_pages_required and strict_limit are booleans
> + * - read_ahead_kb is non-negative
> + *
> + * The test skips with TCONF when no BDI is present.
> + *
> + * min_bytes/max_bytes were added by commit 1bf27e98d26d (``mm: add
> + * bdi_set_max_bytes() function``), targeting the Linux 6.2 merge window.
very very nit: s/, targeting the Linux 6.2 merge window/ in kernel 6.2/

The code look perfect.

Kind regards,
Petr


More information about the ltp mailing list