Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp56919imm; Thu, 13 Sep 2018 15:37:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY1VpVzy2F2VHTac4iLKBb540RBNz0ENP2hELutR8ZB+Mbs/miSX8umQXlDZxTawq5Am0Z6 X-Received: by 2002:a63:1921:: with SMTP id z33-v6mr9123900pgl.302.1536878258029; Thu, 13 Sep 2018 15:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536878258; cv=none; d=google.com; s=arc-20160816; b=FrFocPLgPqCZMwm2ywJBS65vqJIvF59bbLW4WeJCSIlTe2XpTd5t68XfQMYXB5t2dk oflpsWTHqWmcjOaQ3aLqwqWCUo3QbKbnL+A76+VRdcfOm910jNScjnP7P4DnzPe+ig89 RanFGr4vt0dI6Fc9+4J0q9UALo/pObALF6vx0dnJ2qSsn5Pd2xt5AkUNC0NA7XZs3RSN jNcQHV3jjXFqApTsEbDHu1ZWEBw2BEgGlo6/0IV282/8ORXsyepMduWsl8uWZUi3maNx CupAeStXKA0l2XJSTkHICYlsoRlAIxpgorZHb6lmJQD+gAQtbQcgfXQu6MEzZQb+RmZA Ftwg== 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; bh=kUHhMLrexydgspIrCsIZbD9E1DzJgge6Gm0siA7CP+A=; b=Ysl1NywRYka56rKyyXJdukUWAlirE5pXSbpMSVx2O8dEREpB/XNANI7dQGjlgYwh+Y y34Yj03B0Pqt1VAJaH00sQDOeCKEAcLBEYJKKUqdkSYoy6lnyhftRwSYp30JWwhYfEsJ OUacge0/nJ3po+QcYa9sRGzxiZ7dsvl3qRv78lotfphCu8jmR8y2K9T9iZd8Dw0J+SWa to17B8as7J28ePLKJeVVsLJv83iJi6VkMghjDyUdp8yYXb33EFqC8aDlug9HjYqasDY5 ZvGJOluNxAea6AIPoexbxXiL01m5V7Up8n+GKLXfvZjflbXAx8GXGxJBlHlU8WpDyNT3 XBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="a1/L/Miw"; 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 s13-v6si5039429pgo.505.2018.09.13.15.37.21; Thu, 13 Sep 2018 15:37:37 -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-2018-07-02 header.b="a1/L/Miw"; 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 S1728305AbeINDor (ORCPT + 99 others); Thu, 13 Sep 2018 23:44:47 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45286 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727988AbeINDor (ORCPT ); Thu, 13 Sep 2018 23:44:47 -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 w8DMTqY5102328; Thu, 13 Sep 2018 22:33:11 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-2018-07-02; bh=kUHhMLrexydgspIrCsIZbD9E1DzJgge6Gm0siA7CP+A=; b=a1/L/MiwMnD7/eacNglAT5G7rNPsYHhman5+OvqbU/AB9qPglG4DF2hAbH2Db8qrfGH0 ieZekF4UxE/3bvn2GX00u0Jw7NsoJHjVomurKgvSkgOxRLi9ivQ1Gn38W0m34EGVDQwY Qu/r5Wp1jbeNAFMG1IpLnx9H4naOw6QrSFHVqUaAh215MgQYuOUyXhtVMcn8DlutlUEn 0anQzXxfL7t0pbPrkFEMLw4//sCKGOXChc7lTpbMxbQYs7UaGY1Wqi+tJPaCCqpiiAzb RBlyC0yKre9f7TrM4vc/QUU2NCHe9cGrZOCxsJZpteFXUjkKAoIQTRjFW8XkLxTK6aGQ iQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2mc72r3yqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 22:33:11 +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 w8DMXAmY031889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 22:33:10 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8DMX8fl008158; Thu, 13 Sep 2018 22:33:08 GMT Received: from [10.132.93.61] (/10.132.93.61) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Sep 2018 15:33:08 -0700 Reply-To: prakash.sangappa@oracle.com Subject: Re: [PATCH V2 0/6] VA to numa node information References: <1536783844-4145-1-git-send-email-prakash.sangappa@oracle.com> <20180913084011.GC20287@dhcp22.suse.cz> To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@intel.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, khandual@linux.vnet.ibm.com, steven.sistare@oracle.com From: "prakash.sangappa" Message-ID: <375951d0-f103-dec3-34d8-bbeb2f45f666@oracle.com> Date: Thu, 13 Sep 2018 15:32:25 -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: <20180913084011.GC20287@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=9015 signatures=668708 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-1807170000 definitions=main-1809130222 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2018 01:40 AM, Michal Hocko wrote: > On Wed 12-09-18 13:23:58, Prakash Sangappa wrote: >> For analysis purpose it is useful to have numa node information >> corresponding mapped virtual address ranges of a process. Currently, >> the file /proc//numa_maps provides list of numa nodes from where pages >> are allocated per VMA of a 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. >> >> This patch set introduces the 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. >> >> Includes support to lseek, allowing seeking to a specific process Virtual >> address(VA) starting from where the address range to numa node information >> can to be read from this file. >> >> The new file /proc//numa_vamaps will be governed by ptrace access >> mode PTRACE_MODE_READ_REALCREDS. >> >> See following for previous discussion about this proposal >> >> https://marc.info/?t=152524073400001&r=1&w=2 > It would be really great to give a short summary of the previous > discussion. E.g. why do we need a proc interface in the first place when > we already have an API to query for the information you are proposing to > export [1] > > [1] http://lkml.kernel.org/r/20180503085741.GD4535@dhcp22.suse.cz The proc interface provides an efficient way to export address range to numa node id mapping information compared to using the API. For example, for sparsely populated mappings, if a VMA has large portions not have any physical pages mapped, the page walk done thru the /proc file interface can skip over non existent PMDs / ptes. Whereas using the API the application would have to scan the entire VMA in page size units. Also, VMAs having THP pages can have a mix of 4k pages and hugepages. The page walks would be efficient in scanning and determining if it is a THP huge page and step over it. Whereas using the API, the application would not know what page size mapping is used for a given VA and so would have to again scan the VMA in units of 4k page size. If this sounds reasonable, I can add it to the commit / patch description. -Prakash.