Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp255028ybl; Fri, 16 Aug 2019 23:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCfp9jvMm3bm+sfKzHGFKIisgCuZSUC8ACsOr+Qe/L1zbI/L9v8Gf0cpGXp8mrpNFSytSc X-Received: by 2002:a17:902:a706:: with SMTP id w6mr13309186plq.166.1566024065377; Fri, 16 Aug 2019 23:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566024065; cv=none; d=google.com; s=arc-20160816; b=vU7fQfd9e1em4wzhx3ey+PVy6QTLDB4n4Efv77KtU1XzD3zjOV8TCqF5UkTRc3jVfU EXZunXwK1P9gl0WfcjY1xxU2Z3EiJXPlFQE4BUvLhPVxYxfG0aCn67xtdIWL1g9FTmX9 NAQQ42rxbOixZjJSO7hDvYg0D997h1Wgd4rQYLp7o/mzDLfEyHu9gbOTW3UFqSFY9sng JWK6ziP78/5eHSCON7+bYX4Sxm2AdMsDS9DLBuhEJjIYznR0bvN9x56fjFECGz5vVZgM wH5gNv83Ty/akqJXllbBrJqD9PROyC+RebFMoca4Y5L32rUgfWbT9F43aGOwHAjL7Ry5 d0Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=Y9OfE2r4E1tSStdiznC+SPSctmsndu3EzLvP6c5/UhE=; b=DP1xypA+872+RkGgRlNbRhvHJtcWKEu+8VV/IihznGjJ7wucFoU5jai6zBUX/hHT8I yfrkHKcC29OShSsRujCU27h5niqO1tXTUxQyiBfCTQvgZFJdq1rC2AbswlxtuiqzXEnj tZNxUeGSENT6DA5lKwwo2P3sdJ3B9zmg4Q/ms0CdaBGRDn1Ry+xEWUQqbB4XT+P2XXa8 BtnxNuQ0ABvBROTEPApJM5c3O5liDWbTRwYtR24nWkvNGO5kp3eneehk5o0iB9Bda64J RuIwN5p7wzQ9DlnYKPvCMdjJhKEnJgXdQauXV6XbSGOddE1gpLTVI05XunRoeE+6LVp/ WFsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=TZa25lqN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=xeRMLb3M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si5458825plr.112.2019.08.16.23.40.50; Fri, 16 Aug 2019 23:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=TZa25lqN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=xeRMLb3M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbfHQGgW (ORCPT + 99 others); Sat, 17 Aug 2019 02:36:22 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:57983 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfHQGgW (ORCPT ); Sat, 17 Aug 2019 02:36:22 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E6AB84A8; Sat, 17 Aug 2019 02:36:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 17 Aug 2019 02:36:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=Y9OfE2r4E1tSStdiznC+SPSctms ndu3EzLvP6c5/UhE=; b=TZa25lqNMX0mP0RXq2uiix8rthdUBWVqAyWlAiCwIOC DuBWbIJQjEqH0t8I9ZI4MgBqQ68VVjSyIWBup120UpcrEb/JSfdbiIwBqhqgqxeL eb2BCFfMK2B0TLDP78omUF+7ae2Td3HdoQIEi4cZZb7sAUMgDY87hX3iEHrqYlGy 7xGf9a5w7apuniEHIOQ7o1oDhWoXcv2kGbHKQc0FQMkuKSheUIZqy+Tv19o5QpPI tI9I7t3nwEeO/WBDm2m0aLDIZdR/Ud9VRc/n+8K9mgKDI597qBiqXSSIzbxflujr kEQ/9pt37URFO/RLTqziuiyTgABfFzAoluI2+rrLKDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Y9OfE2 r4E1tSStdiznC+SPSctmsndu3EzLvP6c5/UhE=; b=xeRMLb3MY3vBZw/F8zOFnm a4VK+p7QYFIJf20SVMJiaKHvgk/0GWXQ/L26fnFrJTN422eDLzx2UnBEDYrIegAY im2q/G/ySaAR/8IYo+4ZmDUwYXzpcikzEmZPAxaFOJB4kwFbfoqEIixa7o1NpHUH QFfGdUr0SB+Umkhg2gFWj5amFF6OkXCEDV1jkyd1/QKsrYyA/CChoIi6ePHaRvBK A2KCPmCjXen+//oS488T2tEcCxCCbISTnip5wjHtlSuntIJBq/znpxQQiHJzlCsM q+y/XV2DerUUdEj2H/XkkkiUpWVWvONcYHcG0V/HG+4mQq77zWeqzqMWWS7oT2vw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudefgedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpefirhgv ghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucffohhmrghinhepkhgvrhhnvg hlrdhorhhgnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhf rhhomhepghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id AC7AB80059; Sat, 17 Aug 2019 02:36:17 -0400 (EDT) Date: Sat, 17 Aug 2019 08:36:16 +0200 From: Greg KH To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, Michal Hocko , Johannes Weiner , linux-kernel@vger.kernel.org, kernel-team@fb.com, stable@vger.kernel.org, Yafang Shao Subject: Re: [PATCH] Partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones" Message-ID: <20190817063616.GA11747@kroah.com> References: <20190817004726.2530670-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190817004726.2530670-1-guro@fb.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 16, 2019 at 05:47:26PM -0700, Roman Gushchin wrote: > Commit 766a4c19d880 ("mm/memcontrol.c: keep local VM counters in sync > with the hierarchical ones") effectively decreased the precision of > per-memcg vmstats_local and per-memcg-per-node lruvec percpu counters. > > That's good for displaying in memory.stat, but brings a serious regression > into the reclaim process. > > One issue I've discovered and debugged is the following: > lruvec_lru_size() can return 0 instead of the actual number of pages > in the lru list, preventing the kernel to reclaim last remaining > pages. Result is yet another dying memory cgroups flooding. > The opposite is also happening: scanning an empty lru list > is the waste of cpu time. > > Also, inactive_list_is_low() can return incorrect values, preventing > the active lru from being scanned and freed. It can fail both because > the size of active and inactive lists are inaccurate, and because > the number of workingset refaults isn't precise. In other words, > the result is pretty random. > > I'm not sure, if using the approximate number of slab pages in > count_shadow_number() is acceptable, but issues described above > are enough to partially revert the patch. > > Let's keep per-memcg vmstat_local batched (they are only used for > displaying stats to the userspace), but keep lruvec stats precise. > This change fixes the dead memcg flooding on my setup. > > Fixes: 766a4c19d880 ("mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones") > Signed-off-by: Roman Gushchin > Cc: Yafang Shao > Cc: Johannes Weiner > --- > mm/memcontrol.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.