Thanks. I've misread Labs kernel's initial index to zero until now.
2020年8月15日(土) 13:51 Anthony Martin <[email protected]>: > > Kyohei Kadota <[email protected]> once said: > > I'm reading proc(3). It describes the status file: > > > > > the amount of memory used by the process, except its stack, in units of > > > 1024 bytes > > > > In /sys/src/9/pc/port/proc.c, it seems to me that procread sums all > > segment's size for that. > > Is the above statement correct? > > The Labs kernel loops over [1,NSEG) to sum the segment sizes. > The index of the stack segment, SSEG, is zero so it is skipped. > This measurement is the total virtual address space in use by > the process minus the stack. > > The 9front kernel loops over [0,NSEG) to scan the virtual page > table of each segment for used pages, summing as it goes. This > measurement is the total amount of memory in use by the process. > > Cheers, > Anthony ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tc2c9fe27a3a2dd4c-M4703ec42f7c339cb077a51fe Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
