Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp352438pxb; Wed, 14 Apr 2021 17:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeB7jTyElDdbJmtQeWeDEL9g+Y+H+nmQRHZqJu6Y3V/UkiNNY5anQGatiZxMZSEYYADG2x X-Received: by 2002:a17:906:c30d:: with SMTP id s13mr746474ejz.68.1618446858015; Wed, 14 Apr 2021 17:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446858; cv=none; d=google.com; s=arc-20160816; b=V8jPVZpQr92YlA8n4glA2lCzzQceVwOeya1XVzc4EhR71RNzWC9wKpZduqUrf130ov vjJoIWQCKKP/hmj3/NB0DhbzZyN73GEMA83wbmYlJhKuJum+bxWWcX9hSt8xA7Fge1NW r7vBy/K3kkRZAsaznpvyvpup7Qp3VCdcSVgOmNM2T4hfaV2pcoTdP3PzCXM3+nmqMUn/ tO9/UUwwOqS8rVg7DuAL0DImX5hdWCn4lrtCNBbK2ZqqEOLBDYq/cBQnQgKY23tON0Ro G3ZzoZM0UDu7N/1tmYTbIZxQSZzNu2BXSb4HLe3kuU48P2uRX7XdZpDZUn9/rPr2vziC 4Zww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=74SXhSTq/qZwykLH/XOewr5FTJQouqOdrQ0e3geNs0U=; b=NMKEiYRHJYCNxWqmiJls7q1e5powYcIhJHpR64SMFo1j9XWMllxhgzDTLvpGb3Zgur SLMtxZL5+2j5uODM2kMVi7nF85zjjFCx46rkM5WyJoEuldz+IIzTIb6SoSYXReLc8G08 yB6lZCnwOYh8FE81fytqkGwNWIJCIbiOwNOHooXpYwiNqkq4pvgQOfXk0dgKoqw1qX5X qbtoQgyXrkJGJ4Zg1o7kPM9yzvMFWa8RgXRpl2ym1is7uuXQgSHMUvJmqmxYMsn1BNKn uskmZJtNotPhzQCBrWLJUXBzhMVYTtmZqO11vobFWLzszU0OjG3jZ7aOcCOqA3aSNbAV PApA== 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 x13si729299eju.369.2021.04.14.17.33.55; Wed, 14 Apr 2021 17:34: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 S1352564AbhDNP5T (ORCPT + 99 others); Wed, 14 Apr 2021 11:57:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:56588 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351195AbhDNP5Q (ORCPT ); Wed, 14 Apr 2021 11:57:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D6F03B0BA; Wed, 14 Apr 2021 15:56:53 +0000 (UTC) Subject: Re: [PATCH 04/11] mm/vmstat: Convert NUMA statistics to basic NUMA counters To: Mel Gorman Cc: Linux-MM , Linux-RT-Users , LKML , Chuck Lever , Jesper Dangaard Brouer , Matthew Wilcox , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Michal Hocko , Oscar Salvador References: <20210407202423.16022-1-mgorman@techsingularity.net> <20210407202423.16022-5-mgorman@techsingularity.net> <7a7ec563-0519-a850-563a-9680a7bd00d3@suse.cz> <20210414151850.GG3697@techsingularity.net> From: Vlastimil Babka Message-ID: Date: Wed, 14 Apr 2021 17:56:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210414151850.GG3697@techsingularity.net> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ... >> 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? > Thanks! >