Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3333729yba; Tue, 23 Apr 2019 01:48:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPp3cWVzKM725wdFeaT1lbsbzaoKtX4zQEt6zm/d0feCrgbRNjPZeLXnsKJ10Hjve+N2v+ X-Received: by 2002:a62:ed10:: with SMTP id u16mr25238119pfh.187.1556009291851; Tue, 23 Apr 2019 01:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556009291; cv=none; d=google.com; s=arc-20160816; b=b5/qXVJ3z5hla94dxWVERlVgrKCdCSqhWaWdTVwXRw/mswJIk8bjA5e68RxZsGQ4V/ PpRxbd7kOWjWk7zeQkA6yB0Lt622Ll/SygRhJRIi362vyEqz1DhRdSk4EBtzFpVOMFiR yETLBLLxmsOm/YQlLrIfcF+AXlaIGQgzzwvsomibyWQYpdQuCXDQ743QFbxAbTVjTO7Z E2uOVSTOeHmpTsTguoepIyhYsCDf04SsdP8j+hV/EOHLqwUI4id4hKOTxsOtdkvPtDEw KOQwX61Ep2CpF6PotVxWc/J7iWl+qCr6wIcErhc+x1smT9reVw2zjZjiGb26WC+X4ycK kI1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mDLdgtTp5gy52ijm7HK8Ps+IDdAF+jR+CvS+usFlua4=; b=QPFZcRj4Qnkkr9GUJCOZdKo7e1F0mFs8EjjlIO6PVt5ZBzmX4z4rgpbyVAL5NO3u+W 1Ir2OsG5oW7hOlcyjjXZqfec8eUrejHOgSJ3xqDE61jSnytVaLWeJ/uvSV3xkSrOLFTj blNTfJ5rBimjmHkHtBlKp5usdVOihXTeGaNme3eH9QkcFgLhyonNIGsDAOfWXIGuZIeP O8ai9g6T8JJMBteg7rdekYLOakSPi91w7hy7jnPZCb3p7W3oo20Ry1qazZIBn2v+89fm c42HKeY0+NVUinnklWL9yKYBJeJtgU1mmwGdMM3tkurfCXyfbjJ7dyqFx56viuUWylHn anxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZxwEBBsC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi10si9790541plb.85.2019.04.23.01.47.57; Tue, 23 Apr 2019 01:48:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZxwEBBsC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbfDWIql (ORCPT + 99 others); Tue, 23 Apr 2019 04:46:41 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46432 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWIql (ORCPT ); Tue, 23 Apr 2019 04:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mDLdgtTp5gy52ijm7HK8Ps+IDdAF+jR+CvS+usFlua4=; b=ZxwEBBsC1roM8wjsBn78JtKjte gYs9e79GmF/LS6zKy1lPKog7ssg2+nX7vX7n8HLh9XJvCjQD/4fhOEt/6TI6wcIrzLhzO4XeuTpFl JvZG4b85yAM4Eff/4uVPqSqTzhopVjvK8ZEGMBC+WOFRAGt/F+qbSHYl0itm5jgBKhLWaJj8S5lpj f9HLbBf/k7j104SPRnDX467cqSB30XB2glms8cz1a/gOn6v0CLH4a/X8f6DXMlVXFtfRz2JWzfGWf 0tBh9ZJ4wulDV+Y2NRtlcJ5tCZhVtVnaBrUcSgqKepkDeiKz1y/jjwW8US1lmybnX4ZAnP0Q5Wntt cKns57BA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIr4V-0001Ef-4F; Tue, 23 Apr 2019 08:46:35 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DBEB329B47DC8; Tue, 23 Apr 2019 10:46:33 +0200 (CEST) Date: Tue, 23 Apr 2019 10:46:33 +0200 From: Peter Zijlstra To: =?utf-8?B?546L6LSH?= Cc: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, Ingo Molnar , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH 1/5] numa: introduce per-cgroup numa balancing locality, statistic Message-ID: <20190423084633.GC11158@hirez.programming.kicks-ass.net> References: <209d247e-c1b2-3235-2722-dd7c1f896483@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 22, 2019 at 10:11:24AM +0800, 王贇 wrote: > + * 0 -- remote faults > + * 1 -- local faults > + * 2 -- page migration failure > + * 3 -- remote page accessing after page migration > + * 4 -- local page accessing after page migration > @@ -2387,6 +2388,11 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags) > memset(p->numa_faults_locality, 0, sizeof(p->numa_faults_locality)); > } > > + p->numa_faults_locality[mem_node == numa_node_id() ? 4 : 3] += pages; > + > + if (mem_node == NUMA_NO_NODE) > + return; I'm confused on the meaning of 3 & 4. It says 'after page migration' but 'every' access if after 'a' migration. But even more confusingly, you even account it if we know the page has never been migrated. So what are you really counting?