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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 82CF3C38A2A for ; Wed, 6 May 2020 14:02:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5106B2073A for ; Wed, 6 May 2020 14:02:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5106B2073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E3F2B8E0005; Wed, 6 May 2020 10:02:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEF3C8E0003; Wed, 6 May 2020 10:02:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D04668E0005; Wed, 6 May 2020 10:02:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id B81518E0003 for ; Wed, 6 May 2020 10:02:45 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E6F83180AD5DA for ; Wed, 6 May 2020 14:02:44 +0000 (UTC) X-FDA: 76786459848.06.pan50_6f4043fd6fb56 X-HE-Tag: pan50_6f4043fd6fb56 X-Filterd-Recvd-Size: 3173 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Wed, 6 May 2020 14:02:44 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 46F7AAD93; Wed, 6 May 2020 14:02:45 +0000 (UTC) Date: Wed, 6 May 2020 16:02:41 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Sandipan Das , akpm@linux-foundation.org, linux-mm@kvack.org, khlebnikov@yandex-team.ru, kirill@shutemov.name, aneesh.kumar@linux.ibm.com, srikar@linux.vnet.ibm.com Subject: Re: [PATCH] mm: vmstat: Use zeroed stats for unpopulated zones Message-ID: <20200506140241.GB6345@dhcp22.suse.cz> References: <20200504070304.127361-1-sandipan@linux.ibm.com> <20200504102441.GM22838@dhcp22.suse.cz> <959f15af-28a8-371b-c5c3-cd7489d2a7fb@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <959f15af-28a8-371b-c5c3-cd7489d2a7fb@suse.cz> 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 06-05-20 15:33:36, Vlastimil Babka wrote: > On 5/4/20 12:26 PM, Michal Hocko wrote: > > On Mon 04-05-20 12:33:04, Sandipan Das wrote: > >> For unpopulated zones, the pagesets point to the common > >> boot_pageset which can have non-zero vm_numa_stat counts. > >> Because of this memory-less nodes end up having non-zero > >> NUMA statistics. This can be observed on any architecture > >> that supports memory-less NUMA nodes. > >> > >> E.g. > >> > >> $ numactl -H > >> available: 2 nodes (0-1) > >> node 0 cpus: 0 1 2 3 > >> node 0 size: 0 MB > >> node 0 free: 0 MB > >> node 1 cpus: 4 5 6 7 > >> node 1 size: 8131 MB > >> node 1 free: 6980 MB > >> node distances: > >> node 0 1 > >> 0: 10 40 > >> 1: 40 10 > >> > >> $ numastat > >> node0 node1 > >> numa_hit 108 56495 > >> numa_miss 0 0 > >> numa_foreign 0 0 > >> interleave_hit 0 4537 > >> local_node 108 31547 > >> other_node 0 24948 > >> > >> Hence, return zero explicitly for all the stats of an > >> unpopulated zone. > > > > I hope I am not just confused but I would expect that at least > > numa_foreign and other_node to be non zero. > Hmm, checking zone_statistics(): > > NUMA_FOREIGN increment uses preferred zone, which is the first in zone in > zonelist, so it will be a zone from node 1 even for allocations on cpu > associated to node 0 - assuming node 0's unpopulated zones are not included in > node 0's zonelist. But the allocation could have been requested for node 0 regardless of the amount of memory the node has. > NUMA_OTHER uses numa_node_id(), which would mean the node 0's cpus have node 1 > in their numa_node_id() ? Is that correct? numa_node_id should reflect the real node the CPU is associated with. -- Michal Hocko SUSE Labs