large pages (amd64)

Mel Flynn mel.flynn+fbsd.hackers at mailing.thruhere.net
Tue Jun 30 22:31:55 UTC 2009


On Tuesday 30 June 2009 00:24:00 Alan Cox wrote:
> Mel Flynn wrote:
> > On Sunday 28 June 2009 15:41:49 Alan Cox wrote:
> >> Wojciech Puchar wrote:
> >>> how can i check how much (or maybe - what processes) 2MB pages are
> >>> actually allocated?
> >>
> >> I'm afraid that you can't with great precision.  For a given program
> >> execution, on an otherwise idle machine, you can only estimate the
> >> number by looking at the change in the quantity "promotions + mappings -
> >> demotions" before, during, and after the program execution.
> >>
> >> A program can call mincore(2) in order to determine if a virtual address
> >> is part of a 2 or 4MB virtual page.
> >
> > Would it be possible to expose the super page count as kve_super in the
> > kinfo_vmentry struct so that procstat can show this information? If only
> > to determine if one is using the feature and possibly benefiting from it.
>
> Yes, I think so.
>
> > It looks like sys/kern/kern_proc.c could call mincore around the loop at
> > line 1601 (rev 194498), but I know nothing about the vm subsystem to know
> > the implications or locking involved. There's still 16 bytes of spare to
> > consume, in the kve_vminfo struct though ;)
>
> Yes, to start with, you could replace the call to pmap_extract() with a
> call to pmap_mincore() and export a Boolean to user space that says,
> "This region of the address space contains one or more superpage mappings."

How about attached?

% sudo procstat -av|grep 'S '
  PID      START        END PRT  RES PRES REF SHD  FL TP PATH
 1754 0x28900000 0x2ae00000 rw- 9385    0   3   0 --S df
 2141 0x2f900000 0x30800000 rw- 3719    0   1   0 --S df
 2146 0x3eec0000 0x4fac0000 rwx 1745    0   1   0 --S df

-- 
Mel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: procstat-superpages.patch
Type: text/x-patch
Size: 2368 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090630/dd3647d2/procstat-superpages.bin


More information about the freebsd-hackers mailing list