Received: by 10.192.165.148 with SMTP id m20csp1216337imm; Wed, 2 May 2018 16:42:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrDUHBpOB0mgPWZS54t7m5NtB61Yid/2hJllEPTdNwDuY3yBrIaXtP2w8mN2OBlWCz6qlSS X-Received: by 2002:a17:902:5952:: with SMTP id e18-v6mr22004986plj.351.1525304548578; Wed, 02 May 2018 16:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525304548; cv=none; d=google.com; s=arc-20160816; b=p0ne8tqXGK4aH861EVP8iKhmaZUuLFUvc0iht2NanNbbx5uRAZLf3jBSA81rkh9EPA YCbCJKX8Nfx9SSxkpcJVbof1VRlctNaP6YM5f8L0Ht4BdElJxZlAcZCgWnKlc+oEe7z5 OqhzH3R3k79vC71Od4ZSsc4IcYJdnV4/YlHkNfcHr+uUw/iOxF1TxqIgQDREdQrEAKn+ 1j6e1xYmNCTSVuc0/uLsn+7mrnNCZjwCu8xTxzVmibYnFGilRdOubrRX1KUNBcWBg8X9 1hjfiZ/bJVLs1a2DYbCG239W0cAjp2IhJUxqDoYoDgzHkkF0cSvTi1L+hPv17HGI3EsK C/NQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:to:references :subject:reply-to:dkim-signature:arc-authentication-results; bh=sRenPWm+F62miRVK/a3fFERpZ7cqgvt02pHSBbqYnH4=; b=e5/SiNagFhl9SKiwt6j/DqrEFY0BIzRJ80FWIIRZejwjrUH2Ywj2U0TfJbSTrh3osL Yfc/z/JjHXKpVlE0F046x881Dqnz6P+Ye8vYoLaAPT5ujpajME8ZaG7LP/pwSydvG46K zoo1mp2g4Lv3b9ohOn+38BqFuwAz8NB1P5fHWCbHUf06s6SDMrUnRGTpycsYQ8h/IFUq i27BvWhFywaeiafjLot2Kuw3XjjyUdeNEb3QpT7xe+cjeOKqOFOU348N6BX2MfT/dxIt /3WaazdcDriGu/SWc7cTN449Vnn/4oZMwe/4XBnav51hIe08xSS09I4zpx7e7lu8jNhl DBUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TuXEvQqu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si10454541pgu.612.2018.05.02.16.42.14; Wed, 02 May 2018 16:42:28 -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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TuXEvQqu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbeEBXmE (ORCPT + 99 others); Wed, 2 May 2018 19:42:04 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:52488 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbeEBXmC (ORCPT ); Wed, 2 May 2018 19:42:02 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w42Nf36q132163; Wed, 2 May 2018 23:41:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=reply-to : subject : references : to : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=sRenPWm+F62miRVK/a3fFERpZ7cqgvt02pHSBbqYnH4=; b=TuXEvQqufDzN0J0qk+r9QpnOASmhMvQ7h3Ev/dCWbiPPnKy9+VzZUOKMHCM92MtzwNZU GT94JIQISxCvqdoCa/SGIuitW1QhjEPyTClHdXUuFjPWfF6rWXe/kADK9eZqGsUZx787 jtFgDokCsNEURFcSH8Plbn2Zks6Guakek9zbuOQHuL3GJX+WTI0o/l9E+D76JjW7F603 XUz8TSeBGTKFfoTlVkMj7Z8XeTk/ixg2NP1Tvwm4GmhPxoQndj1Hut9rjehlac66k1ri RLwt5Jg1qrUXLHwKXHOE8CJmF/XQ5uG6assXYaCargzlCys+ecXv/TNHON0ukQbRlja2 Lw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2hmgxfyc7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 May 2018 23:41:48 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w42Nfllh025671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 May 2018 23:41:48 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w42NfkeR029253; Wed, 2 May 2018 23:41:46 GMT Received: from [10.132.92.130] (/10.132.92.130) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 May 2018 16:41:46 -0700 Reply-To: prakash.sangappa@oracle.com Subject: Re: [RFC PATCH] Add /proc//numa_vamaps for numa node information References: <1525240686-13335-1-git-send-email-prakash.sangappa@oracle.com> <20180502143323.1c723ccb509c3497050a2e0a@linux-foundation.org> To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, mhocko@suse.com, kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com, drepper@gmail.com, rientjes@google.com, Naoya Horiguchi , Dave Hansen From: "prakash.sangappa" Message-ID: Date: Wed, 2 May 2018 16:43:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20180502143323.1c723ccb509c3497050a2e0a@linux-foundation.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8881 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805020198 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/2018 02:33 PM, Andrew Morton wrote: > On Tue, 1 May 2018 22:58:06 -0700 Prakash Sangappa wrote: > >> For analysis purpose it is useful to have numa node information >> corresponding mapped address ranges of the process. Currently >> /proc//numa_maps provides list of numa nodes from where pages are >> allocated per VMA of the process. This is not useful if an user needs to >> determine which numa node the mapped pages are allocated from for a >> particular address range. It would have helped if the numa node information >> presented in /proc//numa_maps was broken down by VA ranges showing the >> exact numa node from where the pages have been allocated. >> >> The format of /proc//numa_maps file content is dependent on >> /proc//maps file content as mentioned in the manpage. i.e one line >> entry for every VMA corresponding to entries in /proc//maps file. >> Therefore changing the output of /proc//numa_maps may not be possible. >> >> Hence, this patch proposes adding file /proc//numa_vamaps which will >> provide proper break down of VA ranges by numa node id from where the mapped >> pages are allocated. For Address ranges not having any pages mapped, a '-' >> is printed instead of numa node id. In addition, this file will include most >> of the other information currently presented in /proc//numa_maps. The >> additional information included is for convenience. If this is not >> preferred, the patch could be modified to just provide VA range to numa node >> information as the rest of the information is already available thru >> /proc//numa_maps file. >> >> Since the VA range to numa node information does not include page's PFN, >> reading this file will not be restricted(i.e requiring CAP_SYS_ADMIN). >> >> Here is the snippet from the new file content showing the format. >> >> 00400000-00401000 N0=1 kernelpagesize_kB=4 mapped=1 file=/tmp/hmap2 >> 00600000-00601000 N0=1 kernelpagesize_kB=4 anon=1 dirty=1 file=/tmp/hmap2 >> 00601000-00602000 N0=1 kernelpagesize_kB=4 anon=1 dirty=1 file=/tmp/hmap2 >> 7f0215600000-7f0215800000 N0=1 kernelpagesize_kB=2048 dirty=1 file=/mnt/f1 >> 7f0215800000-7f0215c00000 - file=/mnt/f1 >> 7f0215c00000-7f0215e00000 N0=1 kernelpagesize_kB=2048 dirty=1 file=/mnt/f1 >> 7f0215e00000-7f0216200000 - file=/mnt/f1 >> .. >> 7f0217ecb000-7f0217f20000 N0=85 kernelpagesize_kB=4 mapped=85 mapmax=51 >> file=/usr/lib64/libc-2.17.so >> 7f0217f20000-7f0217f30000 - file=/usr/lib64/libc-2.17.so >> 7f0217f30000-7f0217f90000 N0=96 kernelpagesize_kB=4 mapped=96 mapmax=51 >> file=/usr/lib64/libc-2.17.so >> 7f0217f90000-7f0217fb0000 - file=/usr/lib64/libc-2.17.so >> .. >> >> The 'pmap' command can be enhanced to include an option to show numa node >> information which it can read from this new proc file. This will be a >> follow on proposal. > I'd like to hear rather more about the use-cases for this new > interface. Why do people need it, what is the end-user benefit, etc? This is mainly for debugging / performance analysis. Oracle Database team is looking to use this information. >> There have been couple of previous patch proposals to provide numa node >> information based on pfn or physical address. They seem to have not made >> progress. Also it would appear reading numa node information based on PFN >> or physical address will require privileges(CAP_SYS_ADMIN) similar to >> reading PFN info from /proc//pagemap. >> >> See >> https://marc.info/?t=139630938200001&r=1&w=2 >> >> https://marc.info/?t=139718724400001&r=1&w=2 > OK, let's hope that these people will be able to provide their review, > feedback, testing, etc. You missed a couple (Dave, Naoya). > >> fs/proc/base.c | 2 + >> fs/proc/internal.h | 3 + >> fs/proc/task_mmu.c | 299 ++++++++++++++++++++++++++++++++++++++++++++++++++++- > Some Documentation/ updates seem appropriate. I suggest you grep the > directory for "numa_maps" to find suitable locations. Sure, I can update Documentation/filesystems/proc.txt file which is where 'numa_maps' is documented. > > And a quick build check shows that `size fs/proc/task_mmu.o' gets quite > a bit larger when CONFIG_SMP=n and CONFIG_NUMA=n. That seems wrong - > please see if you can eliminate the bloat from systems which don't need > this feature. > > Ok will take a look.