Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4010207ybg; Tue, 29 Oct 2019 00:23:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgwOnsWMkzp8cpYHzlP+6DWIBXt01dLwf/fsCXNcRi/s8EScfcYsP+1csNsbeH0ujqZtbD X-Received: by 2002:a17:906:2793:: with SMTP id j19mr1776055ejc.55.1572333798862; Tue, 29 Oct 2019 00:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572333798; cv=none; d=google.com; s=arc-20160816; b=UA4wlMvdyANP5C/aEo8rU9DmvWAy2Xh2QClMTVkt4nJZbxbNftxRpnwf1rYpPrvDGs W0RWDtadsJ+zC/MoQb6qRsKUFkAMnqAGfwAWUmt2eGdAcoz7+rLVEvr3MqqO73q3Wiym pLoX4T03ymn5PK5wKBsJvHd/xmLk5rrhCC4na7UP1MFkbA3L+b+tUr1qDHwxQAcnfjDW sQmAO00d59sXqh19rpeCo4zsHeR08f1M0ByArttNBoIcpyxFMMT4Rz0aheyqGkXT0scx yHZPqsV75D3LAqdoaDMeCOMWGl8pG7B3IWDllZH0qDsx4amTD31T6M04+KnwiQm1Faqf bAmQ== 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=sa/Id3hrFpMOsh7OBwRh7Ke5vnFbvKuoUmBw22gGrI0=; b=dUMpEV+ZkSU60htrYleaYqs3Q4xI/GaN0VGjn+QJJvwM/1dt2jT7E9D5adR+zlWKJ4 tHSHM1Z2WgDxBADsrYYpRFLmu7r88Ot2J6BMUk6vQKFfONke8n9s6XfN628O5rOS6gxg te6fmjibqgRU7rh3kl6gPX+olHebqjGLXxCmYcVBljnDvpdGHRjhR42EhXigA/nmcPu5 irO//cs4Nio4ABJxh2Vf7V6i39DZwsHT1nTcPnaEi2o2vqwdJ3KFsvqRuhDkkzn6pccq EvmsOq9Kwe7Jm3cf4MeL19l+c470qj14wKm6B70BnqTm3wHKA2TgRPm8NGVW6gp2AIGH sPhg== 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 b19si7563693ejj.83.2019.10.29.00.22.55; Tue, 29 Oct 2019 00:23:18 -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 S1729923AbfJ2CCl (ORCPT + 99 others); Mon, 28 Oct 2019 22:02:41 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:51077 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728242AbfJ2CCk (ORCPT ); Mon, 28 Oct 2019 22:02:40 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0TgaVt6a_1572314557; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TgaVt6a_1572314557) by smtp.aliyun-inc.com(127.0.0.1); Tue, 29 Oct 2019 10:02:38 +0800 Subject: Re: [PATCH] sched/numa: advanced per-cgroup numa statistic To: Peter Zijlstra Cc: Ingo Molnar , 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> <20191028130222.GM4131@hirez.programming.kicks-ass.net> From: =?UTF-8?B?546L6LSH?= Message-ID: <2b692012-50b5-20f1-b656-fd72a12c1d1a@linux.alibaba.com> Date: Tue, 29 Oct 2019 10:02:37 +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: <20191028130222.GM4131@hirez.programming.kicks-ass.net> 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 On 2019/10/28 下午9:02, Peter Zijlstra wrote: [snip] >> + tg = task_group(p); >> + while (tg) { >> + /* skip account when there are no faults records */ >> + if (idx != -1) >> + this_cpu_inc(tg->numa_stat->locality[idx]); >> + >> + this_cpu_inc(tg->numa_stat->jiffies); >> + >> + tg = tg->parent; >> + } >> + >> + rcu_read_unlock(); >> +} > > Thing is, we already have a cgroup hierarchy walk in the tick; see > task_tick_fair(). > > On top of that, you're walking an entirely different set of pointers, > instead of cfs_rq, you're walking tg->parent, which pretty much > guarantees you're adding even more cache misses. > > How about you stick those numa_stats in cfs_rq (with cacheline > alignment) and see if you can frob your update loop into the cgroup walk > we already do. Thanks for the reply :-) The hierarchy walk here you mean is the loop of entity_tick(), correct? Should working if we introduce the per-cfs_rq numa_stat accounting and do update there, I'll try to reform the implementation in next version. Regards, Michael Wang >