Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7456706ybc; Thu, 28 Nov 2019 17:54:36 -0800 (PST) X-Google-Smtp-Source: APXvYqx0t2oD4hC+bWYQrCiICWOo59r/EHl0A7Ms8rceaCC0WyYbpl9OmLjLEvECa2mNSPL72kO0 X-Received: by 2002:a50:ef17:: with SMTP id m23mr41618632eds.81.1574992475978; Thu, 28 Nov 2019 17:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574992475; cv=none; d=google.com; s=arc-20160816; b=xYfdx0f9laDmkKNJW7MMqqK+z+X+nWA9YcT7LhmTpkcj/UloTLooOJB9KFJXEbrF0Q Z83ryPNA47MMNsmfad3AfQ4z0kaaVAcjVPurfrXj1bMe9aQSvTSBj74OR6aVAWZOx7Lv iU2D2iQbP/D7P0IrTIRPolAasCjB81WfW99OszzosSy4oHgO4DP1sw47pja4njib6AJe rb4Ipm/c1p+br0hnzn1I0EE2uNn1aGvJLgDKIHpLYkmvLLgdcU7FF2MG4VDbyaPsi/gI r+QBk5DUmalX5x6GH/ovtpT+9tHIEXeP4wXaPEQAq5cSlvEnjSdROV1nEGu355WqBv8Q BLaQ== 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=aw1h6ksfuOXhywiKfrqg5/vof384yuOiNViY7d5+ZE0=; b=sIsQ2q2svykR61FdoRdluOMu9Z78iOiEeOSwBgjUsVAZS3/aHH5LTQxl2NNBXX+4lk AAsinv1EtMNypbHGNoCATCyzyawaM2Uzee8uwd17admtTpSR2Op76hhh5YzTf5J1NAFu lEnCKn+b5LGZHF6sQM1PeR9GtawBUPvrQWdDGEkZBsco4fxU5L62G4BVhcLbE2dvox06 OVPy3YdvIfCt6t0DWcZbPnak2/cFijAhiifZt7/xJFMfs9oCxvq8s12ZUyjRNQEcwhMS 2S9xesWEbM2ZXG05jVwEYydpFn0UBZexO21eRVT7g/pdPSsZF7yQohj1uF8QhDbj9wrs IbyQ== 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 p38si15246856edc.163.2019.11.28.17.54.09; Thu, 28 Nov 2019 17:54:35 -0800 (PST) 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 S1726788AbfK2BwP (ORCPT + 99 others); Thu, 28 Nov 2019 20:52:15 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:46262 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfK2BwO (ORCPT ); Thu, 28 Nov 2019 20:52:14 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R221e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0TjLLnsg_1574992327; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TjLLnsg_1574992327) by smtp.aliyun-inc.com(127.0.0.1); Fri, 29 Nov 2019 09:52:09 +0800 Subject: Re: [PATCH v2 1/3] sched/numa: advanced per-cgroup numa statistic To: =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Mel Gorman , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Luis Chamberlain , Kees Cook , Iurii Zaikin , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, "Paul E. McKenney" References: <743eecad-9556-a241-546b-c8a66339840e@linux.alibaba.com> <207ef46c-672c-27c8-2012-735bd692a6de@linux.alibaba.com> <9354ffe8-81ba-9e76-e0b3-222bc942b3fc@linux.alibaba.com> <20191127101932.GN28938@suse.de> <3ff78d18-fa29-13f3-81e5-a05537a2e344@linux.alibaba.com> <20191128123924.GD831@blackbody.suse.cz> <20191128155818.GE831@blackbody.suse.cz> From: =?UTF-8?B?546L6LSH?= Message-ID: Date: Fri, 29 Nov 2019 09:52:07 +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: <20191128155818.GE831@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 On 2019/11/28 下午11:58, Michal Koutný wrote: > On Thu, Nov 28, 2019 at 09:41:37PM +0800, 王贇 wrote: >> There are used to be a discussion on this, Peter mentioned we no longer >> expose raw ticks into userspace and micro seconds could be fine. > I don't mean the unit presented but the precision. > >> Basically we use this to calculate percentages, for which jiffy could be >> accurate enough :-) > You also report the raw times.> > Ad percentages (or raw times precision), on average, it should be fine > but can't there be any "aliasing" artifacts when only an unimportant > task is regularly sampled, hence not capturing the real pattern on the > CPU? (Again, I'm not confident I'm not missing anything that prevents > that behavior.) Hmm.. I think I get your point now, so the concern is about the missing situation between each ticks, correct? It could be, like one tick hit task A running, then A switched to B, B switched back to A before next tick, then we missing the exectime of B in next tick, since it hit A again. Actually we have the same issue for those data in /proc/stat too, don't we? The user, sys, iowait was sampled in the similar way. So if we have to pick a precision, I may still pick jiffy since the exectime is some thing similar to user/sys time IMHO. > >> But still, what if folks don't use v2... any good suggestions? > (Note this applies to exectimes not locality.) On v1, they can add up > per CPU values from cpuacct. (So it's v2 that's missing the records.) Whatabout move the whole stuff into cpuacct cgroup? I'm not sure but maybe we could use some data there to save the sample of jiffies, for those v1 user who need these statistics, they should have cpuacct enabled. > > >> Yes, since they don't have NUMA balancing to do optimization, and >> generally they are not that much. > Aha, I didn't realize that. > >> Sorry but I don't get it... at first it was 10 regions, as Peter suggested >> we pick 8, but now to insert member 'jiffies' it become 7, > See, there are various arguments for different values :-) > > I meant that the currently chosen one is imprinted into the API file. > That is IMO fixable by documenting (e.g. the number of bands may change, > assume uniform division) or making all this just a debug API. Or, see > below. > >> Yes, here what I try to highlight is the similar usage, but not the way of >> monitoring ;-) as the docs tell, we monitoring increments. > I see, the docs give me an idea what's the supposed use case. > > What about exposing only the counters for local, remote and let the user > do their monitoring based on Δlocal/(Δlocal + Δremote)? > > That would avoid the partitioning question completely, exposed values > would be simple numbers and provided information should be equal. A > drawback is that such a sampling would be slower (but sufficient for the > illustrating example). You mean the cgroup numa stat just give the accumulated local/remote access? As long as the counter won't overflow, maybe... sounds easier to explain too. So user tracing locality will then get just one percentage (calculated on their own) from a cgroup, but one should be enough to represent the situation. Sounds like a good idea to me :-) will try to do that in next version. Regards, Michael Wang > > Michal >