Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp754471ybx; Fri, 1 Nov 2019 10:40:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh8znMKxJYvSVrZVOyfAsswEzv7mZ3nOiU9cKoD61yJlX2FGWTm8/vsmeVR1O1vWRwfMVt X-Received: by 2002:aa7:c954:: with SMTP id h20mr13746000edt.159.1572630039847; Fri, 01 Nov 2019 10:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572630038; cv=none; d=google.com; s=arc-20160816; b=HFJJPVZR2ExfHNEevwrrJGDdnY5nX4zWVq9fHWU2tTbrro/jH5U19zk7mCwd2czJrA M8a/lsVH+4GlR1MiLI+UDJUMpdx+eYYn+QHlivGc5qLIh+olNspas55rDGAoVfBO7gZO /BUOKR2W4s6MnKj4h3Da7LkMiBnK1V4rp4mhdMwV46ehlNJAGgxJl+OAosWsoPClk4O7 YfhpSlvaTNf9ylFnKrlVQ33Ucs5tsg67Vso0oSXlxeMVwSsE0Z+aDIn2/cYCzTu40GgV pKEfnVHzj4aL16XCk+OhTHwNcvbJhGQWgTZiPo1A5dwSuGmlwyrloi1/xbR6t/90Ybyp 6/TQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Y/IsR49IAog1GAH0ibabIYWcyMSDAIrwosppZt/FW4g=; b=wRI0vZ1SLySbJH48lC6JNL27ONrRPquRvmkrk1g84AhnhU+1CQ0EBKG/pLqlB9ZyuA L5TFI60GeXs4bmxOvgP3BH64qzey2l1Rx9SglOkxGhg6Fl09NdhKU38bFlnpzrdkBpwR 2tTotJaK/tSTzKZcx+kyyKjkCCdk36W/yzbFD0YBppNkQhpyCfwC0gwwcmVhzu+SQ/MX qToBq7S1Fwe6DMCmnaOv9eDVIokiGON6wBfn5bB4pdapyqIfRLTbDtu3jK0Yf3oWf/iz iVqfYd+Z9B0qpmJttCm6fM4tjwbLUqj3dGQ5kGwStOsIYNeWIkzfdS2ps1NIM13XXWky fY9A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si1018719edb.19.2019.11.01.10.40.14; Fri, 01 Nov 2019 10:40:38 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727123AbfKARjk (ORCPT + 99 others); Fri, 1 Nov 2019 13:39:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:59542 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726658AbfKARjk (ORCPT ); Fri, 1 Nov 2019 13:39:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 42A70B31C; Fri, 1 Nov 2019 17:39:38 +0000 (UTC) Date: Fri, 1 Nov 2019 18:39:36 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: =?utf-8?B?546L6LSH?= Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sched/numa: advanced per-cgroup numa statistic Message-ID: <20191101173936.GB16165@blackbody.suse.cz> References: <46b0fd25-7b73-aa80-372a-9fcd025154cb@linux.alibaba.com> <682ed1d4-abf1-92f6-851f-567ff9b9a841@linux.alibaba.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CdrF4e02JqNVZeln" Content-Disposition: inline In-Reply-To: <682ed1d4-abf1-92f6-851f-567ff9b9a841@linux.alibaba.com> 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 --CdrF4e02JqNVZeln Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Yun. On Tue, Oct 29, 2019 at 03:57:20PM +0800, =E7=8E=8B=E8=B4=87 wrote: > +static void update_numa_statistics(struct cfs_rq *cfs_rq) > +{ > + int idx; > + unsigned long remote =3D current->numa_faults_locality[3]; > + unsigned long local =3D current->numa_faults_locality[4]; > + > + cfs_rq->nstat.jiffies++; This statistics effectively doubles what kernel/sched/cpuacct.c:cpuacct_charge() does (measuring per-cpu time). Hence it seems redundant. > + > + if (!remote && !local) > + return; > + > + idx =3D (NR_NL_INTERVAL - 1) * local / (remote + local); > + cfs_rq->nstat.locality[idx]++; IIUC, the mechanism numa_faults_locality values, this statistics only estimates the access locality based on NUMA balancing samples, i.e. there exists more precise source of that information. All in all, I'd concur to Mel's suggestion of external measurement. Michal --CdrF4e02JqNVZeln Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl28bdQACgkQia1+riC5 qSiRFw//R5yv0tgBXXcfvqhHwDcn/waKeDP2e/3VKcsH/TfbcFdp+4Eeg7kCP0K0 gPcTtP14kcPeErMHO71TrQLsI5BxdBY1wxgCNiy6NeEplBNGCqcMuz8y6bXC4Fng 19xxbh4OQcyvIIbbU+zYzIBHmL3I0cwznk5pgNQSde1mfThRj1AcYjvLAR/c1RIQ WfpcYJS6SGWA+VrgX1SEC4X3Fz7tDBb6cES3TFAN8+L75FCfO8qffd2xyTz73FYH cDZrqErKbb1h5RoS08cOltw9F1M9KCr6sMHxosAlvvEX97fqTUsflN/RgnRWy3Vo vqUraPlbN5XmTxDNUqN+SOuC6yfj9SvBdd2ya4BcO7tcgCF98VgdZuj2zHAWC+nf UtKgfEHXOnMKGxJs8R5l+XULVx10ul9b6EszPtp5Ipruk8haXhNhy/xM2EDHLxph bYxlzTomuvXYYCKVu8hmwXTGPRUnI5LnLBrCE37q7XcQGNyeEIy5qt/hoR0zwdJK r/kBqFC4QaL7BWjO02YH1I9EfcZGU75tnGFjGIobMb15MAt4+q2bLe1J/ptlTiUl qcJdMP0Kc3I9y1f5rbi0FAj12VbgzTTSYzPoCSfzOHFvam+sXnXLPVdEusEa3dM5 wBzqvHo5+Rn+sSAGZRXpyNN94tnGZiLM3Xm89TeyUNDIdyRBRD4= =PaRy -----END PGP SIGNATURE----- --CdrF4e02JqNVZeln--