Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp570708ybi; Fri, 12 Jul 2019 00:58:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwd23ol61NxCnepxVxtawS+rlrznOXnf/fnUk5oz6hHGpO8MsgBbVTnvSGiGnXiU5UvU+RD X-Received: by 2002:a17:90a:374a:: with SMTP id u68mr10045404pjb.4.1562918339068; Fri, 12 Jul 2019 00:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562918339; cv=none; d=google.com; s=arc-20160816; b=IeCmkfLc0F1UAmUZTVbNoWWzMlTTD2Jh159SOVOXfMpEnNpcgPDNYt45MSFhVKJiSV j6x6DsNmXaPH9fUZhRQMkXl3LWAoBe25tKBOf6xeqjOtCt6ymdDc+P9/6WJqyIbeThCF La8biOe3OgRpfwadbeQwV4OzF7iS1lQE5+9bd1HEBCeS1AC9g1cse+XfyDISczQYvh5z lS2ASXvFpW7Lme5w7XYP2joj9yFXHKVZ+iygBVKEfE/hbXrzP6ReakCLopSokDz1Eiw0 odkDWFiv0rQO+bR7wgPLGipUagHU5WeGMC5D5yvHEjIIFNOZRBHViFNXmvq6ojZ+AWL7 Fa6Q== 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=LtqSlKZWetZ9uGFV2K19vEGagHhsXV8pg3vWp1m725Y=; b=FjyuMd8ezeHbAce3DVuCDG2b/eKnuUKg8MRAxoNbBTCMQeFMipxNrRf4GpupmBQLpk he5wWHIxUwcyUp8sJcAvLV1OCDOsZl/6BKcY64g22hl+F77YZ9UFeIGzF/ICJNtVVzP6 9mN9lcB38ogCsD8cHBCGZleQfFIXRZGh5gU6UraHI51FIlWucS55mdCLa+Og1bg0d2IS OnyDP0pxagBzq+M2PByBD10BAzrBhV+4YG7VKoNlk517BjJ6id5CAnYq8dsRruZkmAIt +pkArxwJefdtU7RV65mYfQtnmZXh3rh9z6WvnE9CkGepbJHHOkW2jHUz1xfORjZZN3EG T/QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="V/iJunfl"; 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 h65si7544372pfb.18.2019.07.12.00.58.42; Fri, 12 Jul 2019 00:58: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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="V/iJunfl"; 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 S1726225AbfGLH6X (ORCPT + 99 others); Fri, 12 Jul 2019 03:58:23 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfGLH6X (ORCPT ); Fri, 12 Jul 2019 03:58:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=LtqSlKZWetZ9uGFV2K19vEGagHhsXV8pg3vWp1m725Y=; b=V/iJunfl8ealcixJfAjaVt7Vrd tQUwwlpOMrfElHa7L5+1G8ivCqLA+QLKj++7et5n8GxiXViFsXqzO+QKB50yOVHqQJqPj63zR7Mz/ oni9H7rrI0E/MaIPnNyX2MvDdFRFA0l6aIhPXeI0fJroCJs0BvecfAMR6kPmcfRvkfXcoZAJqZv39 WH7yKi2rPXVO0Ik5pkgDA4sGvIwc9mD+A2jkIDR21O9JacqiJHxs/qgg/VPYPQB10dOMf4lUH9bDx wAmbgeQC11Xxo56c1HakyQocSdLZdhESnCzqS4A3/c4YMXSo8zEBk+A9qp7YhvUXI29jz1M9lnF0l WR3RRI3g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hlqRd-000690-Dz; Fri, 12 Jul 2019 07:58:17 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A84E320120CB1; Fri, 12 Jul 2019 09:58:15 +0200 (CEST) Date: Fri, 12 Jul 2019 09:58:15 +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, mcgrof@kernel.org, keescook@chromium.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Mel Gorman , riel@surriel.com Subject: Re: [PATCH 1/4] numa: introduce per-cgroup numa balancing locality, statistic Message-ID: <20190712075815.GN3402@hirez.programming.kicks-ass.net> References: <209d247e-c1b2-3235-2722-dd7c1f896483@linux.alibaba.com> <60b59306-5e36-e587-9145-e90657daec41@linux.alibaba.com> <3ac9b43a-cc80-01be-0079-df008a71ce4b@linux.alibaba.com> <20190711134754.GD3402@hirez.programming.kicks-ass.net> 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 Fri, Jul 12, 2019 at 11:43:17AM +0800, ηŽ‹θ΄‡ wrote: > > > On 2019/7/11 δΈ‹εˆ9:47, Peter Zijlstra wrote: > [snip] > >> + rcu_read_lock(); > >> + memcg = mem_cgroup_from_task(p); > >> + if (idx != -1) > >> + this_cpu_inc(memcg->stat_numa->locality[idx]); > > > > I thought cgroups were supposed to be hierarchical. That is, if we have: > > > > R > > / \ > > A > > /\ > > B > > \ > > t1 > > > > Then our task t1 should be accounted to B (as you do), but also to A and > > R. > > I get the point but not quite sure about this... > > Not like pages there are no hierarchical limitation on locality, also tasks You can use cpusets to affect that. > running in a particular group have no influence to others, not to mention the > extra overhead, does it really meaningful to account the stuff hierarchically? AFAIU it's a requirement of cgroups to be hierarchical. All our other cgroup accounting is like that.