From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B651CC433B4 for ; Thu, 15 Apr 2021 10:06:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1175561074 for ; Thu, 15 Apr 2021 10:06:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1175561074 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 98ECE6B0036; Thu, 15 Apr 2021 06:06:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92C016B006C; Thu, 15 Apr 2021 06:06:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CD656B0070; Thu, 15 Apr 2021 06:06:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id 6579B6B0036 for ; Thu, 15 Apr 2021 06:06:55 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 21196181B7E09 for ; Thu, 15 Apr 2021 10:06:55 +0000 (UTC) X-FDA: 78034172790.21.61D4E2E Received: from outbound-smtp53.blacknight.com (outbound-smtp53.blacknight.com [46.22.136.237]) by imf26.hostedemail.com (Postfix) with ESMTP id D3CC840002CD for ; Thu, 15 Apr 2021 10:06:49 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp53.blacknight.com (Postfix) with ESMTPS id 24AF8FAAA7 for ; Thu, 15 Apr 2021 11:06:53 +0100 (IST) Received: (qmail 20158 invoked from network); 15 Apr 2021 10:06:53 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 15 Apr 2021 10:06:52 -0000 Date: Thu, 15 Apr 2021 11:06:50 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Linux-MM , Linux-RT-Users , LKML , Chuck Lever , Jesper Dangaard Brouer , Matthew Wilcox , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Michal Hocko , Oscar Salvador Subject: Re: [PATCH 04/11] mm/vmstat: Convert NUMA statistics to basic NUMA counters Message-ID: <20210415100650.GJ3697@techsingularity.net> References: <20210407202423.16022-1-mgorman@techsingularity.net> <20210407202423.16022-5-mgorman@techsingularity.net> <7a7ec563-0519-a850-563a-9680a7bd00d3@suse.cz> <20210414151850.GG3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: qsuezuytihwur64ikzuom9eg6ey6pcn8 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D3CC840002CD Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=outbound-smtp53.blacknight.com; client-ip=46.22.136.237 X-HE-DKIM-Result: none/none X-HE-Tag: 1618481209-651037 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Apr 14, 2021 at 05:56:53PM +0200, Vlastimil Babka wrote: > On 4/14/21 5:18 PM, Mel Gorman wrote: > > On Wed, Apr 14, 2021 at 02:56:45PM +0200, Vlastimil Babka wrote: > >> So it seems that this intermediate assignment to zone counters (using > >> atomic_long_set() even) is unnecessary and this could mimic sum_vm_events() that > >> just does the summation on a local array? > >> > > > > The atomic is unnecessary for sure but using a local array is > > problematic because of your next point. > > IIUC vm_events seems to do fine without a centralized array and handling CPU hot > remove at the sime time ... > The vm_events are more global in nature. They are not reported to userspace on a per-zone (/proc/zoneinfo) basis or per-node (/sys/devices/system/node/node*/numastat) basis so they are not equivalent. > >> And probably a bit more serious is that vm_events have vm_events_fold_cpu() to > >> deal with a cpu going away, but after your patch the stats counted on a cpu just > >> disapepar from the sums as it goes offline as there's no such thing for the numa > >> counters. > >> > > > > That is a problem I missed. Even if zonestats was preserved on > > hot-remove, fold_vm_zone_numa_events would not be reading the CPU so > > hotplug events jump all over the place. > > > > So some periodic folding is necessary. I would still prefer not to do it > > by time but it could be done only on overflow or when a file like > > /proc/vmstat is read. I'll think about it a bit more and see what I come > > up with. > > ... because vm_events_fold_cpu() seems to simply move the stats from the CPU > being offlined to the current one. So the same approach should be enough for > NUMA stats? > Yes, or at least very similar. -- Mel Gorman SUSE Labs