Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp404750ybi; Thu, 11 Jul 2019 21:49:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq/w7Y+WxVOatiB/6qK8tki9X9monQ4jjZ0QjuaoFsODXQj5337NyF1c41IPSJTgNIyCtY X-Received: by 2002:a17:90a:2446:: with SMTP id h64mr9658450pje.0.1562906991999; Thu, 11 Jul 2019 21:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562906991; cv=none; d=google.com; s=arc-20160816; b=GiyZk+Rwj62A/zKuO8pJuLpUwl37Qu6iSjcWicDyf3ShLQ605RTYXD79GaLDSwwJle xMj5PhnS/sc4VIBDHECxc1M2QUkFEEPYBE0c458czg/u7WW1SpZdnbp3ni2NskSVXuCH TOpjhQJiZenWouEtYkWPCICZuPY8hWwyHbBofW3m5tILO2lYwZstm50XjI+PmrwTSjuO syzCUdUQT39q4OVc5xKDwYGcb3c4Q+0Og+auiU473FvhtXpPyOkpD7+si4a0e0qmypqp ijjtuxj0RBCfhbeGoMa9vI0rzF3UVNJB/LZO7PBuZlMQLRXWRFP3vPGol++O1Xn2O4yL HrRg== 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=iCtnrK+bGTr4rq4X2juOQQxAl0Jsp90zb3U2SYf2if4=; b=yuWaXFYG8+KvJG+T3ptwtXQd2iTNnHRMhQzwknhtVfWhZYKTgFxMe1i/1v7rR97Ii9 GeAsuZU5cmtuoW47TEIfMZM/ek5bg66QQC9YVkLv5a4ZnAHwV8PzDRJiF7jEc1u9Bejd TxZF2+ffhVIdmodfziO4sXOLFvwN1TbWildgk1xAcXauBa7+XYgALtDfrhZiWdoGXvNh mRi/w88wP8vsblIwOav5WbsNqrCRVFfYeZLYveCBCgmVC5D5VxhJgrwpFl4slU3UUvvm XgUQ2baIpAtJRGerwE06JVKl4gaaoOjeP4N+eI4IuyyFWTUml/RfI9d5fO88gJkvQ/+L OETQ== 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 o2si7636594pfg.136.2019.07.11.21.49.35; Thu, 11 Jul 2019 21:49:51 -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 S1726494AbfGLED3 (ORCPT + 99 others); Fri, 12 Jul 2019 00:03:29 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:46834 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbfGLED3 (ORCPT ); Fri, 12 Jul 2019 00:03:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0TWfcT1L_1562904203; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TWfcT1L_1562904203) by smtp.aliyun-inc.com(127.0.0.1); Fri, 12 Jul 2019 12:03:24 +0800 Subject: Re: [PATCH 3/4] numa: introduce numa group per task group To: Peter Zijlstra Cc: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, Ingo Molnar , linux-kernel@vger.kernel.org, linux-mm@kvack.org, mcgrof@kernel.org, keescook@chromium.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Mel Gorman , riel@surriel.com References: <209d247e-c1b2-3235-2722-dd7c1f896483@linux.alibaba.com> <60b59306-5e36-e587-9145-e90657daec41@linux.alibaba.com> <93cf9333-2f9a-ca1e-a4a6-54fc388d1673@linux.alibaba.com> <20190711141038.GE3402@hirez.programming.kicks-ass.net> From: =?UTF-8?B?546L6LSH?= Message-ID: <50a5ae9e-6dbd-51b6-a374-1b0e45588abf@linux.alibaba.com> Date: Fri, 12 Jul 2019 12:03:23 +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: <20190711141038.GE3402@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/7/11 δΈ‹εˆ10:10, Peter Zijlstra wrote: > On Wed, Jul 03, 2019 at 11:32:32AM +0800, ηŽ‹θ΄‡ wrote: >> By tracing numa page faults, we recognize tasks sharing the same page, >> and try pack them together into a single numa group. >> >> However when two task share lot's of cache pages while not much >> anonymous pages, since numa balancing do not tracing cache page, they >> have no chance to join into the same group. >> >> While tracing cache page cost too much, we could use some hints from > > I forgot; where again do we skip shared pages? task_numa_work() doesn't > seem to skip file vmas. That's the page cache generated by file read/write, rather than the pages for file mapping, pages of memory to support IO also won't be considered as shared between tasks since they don't belong to any particular task, but may serving multiples. > >> userland and cpu cgroup could be a good one. >> >> This patch introduced new entry 'numa_group' for cpu cgroup, by echo >> non-zero into the entry, we can now force all the tasks of this cgroup >> to join the same numa group serving for task group. >> >> In this way tasks are more likely to settle down on the same node, to >> share closer cpu cache and gain benefit from NUMA on both file/anonymous >> pages. >> >> Besides, when multiple cgroup enabled numa group, they will be able to >> exchange task location by utilizing numa migration, in this way they >> could achieve single node settle down without breaking load balance. > > I dislike cgroup only interfaces; it there really nothing else we could > use for this? Me too... while at this moment that's the best approach we have got, we also tried to use separately module to handle these automatically, but this need a very good understanding of the system, configuration and workloads which only known by the owner. So maybe just providing the functionality and leave the choice to user is not that bad? Regards, Michael Wang >