Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp640447pxb; Thu, 15 Apr 2021 03:08:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhDZvxUjMYyBnThVhfy8ASWG3Qr83mWTDvcqRLzazXMsN3zt/jO4kyTTnIVnE3/6JmRP+J X-Received: by 2002:a17:906:c09:: with SMTP id s9mr2578192ejf.145.1618481298986; Thu, 15 Apr 2021 03:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618481298; cv=none; d=google.com; s=arc-20160816; b=Cje1BP40B74N4SBE1nkmd2t4tJvw9Ibyaxzhmc/FM0FMfCBW5tpO3tQiTBloQ2Sbou T9BXvDr3YxwOJc+AfCdC8Aot39TnsZzzMpqUhAJU+EBaEUJlvZYSavs/5ZQiyFJrTtq7 ki35WOjxMa2gqRAV0LHSONpn/w69MPMoTsQ+fIjaVxoemcykXcgoG/4SKvGN2YzNaCyt cmeGJURsXXe2bLM9PYuHiJVwiHQxOPxQ7HaBBbQ3GLv1haGTyOqmcpmoUCB6igJlwV/t xggryXoAJbjMIEWfVeJWlvvZ6PlPdsteFHbdaA4VXb7+UGE3S5G6vO/7aU9VX+285kSI H1ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=yetPZTeiJ2YnjDzD8TdFNznV1iCFfp9xdmpXfwzKqjc=; b=zPUvdbk6RcxFn1p0TCR5dUdTQaycuLfmaqdJcvoX1gCUdHC0abdNRu2VeXJLetLFDM McajD5qdcQWdoZPkqv/DofVS6z7suVz+k4HzM2NxzbTFAOy0kDdPV1w5prpP3YKXHg6K o/gSKNtmWyVAHkZzd2UI0WUKfRpPP82OGJ1DE6AdkBnNxY8+8QV1n4XMHbcgHJTkJod3 LKfMUFph4J5snPcy7XEQcRmnNaTjYAKPrZvjLxKY5A62o90OqP4ezsU4HLI6dCXhL3bb 6HEKpmclU6pK2XILkNVf9Xkp+B3FYtitD5w3+JD7J42JDIrN4NHnakj1EzL4b+MOFfCh dWAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bn11si1880499ejb.403.2021.04.15.03.07.55; Thu, 15 Apr 2021 03:08:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbhDOKHS (ORCPT + 99 others); Thu, 15 Apr 2021 06:07:18 -0400 Received: from outbound-smtp56.blacknight.com ([46.22.136.240]:46845 "EHLO outbound-smtp56.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbhDOKHR (ORCPT ); Thu, 15 Apr 2021 06:07:17 -0400 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp56.blacknight.com (Postfix) with ESMTPS id 24CB9FAAA8 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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