mm: add /sys/class/bdi/<bdi>/min_bytes knob
authorStefan Roesch <shr@devkernel.io>
Sat, 19 Nov 2022 00:52:08 +0000 (16:52 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 30 Nov 2022 23:59:05 +0000 (15:59 -0800)
commit9c84819bd64ec15cb15d041c45ebe4725e9d4f3b
tree11b40453094f17dcc2da3ec6608aae2e340c2929
parent803c98050569850be5fd51a2025c67622de887d9
mm: add /sys/class/bdi/<bdi>/min_bytes knob

bdi has two existing knobs to limit the amount of dirty memory:
min_ratio and max_ratio. However the granularity of the knobs is limited
and often it is more convenient to specify limits in terms of bytes.
This change adds the min_bytes knob.

It does not store the min_bytes value, instead it converts the max_bytes
value to a ratio. The value is therefore more an approximation than an
absolute value.

It also maintains the sum over all the bdi min_ratio values stored in
the variable bdi_min_ratio.

Link: https://lkml.kernel.org/r/20221119005215.3052436-14-shr@devkernel.io
Signed-off-by: Stefan Roesch <shr@devkernel.io>
Cc: Chris Mason <clm@meta.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/backing-dev.c