Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4032089ybl; Mon, 3 Feb 2020 11:12:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxnvNQvjbsegjj5zTiU0wf4EE/9vuljEI/B6hpgZ8p4j9eyEAsxyeOlFWEwMRiZiEh/Ajsu X-Received: by 2002:a9d:4541:: with SMTP id p1mr19126827oti.199.1580757144815; Mon, 03 Feb 2020 11:12:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757144; cv=none; d=google.com; s=arc-20160816; b=DKcv+g7fbPG3ZPS4ubiAsffkHeGMlJem8kO6USCzY9aVp6dnImp4WiF5QlKmqjtXpO RxeRbUMkTJMqd1ts7Dg2FsCIBNsh67H+LbjFB9lgdUAWYOKyDt8LiXgC3MgifGrSoH7V 7zLFsSQgvC5UxWIZPNy7N2NebCZbBQmFnr2Y1+nwLtRgPSKziwC+pt1/9FbBP0DvQtWw lk9ro9EnuAwLrMcPo13TqsxEtNaDfPpI+CbgIJCMqeXATFxmxNMngIieBxkHWnQM4Yzc 5vfT6slSGmXPGgVSM2Tzg5rrt/uo0wVCaxtsSF5jdna7MdH/ZLk6shbQ9jNXvouV7Mcs qNmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Wdj5tmwIO7fxCz8UnDnfa7K1klbEEPxhOInltF7ScW4=; b=AbRcCiT/y+SrrefSqcogT7XhgIwwVC0HqGvKwd5AE7v8QVGlgOKymtMJlbnEDUwwVy ae/RvVVjQ+qJ3BImzEzr24B/r4fDnJo2JZ1d3nN9ovZ6wPiBzO5nxHK6c9qrTyoyi5aM SrZ8dcuRi7v0VNxC9owH+NgaeHdrKVOZyQ00Kt1cCo/mg7ICaQZYFww77BgqtHA4AsH4 gqjSVx/+0+kpqNyChYGqc4CNFskkMNacaVOYuDCt2pxaa6b9RCmxKvpXz1F9pr9KI5tz TlBzg2Qv2PWL/D8HEQws2he3KY0M7dSNwrqqab+3/OsI+STCzaynDxKJ7b+u21rMKHTC iA5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=M+dBjUlD; 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 l5si9693042otf.37.2020.02.03.11.12.12; Mon, 03 Feb 2020 11:12:24 -0800 (PST) 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=M+dBjUlD; 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 S1728373AbgBCSAb (ORCPT + 98 others); Mon, 3 Feb 2020 13:00:31 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:35130 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728097AbgBCSAb (ORCPT ); Mon, 3 Feb 2020 13:00:31 -0500 Received: by mail-qt1-f196.google.com with SMTP id n17so10998075qtv.2 for ; Mon, 03 Feb 2020 10:00:30 -0800 (PST) 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; bh=Wdj5tmwIO7fxCz8UnDnfa7K1klbEEPxhOInltF7ScW4=; b=M+dBjUlDoBYWgPsybUxws18GQBpTHTdNOra53zF3nDvUJEJ5HUbulam9LVJHgVbq5J SOfL6WOuY6N8nSuehf2NrL0HVUTlSNFwYGhVZBj6Fq6oueEXrGjBPVfgxNzP5FLpjLEM f6fzKkkEUa8iQYaXAlgB38/l8rbaMCOLHJywbHx9XfmFpb/reI1xas3ENvRpcBFkBjnt Tg/hlY1lYllF+rsc1W/WX/PPizv/Gypq9aiWpu3F9swdovbsqYkyl14eoSFft2H9KOoB XJUoyh0lbbDSgrsWbpeJmWexEAVs5Kga5y/0pEM3yHwV1giVFM2LG3eKxwY40JOX9R4b fUPA== 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; bh=Wdj5tmwIO7fxCz8UnDnfa7K1klbEEPxhOInltF7ScW4=; b=aYPUBhFus36qwwJc6axs8LyaqTPBuwu9/LEGBy+8La7GO/fciW0LMSA439N6TDrrNi T7nWaGFyml6I12gx7o6yOqeIFeEslFwb/toaw/RvftvUo1zzsvcJuCOesrVbjRDPpew9 Cxh4cw1id3PX/lnO5C7RfKb9ywFg3XSjTNPjtM3mqbTEQMUpr+3XiAmIiDXLgI0IaG2t e08CYq+uAendus89mpo+PBtY8eL329OhXXznAzkmHYUhVDSsK5A4r+pEDZrEoQM+oOEt vtCJCxZasjfsjRFoB1cWEJ2FaOCHeQ/iJy84pLlS8WgJJWAw6iATPRgFDKsxExRv5T3k rn1A== X-Gm-Message-State: APjAAAXV1z0eQ00Fim9etgv5zMjCIxlqCzEdtjksIGkjWtYdnkdO3/YO elDroLbHKcAvMaz4Mh7ciI5LQw== X-Received: by 2002:ac8:607:: with SMTP id d7mr24565557qth.271.1580752829730; Mon, 03 Feb 2020 10:00:29 -0800 (PST) Received: from localhost ([163.114.130.128]) by smtp.gmail.com with ESMTPSA id k4sm9665676qki.35.2020.02.03.10.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 10:00:28 -0800 (PST) Date: Mon, 3 Feb 2020 12:58:18 -0500 From: Johannes Weiner To: Roman Gushchin Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Shakeel Butt , Vladimir Davydov , linux-kernel@vger.kernel.org, kernel-team@fb.com, Bharata B Rao , Yafang Shao Subject: Re: [PATCH v2 12/28] mm: vmstat: use s32 for vm_node_stat_diff in struct per_cpu_nodestat Message-ID: <20200203175818.GF1697@cmpxchg.org> References: <20200127173453.2089565-1-guro@fb.com> <20200127173453.2089565-13-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127173453.2089565-13-guro@fb.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 09:34:37AM -0800, Roman Gushchin wrote: > Currently s8 type is used for per-cpu caching of per-node statistics. > It works fine because the overfill threshold can't exceed 125. > > But if some counters are in bytes (and the next commit in the series > will convert slab counters to bytes), it's not gonna work: > value in bytes can easily exceed s8 without exceeding the threshold > converted to bytes. So to avoid overfilling per-cpu caches and breaking > vmstats correctness, let's use s32 instead. > > This doesn't affect per-zone statistics. There are no plans to use > zone-level byte-sized counters, so no reasons to change anything. Wait, is this still necessary? AFAIU, the node counters will account full slab pages, including free space, and only the memcg counters that track actual objects will be in bytes. Can you please elaborate?