[lkml]   [2018]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH] Add /proc/<pid>/numa_vamaps for numa node information

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/<pid>/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
starting from '006dc000'


Can seek to VA 006dc000 and start reading, it would get following

006dc000-006dd000 N1=1 kernelpagesize_kB=4 anon=1 dirty=1
006dd000-006de000 N0=1 kernelpagesize_kB=4 anon=1 dirty=1
006de000-006e0000 N1=2 kernelpagesize_kB=4 anon=2 dirty=2
006e0000-006e6000 N0=6 kernelpagesize_kB=4 anon=6 dirty=6

One advantage with getting numa node information from this /proc file vs
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.

 \ /
  Last update: 2018-05-08 01:21    [W:0.098 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site