From patchwork Wed Sep 12 20:23:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prakash Sangappa X-Patchwork-Id: 10598303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F7BC14DB for ; Wed, 12 Sep 2018 20:25:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 000C627C0B for ; Wed, 12 Sep 2018 20:25:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E882D2A7D5; Wed, 12 Sep 2018 20:25:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7957027C0B for ; Wed, 12 Sep 2018 20:25:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00E838E0001; Wed, 12 Sep 2018 16:25:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C3BEB8E0006; Wed, 12 Sep 2018 16:25:05 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD9E38E0005; Wed, 12 Sep 2018 16:25:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 794768E0006 for ; Wed, 12 Sep 2018 16:25:05 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id a70-v6so2852116qkb.16 for ; Wed, 12 Sep 2018 13:25:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=8Sry9VfOa8WI9s6H5jH3I6krWsR4HwJtnmYrg+2LmK8=; b=cXDt10C1JdoZYh4bGu+TjHoMFu6yfPgidW3rqkpDMIWc3BhJ+sjyo7g6oY0Dc6SGfp 8h5aIxlbvxqF/nwn3LcTv1dtoirDOY8yc9kciJXCOxuX0MfuvLnmKfEffnJb34QRf5Ne Np/rFJn5XY3DofaS9gmnzSXPETWyFfhv2KcOEES/cR2IfkJ0uHIgk1/cuL3QsEEAstmD yegLtqZ78Jou9WTI+vXxQdT3ly8FnLQ/GCykaid80N+CGvl0DgSN3tOILcb39cjwd9Zk 5aImoOJPD3AEkZYWw+vew2B5vxNeUIQnnTHUM0BKCZzP2bWGwG5wBYttYiQyOyi/NStt 5J0Q== X-Gm-Message-State: APzg51DOpVfSjaY2hRjxWSs+/glX8ywoNvMeYnqsNCuvZiYXeuqeB8H9 gVEFK9ZVI4UtGx9oMzodab4Kgwl0hKR1bgFp8aNA2foJ0KW+9KZO6lWHoZJZ1jxVcEAAh3UWMSl 1tR/l65UfNLbb7VMLZDlsUbZN3PtawPJh34Uqdft8jnuEHq25z+hnRLnk1d5yixeZjw== X-Received: by 2002:ac8:1b5b:: with SMTP id p27-v6mr2823089qtk.99.1536783905154; Wed, 12 Sep 2018 13:25:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZEM+CPpKXR6VvX31gWMQqDc4U3ngPNZtA0ckHnF4SrNHk9drEAT3B911beTDGF/9D0ZdJU X-Received: by 2002:ac8:1b5b:: with SMTP id p27-v6mr2823054qtk.99.1536783904204; Wed, 12 Sep 2018 13:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536783904; cv=none; d=google.com; s=arc-20160816; b=xOxCbAF+9FN8ngvgS3ZWad4dOGlBc4ewGYR7ivbkJC7Y29Mbrua3VpeYT83VG82HVN Sm5VPe/M0bI491M1iS0W0HLGAwLLGZ8SmO9uzlH/YNtK8itykPR3c1fMIA2NnD+idF4P T6lnIP+rXTc5yaT7fHt1yHdweIE+ETgDbf+uJgwLGfwCw95Zi3nXCHO2hyc68ULPx2Ck 1pX24r29eC4LObXDoaX08MQc+dl9ww5LhdiPScIvR2npE/Zs05xwFftRHn/7JRuOx+24 0HDoaqThcGOFGkbFiuUIKfFg7YFb5cdmzGwJ6Gu1uvjHPfqPghAyPEYgUO8NalUClkIb PYvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=8Sry9VfOa8WI9s6H5jH3I6krWsR4HwJtnmYrg+2LmK8=; b=y3gu4DaqfgX6xId2P+0CTNYmOKiGUlyVVtrsaPKgww3YMy5pRNk1+L118Skn0qFIq1 wEcZRaK4LzopPFzsDUBc+ODsIJja7bOyyC7Fk4pkBD8KkqgIopZhLStkLlgSpAdPjHem eWAaMcyu8BHEZDY1GsvBHY1kTS9xctQYP+1cmKo0tIECL/18CAdDVQVPVYqAf4w4+KQm DxRs5WL0X9g6YLKX8HvJbsPTmoqN5WwpILbCRAlfIOIMk58Tv+zcnDs7lPYtwORQoRAQ RgPFRBXA+Eff53ud5YRemxQSQeF6bsll2iNlkaOS64Vg8KbhbApI3hAypxgVn5PgY47f m0NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=EZXt1szx; spf=pass (google.com: domain of prakash.sangappa@oracle.com designates 156.151.31.85 as permitted sender) smtp.mailfrom=prakash.sangappa@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from userp2120.oracle.com (userp2120.oracle.com. [156.151.31.85]) by mx.google.com with ESMTPS id o3-v6si1423901qkd.87.2018.09.12.13.25.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 13:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of prakash.sangappa@oracle.com designates 156.151.31.85 as permitted sender) client-ip=156.151.31.85; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=EZXt1szx; spf=pass (google.com: domain of prakash.sangappa@oracle.com designates 156.151.31.85 as permitted sender) smtp.mailfrom=prakash.sangappa@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com 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 w8CKO5vu041213; Wed, 12 Sep 2018 20:25:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=8Sry9VfOa8WI9s6H5jH3I6krWsR4HwJtnmYrg+2LmK8=; b=EZXt1szxpHc8ol5fV1KKfNqXodveVWbdn1JL60e+Pqs4ZedPEj9EWCpP25pdWEen8wgF iAw4eQcSdgFSuRyMx7NYunmPofoHgqX2RUydmzz/sEBNyOTW/PN6+Z4+I67QwFKVzlmG yrABMZLuL3j7d7qql5QRuIsIiDZkOy5t8DrERa4f5gpZ0OaHKR5FYL4fim4XZls5ozoe 98EnVAg1y1wsE+1c5pmoyUa/1Q9fwGDIURA0DH5oY6sO5JTPvkp3mIuPeyAnDilwUFwM 3HvI8jYcariK/SqA6GHsJAW7Eg11pFu8QQVgESSzec5U6rVSdMgp9vUl237rxpHznvhN Qw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2mc72qvbvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:25:00 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8CKOwpN029974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:24:59 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8CKOvA0024062; Wed, 12 Sep 2018 20:24:57 GMT Received: from pp-ThinkCentre-M82.us.oracle.com (/10.132.93.61) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Sep 2018 13:24:56 -0700 From: Prakash Sangappa To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: dave.hansen@intel.com, mhocko@suse.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, khandual@linux.vnet.ibm.com, steven.sistare@oracle.com, prakash.sangappa@oracle.com Subject: [PATCH V2 0/6] VA to numa node information Date: Wed, 12 Sep 2018 13:23:58 -0700 Message-Id: <1536783844-4145-1-git-send-email-prakash.sangappa@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9014 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=574 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809120201 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Prakash Sangappa (6): Add check to match numa node id when gathering pte stats Add /proc//numa_vamaps file for numa node information Provide process address range to numa node id mapping Add support to lseek /proc//numa_vamaps file File /proc//numa_vamaps access needs PTRACE_MODE_READ_REALCREDS check /proc/pid/numa_vamaps: document in Documentation/filesystems/proc.txt Documentation/filesystems/proc.txt | 21 +++ fs/proc/base.c | 6 +- fs/proc/internal.h | 1 + fs/proc/task_mmu.c | 265 ++++++++++++++++++++++++++++++++++++- 4 files changed, 285 insertions(+), 8 deletions(-)