mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
mm: use part per 1000000 for bdi ratios
To get finer granularity for ratio calculations use part per million instead of percentiles. This is especially important if we want to automatically convert byte values to ratios. Otherwise the values that are actually used can be quite different. This is also important for machines with more main memory (1% of 256GB is already 2.5GB). Link: https://lkml.kernel.org/r/20221119005215.3052436-5-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>
This commit is contained in:
committed by
Andrew Morton
parent
16b837eb84
commit
ae82291e9c
@@ -178,7 +178,7 @@ static ssize_t min_ratio_store(struct device *dev,
|
||||
|
||||
return ret;
|
||||
}
|
||||
BDI_SHOW(min_ratio, bdi->min_ratio)
|
||||
BDI_SHOW(min_ratio, bdi->min_ratio / BDI_RATIO_SCALE)
|
||||
|
||||
static ssize_t max_ratio_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
@@ -197,7 +197,7 @@ static ssize_t max_ratio_store(struct device *dev,
|
||||
|
||||
return ret;
|
||||
}
|
||||
BDI_SHOW(max_ratio, bdi->max_ratio)
|
||||
BDI_SHOW(max_ratio, bdi->max_ratio / BDI_RATIO_SCALE)
|
||||
|
||||
static ssize_t stable_pages_required_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
@@ -809,7 +809,7 @@ int bdi_init(struct backing_dev_info *bdi)
|
||||
|
||||
kref_init(&bdi->refcnt);
|
||||
bdi->min_ratio = 0;
|
||||
bdi->max_ratio = 100;
|
||||
bdi->max_ratio = 100 * BDI_RATIO_SCALE;
|
||||
bdi->max_prop_frac = FPROP_FRAC_BASE;
|
||||
INIT_LIST_HEAD(&bdi->bdi_list);
|
||||
INIT_LIST_HEAD(&bdi->wb_list);
|
||||
|
Reference in New Issue
Block a user