From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbdBIMXn (ORCPT ); Thu, 9 Feb 2017 07:23:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:33334 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbdBIMXF (ORCPT ); Thu, 9 Feb 2017 07:23:05 -0500 Date: Thu, 9 Feb 2017 13:22:27 +0100 From: Michal Hocko To: Vinayak Menon 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 1/2 v2] mm: vmpressure: fix sending wrong events on underflow Message-ID: <20170209122227.GH10257@dhcp22.suse.cz> References: <1486641577-11685-1-git-send-email-vinmenon@codeaurora.org> <20170209121057.GF10257@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170209121057.GF10257@dhcp22.suse.cz> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 09-02-17 13:10:57, Michal Hocko wrote: > On Thu 09-02-17 17:29:36, Vinayak Menon wrote: > > At the end of a window period, if the reclaimed pages > > is greater than scanned, an unsigned underflow can > > result in a huge pressure value and thus a critical event. > > Reclaimed pages is found to go higher than scanned because > > of the addition of reclaimed slab pages to reclaimed in > > shrink_node without a corresponding increment to scanned > > pages. Minchan Kim mentioned that this can also happen in > > the case of a THP page where the scanned is 1 and reclaimed > > could be 512. > > > > Acked-by: Minchan Kim > > Signed-off-by: Vinayak Menon > > Acked-by: Michal Hocko > > I would prefer the fixup in vmpressure() as already mentioned but this > should work as well. Btw. I guess this should be good to mark for stable. Reclaiming THP is not all that rare (even though we try to avoid anon reclaim as much as possible) and hitting critical events can lead to disruptive actions to early. -- Michal Hocko SUSE Labs