Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2415748ybg; Thu, 30 Jul 2020 21:11:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZY4vgL0tcuiHbDbI6YHXq1B1+hEZI+6rI72VgovmQZzz+9+6X+GeWvR2LwNxF2rLDoNQm X-Received: by 2002:a17:906:5c52:: with SMTP id c18mr2238748ejr.168.1596168677926; Thu, 30 Jul 2020 21:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596168677; cv=none; d=google.com; s=arc-20160816; b=sQG2z2Pj0zZTobbCNHCH9QcjETiBQ2Ey6VXt5QOlu2Pyy9i0v4/cX0ETmZ4VCSAlHN 72G3fgC4cM6oymd6U1T5lywXBVmgkKxyQLFQOgL1rzYdI+WE5TX+Jih1edMpgry3qGU0 lMRq7x49kAxewXFxczQTJLMiTRG/ZZgOTxFu9T48/cVfVDCpmugzinGC/ATI69LJT/5g hy82rmDHE9V7oaMzL6c2A+xuw/lvsnX4PYERTqhr4R/faq/8GcwHsw4wvbEEcERatzAw 274Nw8M5HTZ9cSL/qOp2aW+LJ4WsWHHQEShsLtZy6QM2k83UVgGW6w8fMcp8zlRHFEGW jDKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=mYWpP6aK/ldCf40apNtXCnGd6yexdgynubGjVo7Bfc0=; b=rQoQYG16E7F7rarf8GK4cE2uJn3K6r2k6MadTiRvIIZPeFYVq/tWA65UjYYmppGf4J jt8LS3OT03PPtB9gIPsmP7RDNG4+lLsRwB83Z4Uj+rVLX1g3q441vmxSakfgU32Btcgq aUnEJDegSOeBC/NPVAG8KJ6op1SXZ7LcGSZRB6iywIu3h37FN18ldNi/VjtU7aBfnWfY /nmLQADnz2RIpq8H2xKKhAU7ujTCgTw7gtdpCv6IacwN+az/8eA6L9Pl3rhvAxGGrsoP 9ivgHbE6gtbFxwGvVWfjiE9f1THMHtn7f46TBdIZ4xHmQc5hIR925acLoflzPab2aICH UiHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rCcTUY3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si4758295eji.43.2020.07.30.21.10.52; Thu, 30 Jul 2020 21:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rCcTUY3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726325AbgGaEHM (ORCPT + 99 others); Fri, 31 Jul 2020 00:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgGaEHM (ORCPT ); Fri, 31 Jul 2020 00:07:12 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F02B9C061574 for ; Thu, 30 Jul 2020 21:07:11 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id g26so27750294qka.3 for ; Thu, 30 Jul 2020 21:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=mYWpP6aK/ldCf40apNtXCnGd6yexdgynubGjVo7Bfc0=; b=rCcTUY3bGoSbaXPfkkI8cQEkGpV8mm9TAojYFnlSDFFQxMdNrvbPZIfcFchMNbearV 7ZaSEeAGxFkDmwMHmRyrNn9es5QiySm5OOJwdjUM40gdNTQjVJ68rgfr2cRyQ3BaEl0O iE9sQQGEqNMkUF+ThPF64r8sPM/NtfQBt0JDfBDXj2BuNweOJoypQ1K4xJAZu4QNpeg0 iH/5qAMqtqSEtP6Imn0QR9X4bO1l0d9WZs68paIcsH1plhLY1wUAgaNVx4RnKQY5B7x0 Yp+K4hAV+abg1Og1kMAMRgGO4NDVNugoG/43m5+ybhzRYvTO/daSECZm1lZbnvGl3NtD k0oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=mYWpP6aK/ldCf40apNtXCnGd6yexdgynubGjVo7Bfc0=; b=M/wFvMXVkzm4Z8xcWPSGyY9mfxhTE1VbULK79n+84Tmuq8ovq1N9Itq5R2L11qdnGH tygHw9b+u5fJ9Bra5QyVzBuxm7zqjf7kCOAlYPb7cQrH/3dN/CBrtDCuaXDTI19SsmKv vBDx9J5k5FLwLgnF5ICkZovBjv+5FNjU53X6twi7eps4nmUcmVgUrVWULwkbcn41dX8g EF6j4KD3j2BsEnuFbQb1CKKaV8cg76HBzzOlDmnqvRC1nvkRvpcV/ZYyP/dG75O9t0S2 mqSp4iMgd5JRv85VMtJBgIJKcpqtWEhza3epwD+HDl05isJynntGQzIZALjysURA+1WS ngyA== X-Gm-Message-State: AOAM531eVg9+nj3YdgegbPFWYujRTircTCFfCnEpDedAoK373qakf6pH KMrMMo37yTeefiqGyiZdidci5w== X-Received: by 2002:a05:620a:2231:: with SMTP id n17mr2202771qkh.37.1596168430402; Thu, 30 Jul 2020 21:07:10 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id 71sm6518634qkk.125.2020.07.30.21.07.07 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Thu, 30 Jul 2020 21:07:08 -0700 (PDT) Date: Thu, 30 Jul 2020 21:06:55 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Roman Gushchin cc: Hugh Dickins , Andrew Morton , Johannes Weiner , Michal Hocko , Vlastimil Babka , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings In-Reply-To: <20200730162348.GA679955@carbon.dhcp.thefacebook.com> Message-ID: References: <20200714173920.3319063-1-guro@fb.com> <20200730162348.GA679955@carbon.dhcp.thefacebook.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Jul 2020, Roman Gushchin wrote: > On Wed, Jul 29, 2020 at 08:45:47PM -0700, Hugh Dickins wrote: > > > > But a better idea is perhaps to redefine the behavior of > > "echo >/proc/sys/vm/stat_refresh". What if > > "echo someparticularstring >/proc/sys/vm/stat_refresh" were to > > disable or enable the warning (permanently? or just that time?): > > disable would be more "back-compatible", but I think it's okay > > if you prefer enable. Or "someparticularstring" could actually > > specify the warning threshold you want to use - you might echo > > 125 or 16000, I might echo 0. We can haggle over the default. > > May I ask you, what kind of problems you have in your in mind, > which can be revealed by these warnings? Or maybe there is some > history attached? Yes: 52b6f46bc163 mentions finding a bug of mine in NR_ISOLATED_FILE accounting, but IIRC (though I might be making this up) there was also a bug in the NR_ACTIVE or NR_INACTIVE FILE or ANON accounting. When one of the stats used for balancing or limiting in vmscan.c trends increasingly negative, it becomes increasingly difficult for those heuristics (adding on to others, comparing with others) to do what they're intended to do: they behave increasingly weirdly. Now the same (or the opposite) is true if one of those stats trends increasingly positive: but if it leaks positive, it's visible in /proc/vmstat; whereas if it leaks negative, it's presented there as 0. And most of the time (when unsynchronized) showing 0 is much better than showing a transient negative. But to help fix bugs, we do need some way of seeing the negatives, and vm/stat_refresh provides an opportunity to do so, when it synchronizes. I'd be glad not to show the transients if I knew them: set a flag on any that go negative, and only show if negative twice or more in a row? Perhaps, but I don't relish adding that, and think it would be over-engineering. It does sound to me like echoing the warning threshold into /proc/sys/vm/stat_refresh is the best way to satisfy us both. Though another alternative did occur to me overnight: we could scrap the logged warning, and show "nr_whatever -53" as output from /proc/sys/vm/stat_refresh: that too would be acceptable to me, and you redirect to /dev/null. (Why did I choose -53 in my example? An in-joke: when I looked through our machines for these warnings, on old kernels with my old shmem hugepage implementation, there were a striking number with "nr_shmem_freeholes -53"; but I'm a few years too late to investigate what was going on there.) > > If it's all about some particular counters, which are known to be > strictly positive, maybe we should do the opposite, and check only > those counters? Because in general it's not an indication of a problem. Yet it's very curious how few stats ever generate such warnings: you're convinced they're just transient noise, and you're probably right; but I am a little suspicious of whether they are accounted correctly. Hugh