Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3425866ybh; Mon, 5 Aug 2019 18:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdOfE2VmmPg84cLgPVcIu6aaPrYGZ26lH2mnUUeWYPVW/LixrW92U9b7/u8hwPYgfF8srr X-Received: by 2002:a17:902:694a:: with SMTP id k10mr589675plt.255.1565055359338; Mon, 05 Aug 2019 18:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565055359; cv=none; d=google.com; s=arc-20160816; b=0XmnenFjbXi1wR9W/MNkm10yz6P/Zz/R8Hsf0pnmkvHJzgQfbkKmCKEGTlw1vjauy4 z4LQrfE7Rdzmf0H4U+DCcOExidzz/f7MGTmBqSC60aW7uKiP1zCkd1k4RR/7HncmXhXT f8HbOJ/Iqi7wwOBgqKpyHdj0WziUlKTxsLWpZh/ltSpc539CE+lGhihVnx9xM5i8/0AB 2PsYT5zPa0rECUFY90R24Zg6LKI6p/i6oYPgPXR2KksPZ3G4DTSOH4yoEM6/9oVeu9BA lsMBwC/LEAoUVbPD3XZ7vCt3d/DWLgey8suwrVZ8E3tG1v3BsUt3Nehtg0UWhFUb9EbI iJ2g== 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:references:cc:to:from:subject; bh=Jgunc0VzKPPT337tIgA99pIQxve5Qfra/3N36KHQ8iw=; b=QQxrcKSmZhUF94LR5vGHAU2nC5vtC6U3AZbXyGh5b776/QWt2iQHjziLVpGq9yDDDY XgXZbMUS460QlZXiGpFYf8eUVfzxCwMC/ww/bTFDiuFDJLYn9i2tVu4/XeGgW01BToYg V6Qm/GtTRN5sSz9zaHdFUvw/jokbeEhP8G68eE6X5e5GbMQtHGIIpWQLWMBcK1NdJbUy 2hRVbHm5vvVTTI4di8wPpNrKA+8ZQ5ZthBuCVOJElZt7mI0V6MvcXA6LHlSbR7PoFHzw Fforfuf7taNpn2bYAsp/iSpHOg/yDFJ+w7szWsY6qCvQo07bj+zt1YSptnlG1/w0bKhK Hoyw== 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 m32si43013723pld.236.2019.08.05.18.35.43; Mon, 05 Aug 2019 18:35:59 -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 S1731359AbfHFBdp (ORCPT + 99 others); Mon, 5 Aug 2019 21:33:45 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:51505 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728870AbfHFBdp (ORCPT ); Mon, 5 Aug 2019 21:33:45 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0TYmOEx4_1565055217; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TYmOEx4_1565055217) by smtp.aliyun-inc.com(127.0.0.1); Tue, 06 Aug 2019 09:33:40 +0800 Subject: Re: [PATCH v2 0/4] per-cgroup numa suite From: =?UTF-8?B?546L6LSH?= To: Peter Zijlstra , hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, mcgrof@kernel.org, keescook@chromium.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, =?UTF-8?Q?Michal_Koutn=c3=bd?= , Hillf Danton References: <209d247e-c1b2-3235-2722-dd7c1f896483@linux.alibaba.com> <60b59306-5e36-e587-9145-e90657daec41@linux.alibaba.com> <65c1987f-bcce-2165-8c30-cf8cf3454591@linux.alibaba.com> Message-ID: <789b95a2-6a92-eb30-85c5-af8e5dcc8048@linux.alibaba.com> Date: Tue, 6 Aug 2019 09:33:37 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <65c1987f-bcce-2165-8c30-cf8cf3454591@linux.alibaba.com> 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, Folks Please feel free to comment if you got any concerns :-) Hi, Peter How do you think about this version? Please let us know if it's still not good enough to be accepted :-) Regards, Michael Wang On 2019/7/16 上午11:38, ηŽ‹θ΄‡ wrote: > During our torturing on numa stuff, we found problems like: > > * missing per-cgroup information about the per-node execution status > * missing per-cgroup information about the numa locality > > That is when we have a cpu cgroup running with bunch of tasks, no good > way to tell how it's tasks are dealing with numa. > > The first two patches are trying to complete the missing pieces, but > more problems appeared after monitoring these status: > > * tasks not always running on the preferred numa node > * tasks from same cgroup running on different nodes > > The task numa group handler will always check if tasks are sharing pages > and try to pack them into a single numa group, so they will have chance to > settle down on the same node, but this failed in some cases: > > * workloads share page caches rather than share mappings > * workloads got too many wakeup across nodes > > Since page caches are not traced by numa balancing, there are no way to > realize such kind of relationship, and when there are too many wakeup, > task will be drag from the preferred node and then migrate back by numa > balancing, repeatedly. > > Here the third patch try to address the first issue, we could now give hint > to kernel about the relationship of tasks, and pack them into single numa > group. > > And the forth patch introduced numa cling, which try to address the wakup > issue, now we try to make task stay on the preferred node on wakeup in fast > path, in order to address the unbalancing risk, we monitoring the numa > migration failure ratio, and pause numa cling when it reach the specified > degree. > > Since v1: > * move statistics from memory cgroup into cpu group > * statistics now accounting in hierarchical way > * locality now accounted into 8 regions equally > * numa cling no longer override select_idle_sibling, instead we > prevent numa swap migration with tasks cling to dst-node, also > prevent wake affine to drag tasks away which already cling to > prev-cpu > * other refine on comments and names > > Michael Wang (4): > v2 numa: introduce per-cgroup numa balancing locality statistic > v2 numa: append per-node execution time in cpu.numa_stat > v2 numa: introduce numa group per task group > v4 numa: introduce numa cling feature > > include/linux/sched.h | 8 +- > include/linux/sched/sysctl.h | 3 + > kernel/sched/core.c | 85 ++++++++ > kernel/sched/debug.c | 7 + > kernel/sched/fair.c | 510 ++++++++++++++++++++++++++++++++++++++++++- > kernel/sched/sched.h | 41 ++++ > kernel/sysctl.c | 9 + > 7 files changed, 651 insertions(+), 12 deletions(-) >