Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp347178pxb; Wed, 14 Apr 2021 17:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0IH4MwXf6YqKOWLntkjWZupL5OCTQCzvReH2VNBfe6yCK9FZYVkR44mwPWa1p+IkoaP29 X-Received: by 2002:a17:906:a14c:: with SMTP id bu12mr642811ejb.549.1618446311605; Wed, 14 Apr 2021 17:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446311; cv=none; d=google.com; s=arc-20160816; b=t9Uqz9GYdjv0ZjJwLXamgcEz/Q79h7189efSLu8EDJSOQu1KGL7OeXa5BpUQLOV+WT qjWpNj46Eckx498FM+OE08GFgO477xZL+0xyeLMAzc2eI/hLco7aj7f4VzqUV5/xmtNJ uOd7jhYzQ3+ac+WA2EPZ1FH2RW7s7Fp/4xqtvvDrQXZpF+G/xl0yU1d8P+ml92hGUy1A YBKI4JvmRDIINC3Qm8wH7jFoHb3+arWfjw0GIiswfyKAxrT5TDnEojBqXf7v3csrY7BN xpCxKJT2w2yGoMxOjAvYVNdCVBtZ90fRok/y8Qu8Qc8h3pwghz/k7r2RROFYX5qD1u1l m6nw== 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:subject:from :references:cc:to; bh=YTyf1q3VScMXPuv7Y8CDvFmFWopUcfs60f+gcOIUJCk=; b=Webap6haxZY8Rk0BgHfTVS4gtxV61VxRZ9j70z6XIaQxjfHP7sP1jClHbG+XGx6RdG PvQdMEQXCaw8MAuHVjZ8p2sN4LOq1MQsekpzVTXt6ylibp3SxWjNAN57RlVCq3W9/aVO lpARR6rfO6iVhgsIPwRS16NGfPTXsq77MXgmX3Oh51FN/S8GzXIFNET+g74G2R1AJhyH YRFhwA6ShVDeRgYlsshR7LKtSAhApKbFR1aSIfToqmh+g5q8zGMyouiF5u69+tCDdDMH UUxxDyYMQlWTVgZkD9nDRvF7ddQyCUe1V2iTsWMMn5EjfPwL0I0UWbzd6Yrs+I5NlsxO nZ6w== 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 f1si705663ejz.585.2021.04.14.17.24.48; Wed, 14 Apr 2021 17:25:11 -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 S1346006AbhDNM5z (ORCPT + 99 others); Wed, 14 Apr 2021 08:57:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:48908 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233716AbhDNM5q (ORCPT ); Wed, 14 Apr 2021 08:57:46 -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 4F0B1AFC8; Wed, 14 Apr 2021 12:56:46 +0000 (UTC) To: Mel Gorman , Linux-MM , Linux-RT-Users Cc: 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> From: Vlastimil Babka Subject: Re: [PATCH 04/11] mm/vmstat: Convert NUMA statistics to basic NUMA counters Message-ID: <7a7ec563-0519-a850-563a-9680a7bd00d3@suse.cz> Date: Wed, 14 Apr 2021 14:56:45 +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: <20210407202423.16022-5-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/7/21 10:24 PM, Mel Gorman wrote: > NUMA statistics are maintained on the zone level for hits, misses, foreign > etc but nothing relies on them being perfectly accurate for functional > correctness. The counters are used by userspace to get a general overview > of a workloads NUMA behaviour but the page allocator incurs a high cost to > maintain perfect accuracy similar to what is required for a vmstat like > NR_FREE_PAGES. There even is a sysctl vm.numa_stat to allow userspace to > turn off the collection of NUMA statistics like NUMA_HIT. > > This patch converts NUMA_HIT and friends to be NUMA events with similar > accuracy to VM events. There is a possibility that slight errors will be > introduced but the overall trend as seen by userspace will be similar. > Note that while these counters could be maintained at the node level that > it would have a user-visible impact. I guess this kind of inaccuracy is fine. I just don't like much fold_vm_zone_numa_events() which seems to calculate sums of percpu counters and then assign the result to zone counters for immediate consumption, which differs from other kinds of folds in vmstat that reset the percpu counters to 0 as they are treated as diffs to the global counters. 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? 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. Thanks, Vlastimil