The number of writeback contexts can be configured, with a valid range between 0 and the number of online CPUs. Inodes are then distributed across these contexts, enabling parallel writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 0a772d984ecf..0a3204a3a3a3 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -1046,6 +1046,12 @@ int bdi_init(struct backing_dev_info *bdi) bdi->min_ratio = 0; bdi->max_ratio = 100 * BDI_RATIO_SCALE; bdi->max_prop_frac = FPROP_FRAC_BASE; + + /* + * User can configure nr_wb_ctx using the newly introduced sysfs knob. + * echo N > /sys/class/bdi/:/nwritebacks + * Filesystem can also increase same during mount. + */ bdi->nr_wb_ctx = 1; bdi->wb_ctx = kcalloc(bdi->nr_wb_ctx, sizeof(struct bdi_writeback_ctx *), -- 2.25.1