Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp759886yba; Fri, 12 Apr 2019 13:11:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyEx8o2l46TIh4gA0ZWqdO1EFcqVkHFgPOeN5xdWjzGfrRXzO5ktTRX7SkYDKhy000DgPu X-Received: by 2002:a17:902:9a89:: with SMTP id w9mr60064231plp.126.1555099892265; Fri, 12 Apr 2019 13:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555099892; cv=none; d=google.com; s=arc-20160816; b=SceiYZpCZ/F2vTtF/22qPxFde/wG1GB2r4NsXyhquHLcvQUmGSx8LJphuQQFQnk7DM ym9s/DfhQJhn/8ImaQO5WxdPuUF5P5oDAJX1qvV+neaOQWvxvIpg8hcNzcvYR1BCGl2Y zv/Eu4yeLT97MJixdbK39kFeIQraKmI9E1XGi+QmlEPogFWUp2vkYLkSJcaRqePA5f5M aObDNwox7JyaHdHGiTejiA/KkoA3Dqf0mHdZQmvp/mO1J5qtE2uxHC0GCqpSE8RIUzRF Oy+7nmyzF7wMUrmMd7qCynJvXUp1jQtzDmQqWpKwKN1ig9IOH5FD0GcTHxTxMt2FgtFB 43LA== 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; bh=KL4HVhtEWvgQo7HQOLpi2CSpq8VK+yUMixkba3uKDZg=; b=U2nwJHz7AG3qYuWpjJzMnJTnwnhn6rHiueSXOhnYcWCErM8JLMdpq8mBxb/laAGCww Q0JOkj0Y3N0arUgZWs2kbj4dTxMWx5l2cnVjIOhplNduKMhOSlzPTy0iLg1DDB3+578O bjfb4Yyijyi/3IfrH1sMIVWaMTLe11uq4tBGXB8KRViz8neFgfhXbxF9kCcGIPuU7UaK gh3bqG8XAHtLzknJOLYuU+VfZKjgg/5ApEYaD2afl6AfrCRTz0+x+vayWof1axJvImaQ JLdflN+bcbzKzYgm06howfceZbIZ6lyOGuPBnwNCdm2Vy82ZAyiqFQi8PBbFl0QF9La6 yQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=HGtEDNLt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si10234565pgs.315.2019.04.12.13.11.14; Fri, 12 Apr 2019 13:11:32 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=HGtEDNLt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbfDLUKI (ORCPT + 99 others); Fri, 12 Apr 2019 16:10:08 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:41700 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726870AbfDLUKH (ORCPT ); Fri, 12 Apr 2019 16:10:07 -0400 Received: by mail-qt1-f194.google.com with SMTP id w30so12688440qta.8 for ; Fri, 12 Apr 2019 13:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KL4HVhtEWvgQo7HQOLpi2CSpq8VK+yUMixkba3uKDZg=; b=HGtEDNLthqGLuedDvcWcQ1HekO50r/XS7jrtBnh6XFA8NQFzosqhgjcfVaTaVT21+F w1q4VXl9ZZ9XnyKnnt0oXaOx+G2HR836hSnHm+9tRa5ftCZLstYd0AmiEW69ToQNXSTT UaeyyJp9/M8MV9kQTD8tmlwbXPv2hp1lB+mozU7oDB9/SA4wsWc68mC8tHAWkn5i+TDh om6ankdEU3FtXwv7KGCbZuNEApBQdcCi3mxFmA+66xv+wuiLEvVmNfZmkBNj6XwwGz4f ehrnYoRllpVANXpOkKs+Ru/sR8PkPWgDKm/CRtFatWXmj7YYDjE7crWKlgGZ7hnywrmM XVXA== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KL4HVhtEWvgQo7HQOLpi2CSpq8VK+yUMixkba3uKDZg=; b=AJfylOZzw5FTOUZWftSI47GGJ97SxWdSqpi67zhWuFgoGspXualTyLOQ/IrbNghyQc G4f0mL9yl4WkcGS4uuEqBkbpHS7+6QXf0fKF3K9dYjjRyMTe5BRbIShBRs9YTsJMAcN+ rxafJned5mtP7BibLDxzUJnDI1QgDfdU7jw1bUlSUcl+qtQ4SrXhHT9koDSwBLVwYUs2 OuCru5XAZOGKhIRX+4t6XhuY1t+l7BVsIFjSHZkEe15/OfJkmPE1MdLzwDAVXvXfozae h8TtxtV6X2LMKlmVN8wrVKNTWbYvHJiXviJobZgAc3vzCtaJSjImxKdMnb0aEGX0/vGn /KXw== X-Gm-Message-State: APjAAAVE+PItAyRReMlriGEgF464AH9hxZ1Z/DVrOKH4OJ5EYer96w7E JsKXVBImBOAs15ENw1mOBGScdg== X-Received: by 2002:ac8:3855:: with SMTP id r21mr48809369qtb.264.1555099806611; Fri, 12 Apr 2019 13:10:06 -0700 (PDT) Received: from localhost (pool-108-27-252-85.nycmny.fios.verizon.net. [108.27.252.85]) by smtp.gmail.com with ESMTPSA id h22sm34758855qth.68.2019.04.12.13.10.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Apr 2019 13:10:05 -0700 (PDT) Date: Fri, 12 Apr 2019 16:10:05 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Andrew Morton , Linux MM , Cgroups , LKML , kernel-team@fb.com, Roman Gushchin Subject: Re: [PATCH 3/4] mm: memcontrol: fix recursive statistics correctness & scalabilty Message-ID: <20190412201004.GA27187@cmpxchg.org> References: <20190412151507.2769-1-hannes@cmpxchg.org> <20190412151507.2769-4-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 12, 2019 at 12:55:10PM -0700, Shakeel Butt wrote: > We also faced this exact same issue as well and had the similar solution. > > > Signed-off-by: Johannes Weiner > > Reviewed-by: Shakeel Butt Thanks for the review! > (Unrelated to this patchset) I think there should also a way to get > the exact memcg stats. As the machines are getting bigger (more cpus > and larger basic page size) the accuracy of stats are getting worse. > Internally we have an additional interface memory.stat_exact for that. > However I am not sure in the upstream kernel will an additional > interface is better or something like /proc/sys/vm/stat_refresh which > sync all per-cpu stats. I was talking to Roman about this earlier as well and he mentioned it would be nice to have periodic flushing of the per-cpu caches. The global vmstat has something similar. We might be able to hook into those workers, but it would likely require some smarts so we don't walk the entire cgroup tree every couple of seconds. We haven't had any actual problems with the per-cpu fuzziness, mainly because the cgroups of interest also grow in size as the machines get bigger, and so the relative error doesn't increase. Are your requirements that the error dissipates over time (waiting for a threshold convergence somewhere?) or do you have automation that gets decisions wrong due to the error at any given point in time?