Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1242283ybx; Fri, 1 Nov 2019 19:14:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2gXzIFEFvv63/9E8pusE3jPq036KgsTsnUJYuasOcdhMCUtPU5MNyftBK7lto7T4/2aaH X-Received: by 2002:a05:6402:1292:: with SMTP id w18mr16567146edv.151.1572660845439; Fri, 01 Nov 2019 19:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572660845; cv=none; d=google.com; s=arc-20160816; b=CGPtVFIlnU351D5iYfNguXimXmKzXxluU6MF4zaj8NivbhmnRuDtYdU8TxTnryUw8i oHBO7X/+qVcTBp0ZeqmjYeAjRePOEKwPeLjiC3z47BYpQyY2O8HStmplavwyIJl1Cs+H XW103r71xw3RD5kss0IsMrnjfhK01XPLkV9WixqA4gHQI+Kgpu9+la5itnWEHxr/nEwH 3+IHowMcxTUiIirgaT/644SAgoj6BjzgZQctm+BVhoIzPXdA1IodeBooTYWB/dWNkOP7 eB/1Up8NDILTgZ8fhI8e8qJUw5X1gbnTsiMtBIKWeOJQf7M713DxxL1MUy/mNp+TQ024 fH2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DD4T0dUu00G+y/7QgdnrJw/zo3n1oprGGzBQvOqDbOU=; b=0chqsUw+MIJ6FVC4OGHkQGXp4OfxK+YvCLJwHCUsholbIVXhX3KStiqqFpcR6Q+DUR xDZqLQUALTOdEcncNDCShVMIB63cMmH8/txflJdzyprTJOkZDDnCFlcELj46WjN1BN0e m+kDXrkg77JVAeqONmdBnkVEu+4jDtN3ir00U0ghW3UEiXQLJ2dA0ZIKZ12zvpWg7zGN 3K2rQXHq1WV+Kwrqum4OYgXH75NDh6DZikhxrpk5HEAq83aRZcP7WwaM7elL1C36ASAC t6RB5gxsFZZVFzGb6ZHi364gbR3qTJtWfvp2e7n2aOnecd0dOX4hSHYym4eHUaaaS5mU K1Eg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si2155645edc.221.2019.11.01.19.13.42; Fri, 01 Nov 2019 19:14:05 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727671AbfKBBNr (ORCPT + 99 others); Fri, 1 Nov 2019 21:13:47 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:59692 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfKBBNr (ORCPT ); Fri, 1 Nov 2019 21:13:47 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0TgyIBrx_1572657222; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TgyIBrx_1572657222) by smtp.aliyun-inc.com(127.0.0.1); Sat, 02 Nov 2019 09:13:43 +0800 Subject: Re: [PATCH v2] sched/numa: advanced per-cgroup numa statistic To: =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org References: <46b0fd25-7b73-aa80-372a-9fcd025154cb@linux.alibaba.com> <682ed1d4-abf1-92f6-851f-567ff9b9a841@linux.alibaba.com> <20191101173936.GB16165@blackbody.suse.cz> From: =?UTF-8?B?546L6LSH?= Message-ID: <0b7a20a3-4ff4-6183-c6e1-7c8c37efd0e2@linux.alibaba.com> Date: Sat, 2 Nov 2019 09:13:42 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191101173936.GB16165@blackbody.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Michal On 2019/11/2 上午1:39, Michal Koutný wrote: > Hello Yun. > > On Tue, Oct 29, 2019 at 03:57:20PM +0800, 王贇 wrote: >> +static void update_numa_statistics(struct cfs_rq *cfs_rq) >> +{ >> + int idx; >> + unsigned long remote = current->numa_faults_locality[3]; >> + unsigned long local = current->numa_faults_locality[4]; >> + >> + cfs_rq->nstat.jiffies++; > This statistics effectively doubles what > kernel/sched/cpuacct.c:cpuacct_charge() does (measuring per-cpu time). > Hence it seems redundant. Yes, while there is no guarantee the cpu cgroup always binding with cpuacct in v1, we can't rely on that... > >> + >> + if (!remote && !local) >> + return; >> + >> + idx = (NR_NL_INTERVAL - 1) * local / (remote + local); >> + cfs_rq->nstat.locality[idx]++; > IIUC, the mechanism numa_faults_locality values, this statistics only > estimates the access locality based on NUMA balancing samples, i.e. > there exists more precise source of that information.> > All in all, I'd concur to Mel's suggestion of external measurement. Currently I can only find numa balancing who is telling the real story, at least we know after the PF, task do access the page on that CPU, although it can't cover all the cases, it still giving good hints :-) It would be great if we could find more similar indicators, like the migration failure counter Mel mentioned, which give good hints on memory policy problems, could be used as external measurement. Regards, Michael Wang > > Michal >