Received: by 10.192.165.148 with SMTP id m20csp93365imm; Thu, 3 May 2018 15:36:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoJEfO9Xg5Q6YV+bpGr5ymUkQpNdWY9mi/EGjc4nmjbVJa3JtSmSxND6y+3lHh8GFiDFXI6 X-Received: by 2002:a17:902:a586:: with SMTP id az6-v6mr25689964plb.210.1525386979968; Thu, 03 May 2018 15:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525386979; cv=none; d=google.com; s=arc-20160816; b=MADWvPkyNd5eZWkNCDm2sWCXsXAMwSWF5ZYBQe5OikcaqldRconrEgGrGZF0qaR6EE LFtMGZ3LdrkZap8fqvwrG40QH/cHYb1NsjU1M42IYQvsVqPu7AAbSYHMlzqxCo9AiaEH 1EofUXRK2Z/9joyMS9NO5PC7/XgM3y+Vm6XmtzFtp4RgLIyLNaDka4vTCc5iRNuv9u20 PQbfOS1WQPS/UrMO0HtAyS21E1Ea+ua9Et3mVSecku1V+fC9mSLKfvKstQ+ydeqAv1+i EJTZ7wgOF/NibuataJprmfGLA+ueYz8tp5MlAETfguEW+2ZYNcaEEyPvpgNgJtFafvdz kD7Q== 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=flMSBPpiZ7q/JRBbrLOpq5ixrag5DKr5m0o3G9qsrvI=; b=XN4ED9r29vd0HhQxTTBedN3C8OkDniPSgH4PBzHMYrIiJet0odZNOEd3aeEt2tHDct NDPY0pjFv3IKJzNnmi68DJNT9YWc+PzCZwNUaX6xyA/SumoVBYvK0YAXFa9tM/1y3ir7 VvT1KOcbRQJd8p5BCjLY4hGBvcDUi9lLSlFN/1wXxP8+zKPVYF9M3cESxId/RNMx8xHI ZVGOMbFDKMtEhCOZxVX9ri872pC0I+b+pBrQM9AkVHxwaN3Gclmh6JdBDJSujc916P2S EQFsT5tYWxOxblrBBp9OEwY1lFrJbYYsbZlS+KXsGwugKKTh8/jjH2swkM6qyappLJL/ 69Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=obIXE7W4; 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 q12-v6si14363151pli.419.2018.05.03.15.36.05; Thu, 03 May 2018 15:36:19 -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=obIXE7W4; 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 S1751239AbeECWfl (ORCPT + 99 others); Thu, 3 May 2018 18:35:41 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:36760 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbeECWfj (ORCPT ); Thu, 3 May 2018 18:35:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w43MQEO8017682; Thu, 3 May 2018 22:35:28 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=flMSBPpiZ7q/JRBbrLOpq5ixrag5DKr5m0o3G9qsrvI=; b=obIXE7W4Mcp794PlTZMbOgKslzBocFqyAoLg4w4LEPO0bT5g+l6wh0VxAmoyy5yPdmUI EBupbTHRsqf+XK7ZNhc68MPjiz/IhbfuUgzbT8NjX3YCrrFHJbL/2yQmmP7j7jzWnKNs 3cf7PsGnKmxoipUb/4lHE+qOwnN7fcdAGaoZZPgPlpW0aMgu7ZMtOP7KZfK9PWHu/CeA aZ+h0wV1Y3z0HNvX9O8Qf+fuBLRBxyA3CleVIq+V1Wa/8Mi/5ycNcVgrCMEkf7Avnqsw wyCQg9Y/0CTFdDY7R6kqP+7jhDkltQD3gb3E/hF4zlSw0slBQalcy8t7gcpojL+ncF7m 1Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2hmhmfus6e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 03 May 2018 22:35:27 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w43MZR8t017131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 May 2018 22:35:27 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w43MZQZ1031211; Thu, 3 May 2018 22:35:26 GMT Received: from [10.132.92.130] (/10.132.92.130) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 May 2018 15:35:26 -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> <20180503085741.GD4535@dhcp22.suse.cz> To: Michal Hocko Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, 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: <40be68bb-8322-2bef-f454-22e1ab9029da@oracle.com> Date: Thu, 3 May 2018 15:37:39 -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: <20180503085741.GD4535@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8882 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1805030195 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/03/2018 01:57 AM, Michal Hocko wrote: > On Wed 02-05-18 16:43:58, prakash.sangappa wrote: >> >> 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. > But we do have an interface to query (e.g. move_pages) that your > application can use. I am really worried that the broken out per node > data can be really large (just take a large vma with interleaved policy > as an example). So is this really worth adding as a general purpose proc > interface? I guess move_pages could be useful. There needs to be a tool or command which can read the numa node information using move_pages to be used to observe another process. From an observability point of view, one of the use of the proposed new file 'numa_vamaps' was to modify 'pmap' command to display numa node information broken down by address ranges. Would having pmap show numa node information be useful?