Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5931555imm; Wed, 12 Sep 2018 13:25:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYVMVh01h7QqJ1501wJqt0QDTF+T4azpVBPAJ0fcoCjuhezyJ5j7q/aN9s2UCmLDzS5Lvf1 X-Received: by 2002:a17:902:8697:: with SMTP id g23-v6mr4080673plo.292.1536783944082; Wed, 12 Sep 2018 13:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536783944; cv=none; d=google.com; s=arc-20160816; b=xO0kzom3UG4++DQXA/e6opQzKS+dYCvbrMSRD+P5fRN7ALugmEQ9+NnXYMYd4T7QGY bIJ3AqUVhSOhG8rEZVzXcjMDaoFzatKV2gOgpLM7T5igN6vtrIFTfnfUe7YcSmFN6A51 Ja6l9OtUjVdt+tKPX+ZE3/ayJ+1CGm/gv/pmNqry+neDY6qbTdzSyx26aJzuCPDrneFU 2YHqa0701mrvRDhGREEo47B2PzL/3/0sP2ie9klaKqve8MzNJVtvNjRlbxJCQImMJQf+ 6RgxURRMACe+WyGFZsdcJ2zn61MM0R50nnE0+6mlTu9D1iNGPDzbq0JqUkGwBRQw5HEc uqHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8Sry9VfOa8WI9s6H5jH3I6krWsR4HwJtnmYrg+2LmK8=; b=B+3O5hH6m4HzKCJ1n9tKiekDJVINmmc+8G+xmx1179uosmTauwN4bHW5xviApyWtyn gfIdHiYCV8D/32qn24fnXb3NstgCNe/G9q0KGqeDoLPfZr4Voqve4o0+lMaDgQ2n1czz xgKfl8Y1NhTurpQrFuwCYpWAFEsUZwm7UGlqtEN0XJdY7PzVuZRJw9b7Qy1QwBjUfPfy T3gBmlyP5j1dGlyO6n5Xyp8kfZseV1cJ5D+XdGlUvUCTrMu+Cwe+tOExPm0vXNknD7IL nhEfJqVQNkZA1TkA1/5HkdEji62oHRg14UVPN48PpsI/k71zhdagyn2A5vbs9+qFcrJH weHw== 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: 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 k1-v6si1837115pld.424.2018.09.12.13.25.29; Wed, 12 Sep 2018 13:25:44 -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=EZXt1szx; 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 S1728348AbeIMBbV (ORCPT + 99 others); Wed, 12 Sep 2018 21:31:21 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:37074 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727844AbeIMBbU (ORCPT ); Wed, 12 Sep 2018 21:31:20 -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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4