lkml.org 
[lkml]   [2017]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2 RESEND] mm: vmpressure: fix sending wrong events on underflow
On Mon 06-02-17 17:54:10, Vinayak Menon wrote:
[...]
> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
> index 149fdf6..3281b34 100644
> --- a/mm/vmpressure.c
> +++ b/mm/vmpressure.c
> @@ -112,8 +112,10 @@ static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned,
> unsigned long reclaimed)
> {
> unsigned long scale = scanned + reclaimed;
> - unsigned long pressure;
> + unsigned long pressure = 0;
>
> + if (reclaimed >= scanned)
> + goto out;

This deserves a comment IMHO. Besides that, why shouldn't we normalize
the result already in vmpressure()? Please note that the tree == true
path will aggregate both scanned and reclaimed and that already skews
numbers.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2017-02-06 13:41    [W:0.073 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site