From: Yue Hu <huyue2@xxxxxxxxxxx> The patch removes the needless scale in existing caluation, it makes the calculation more simple and more effective. Signed-off-by: Yue Hu <huyue2@xxxxxxxxxxx> --- mm/vmpressure.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 6063581..174b2f0 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -111,7 +111,6 @@ static enum vmpressure_levels vmpressure_level(unsigned long pressure) static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned, unsigned long reclaimed) { - unsigned long scale = scanned + reclaimed; unsigned long pressure = 0; /* @@ -128,8 +127,7 @@ static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned, * scanned. This makes it possible to set desired reaction time * and serves as a ratelimit. */ - pressure = scale - (reclaimed * scale / scanned); - pressure = pressure * 100 / scale; + pressure = (scanned - reclaimed) * 100 / scanned; out: pr_debug("%s: %3lu (s: %lu r: %lu)\n", __func__, pressure, -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>