linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Vinayak Menon <vinmenon@codeaurora.org>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
	mgorman@techsingularity.net, vbabka@suse.cz, riel@redhat.com,
	vdavydov.dev@gmail.com, anton.vorontsov@linaro.org,
	minchan@kernel.org, shashim@codeaurora.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 RESEND] mm: vmpressure: fix sending wrong events on underflow
Date: Mon, 6 Feb 2017 13:40:37 +0100	[thread overview]
Message-ID: <20170206124037.GA10298@dhcp22.suse.cz> (raw)
In-Reply-To: <1486383850-30444-2-git-send-email-vinmenon@codeaurora.org>

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-02-06 12:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 12:24 [PATCH 1/2 v4] mm: vmscan: do not pass reclaimed slab to vmpressure Vinayak Menon
2017-02-06 12:24 ` [PATCH 2/2 RESEND] mm: vmpressure: fix sending wrong events on underflow Vinayak Menon
2017-02-06 12:40   ` Michal Hocko [this message]
2017-02-06 13:09     ` vinayak menon
2017-02-06 13:24       ` Michal Hocko
2017-02-06 14:35         ` vinayak menon
2017-02-06 15:12           ` Michal Hocko
2017-02-07 11:17             ` vinayak menon
2017-02-07 12:09               ` Michal Hocko
2017-02-06 12:52 ` [PATCH 1/2 v4] mm: vmscan: do not pass reclaimed slab to vmpressure Michal Hocko
2017-02-06 15:10   ` vinayak menon
2017-02-07  8:10     ` Michal Hocko
2017-02-07 11:09       ` vinayak menon
2017-02-07 12:17         ` Michal Hocko
2017-02-07 13:16           ` vinayak menon
2017-02-07 14:52             ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170206124037.GA10298@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    --cc=shashim@codeaurora.org \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    --cc=vinmenon@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).