On Sat, Jun 09, 2012 at 12:46:53PM +0300, Mikolaj Golub wrote: > > On Sat, 9 Jun 2012 12:07:40 +0300 Konstantin Belousov wrote: > > KB> Well, if I see a report informing me that some 2M region contains 512 > super > KB> pages, how should I interpret it ? For me, it is only one superpage > (mapping) > KB> that can be created in one 2M region. > > Well, if I see a report like below: > > PID START END PRT RES PRES SUP REF SHD FL > TP PATH > 48568 0x800c00000 0x820c00000 rw- 131072 0 51712 2 0 --S > df > > it tells me that for the region 0x800c00000-0x820c00000 (512Mb) we have 131072 > * 4k = 512Mb resident and 51712 * 4k = 202Mb (a litle less than a half of the > region) promoted (mapped) to superpages. > > If I had number of superpages here I would need additional knowledge (a > superpage size) to calculate how effectively superpages are used. > > But actually, no much difference for me. To get a number of superpages is it > enough just to divide the result obtained counting normal-sized pages by > (2M/4k) factor?
First, there is nothing which would prevent demotion from happens while you iterate over the map, so you could get funyy numbers, like 42 superpages for 2M region with your method. Second, the superpage size if machine-depended, and even single machine could support differently sized superpage. For amd64, hardware can support 2M and 1G pages, and for i386 you can get 4M or 2M depending on PAE config. And last, I in fact do not see much use for any 'superpage count'. Would I would like to see is the TLB miss count for a region. Then I could estimate whether superpage enabling provided some advantage. Just as a note, if there were no accesses to a region after promotion, then promotion is the waste. Anyway, please do not consider this as discouraging you from doing a useful work.
pgpv9Di6amoeA.pgp
Description: PGP signature