Received: by 10.192.165.148 with SMTP id m20csp3643837imm; Mon, 7 May 2018 16:21:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpk2ssAAUNc07Y8ULUk/6dcyrAVnDvuBX55B0c1pktPlCQbbGBlOmbW2B06FkHyvdW+fGkO X-Received: by 2002:a63:a54f:: with SMTP id r15-v6mr31898837pgu.236.1525735265894; Mon, 07 May 2018 16:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525735265; cv=none; d=google.com; s=arc-20160816; b=gCK5KZwJla0jy0bOKEkRqhdz2RhoSjryM0MFg1W01f4yClt6KgkZdoXfUzt/wRGnhU skd7g9isQsfjBYvO44hWBt+sFB7HkEuofAS21I8ldjkeo7LEC2zcct++XTaZ+PeRwIN9 dCh5kM6xxYC7NBpW+jhrFmJyHP61sd8mV/h2h+Gz9aLdgankRwzyYzs+1C0e/r1YTQll MRaA0ntFLfFQP1zKPIdlxtpbYAKqJLmVhbc06XH/1CPCKaJ0NfdeRGXBWzLHBP56bobF fRsHn4rKEG6lswjWCJEfbsnnqP9EDlJ532A5tjQq7HwXeE0HVngBpAwZeEbnLZKM4lcV bvaA== 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=s+sYee3Fe5zUn8zy0trQ5vw29OkRwl8COxXnQNHxxMI=; b=0COZcC7F2/SbKvrmWfqTaYb800yvqz0QlZdB17ufMYJ5UCZ7FwYggv5tHbqrfCL8L7 WkyN0rRZqru0bUOp3sKViRtPYyfNK1Wblsos/jAA0VBokEv+FXHdjU6G0Cel8RUvVP0j Yr0voIkkO0EDAVT3nKnbrdtdFcdrZMl31aXPiDnb44WwROpYCHesJQf4R/AuN0vSHFr1 NLG5ofg08u6kuJQ5wrwntYGT+R5A3W5gpZ/BGbMnZ3ZOTUXdEAx3a9h+26IeSC+kBLeD Zv+icx8B8MncSE5H0S9FQeVZBplIgsBrnoAuPS4/yvqe6btDWO3TFX0/jbBIS8phTBIF 80Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=EEuE2c8h; 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 c21-v6si14311001plo.51.2018.05.07.16.20.51; Mon, 07 May 2018 16:21:05 -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=EEuE2c8h; 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 S1753484AbeEGXUM (ORCPT + 99 others); Mon, 7 May 2018 19:20:12 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:55290 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbeEGXUK (ORCPT ); Mon, 7 May 2018 19:20:10 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w47NGMqd041953; Mon, 7 May 2018 23:19:58 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=s+sYee3Fe5zUn8zy0trQ5vw29OkRwl8COxXnQNHxxMI=; b=EEuE2c8hBdVzzLwjnD7d5Ln0bn1nFkbw/G052Akv6YRgajQKdznh8SG7fSoM84YomyzO YI+zzEoUZ881ZZk1hFhYAZwx8d/7JZ1VfgZygnhSc6orfKM7N4CC5Yk+GTa3rW68xPRt /8iWxk65vskI34FU2W4vNo3EzTz7z6J/BFLDwuV3ICP4gBAJi5FWX9a92sgBdiWLH5gK EUHkhlm9roGvRfUf1XrWtp1QjEjFWU3fuUrR2vkb4YfeMi1nGb+hNNIlGuuPMA8ybdVI fSpTLRdW+ZCET9lt5kKULRb30XbjHSb/oztaGBuCdIskCIpoxWAZBHQNquNceELKC8f7 5w== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2hs24sed7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 May 2018 23:19:58 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w47NJwSg006981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 May 2018 23:19:58 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w47NJvQi002701; Mon, 7 May 2018 23:19:57 GMT Received: from [10.132.92.130] (/10.132.92.130) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 May 2018 16:19:57 -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> <2ce01d91-5fba-b1b7-2956-c8cc1853536d@intel.com> <33f96879-351f-674a-ca23-43f233f4eb1d@linux.vnet.ibm.com> <82d2b35c-272a-ad02-692f-2c109aacdfb6@oracle.com> <8569dabb-4930-aa20-6249-72457e2df51e@intel.com> To: Dave Hansen , Anshuman Khandual , 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 From: "prakash.sangappa" Message-ID: <51145ccb-fc0d-0281-9757-fb8a5112ec24@oracle.com> Date: Mon, 7 May 2018 16:22:15 -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: <8569dabb-4930-aa20-6249-72457e2df51e@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8886 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-1805070226 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/03/2018 03:26 PM, Dave Hansen wrote: > On 05/03/2018 03:27 PM, prakash.sangappa wrote: >> If each consecutive page comes from different node, yes in >> the extreme case is this file will have a lot of lines. All the lines >> are generated at the time file is read. The amount of data read will be >> limited to the user read buffer size used in the read. >> >> /proc//pagemap also has kind of similar issue. There is 1 64 >> bit value for each user page. > But nobody reads it sequentially. Everybody lseek()s because it has a > fixed block size. You can't do that in text. The current text based files on /proc does allow seeking, but it will not help to seek to a specific VA(vma) to start from, as the seek offset will be the offset in the text. This is the case with using 'seq_file' interface in the kernel to generate the /proc file content. However, with the proposed new file, we could allow seeking to specified virtual address. The lseek offset in this case would represent the virtual address of the process. Subsequent read from the file would provide VA range to numa node information starting from that VA. In case the VA seek'ed to is invalid, it will start from the next valid mapped VA of the process. The implementation would not be based on seq_file. For example. Getting numa node information for a process having the following VMAs mapped, starting from '006dc000' 00400000-004dd000 006dc000-006dd000 006dd000-006e6000 Can seek to VA 006dc000 and start reading, it would get following 006dc000-006dd000 N1=1 kernelpagesize_kB=4 anon=1 dirty=1 file=/usr/bin/bash 006dd000-006de000 N0=1 kernelpagesize_kB=4 anon=1 dirty=1 file=/usr/bin/bash 006de000-006e0000 N1=2 kernelpagesize_kB=4 anon=2 dirty=2 file=/usr/bin/bash 006e0000-006e6000 N0=6 kernelpagesize_kB=4 anon=6 dirty=6 file=/usr/bin/bash .. One advantage with getting numa node information from this /proc file vs say using 'move_pages()' API, will be that the /proc file will be able to provide address range to numa node information, not one page at a time.