On 08/01/2014 07:05 AM, Hugh Dickins wrote: > On Tue, 22 Jul 2014, Jerome Marchand wrote: > >> Adds get_mm_shswap() which compute the size of swaped out shmem. It >> does so by pagewalking the mm and using the new shmem_locate() function >> to get the physical location of shmem pages. >> The result is displayed in the new VmShSw line of /proc/<pid>/status. >> Use mm_walk an shmem_locate() to account paged out shmem pages. >> >> It significantly slows down /proc/<pid>/status acccess speed when >> there is a big shmem mapping. If that is an issue, we can drop this >> patch and only display this counter in the inherently slower >> /proc/<pid>/smaps file (cf. next patch). >> >> Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx> > > Definite NAK to this one. As you guessed yourself, it is always a > mistake to add one potentially very slow-to-gather number to a stats > file showing a group of quickly gathered numbers. What I was going for, is to have a counter for shared swap in the same way I did for VmShm, but I never found a way to do it. The reason I posted this patch is that I hope than someone will have a better idea. > > Is there anything you could do instead? I don't know if it's worth > the (little) extra mm_struct storage and maintenance, but you could > add a VmShmSize, which shows that subset of VmSize (total_vm) which > is occupied by shmem mappings. > > It's ambiguous what to deduce when VmShm is less than VmShmSize: > the difference might be swapped out, it might be holes in the sparse > object, it might be instantiated in the object but never faulted > into the mapping: in general it will be a mix of all of those. > So, sometimes useful info, but easy to be misled by it. > > As I say, I don't know if VmShmSize would be worth adding, given its > deficiencies; and it could be worked out from /proc/<pid>/maps anyway. I don't think that would be very useful. Sparse mapping are quite common. Jerome > > Hugh >
Attachment:
signature.asc
Description: OpenPGP digital signature