[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53DBA7E3.6000803@redhat.com>
Date: Fri, 01 Aug 2014 16:44:51 +0200
From: Jerome Marchand <jmarchan@...hat.com>
To: Hugh Dickins <hughd@...gle.com>
CC: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, linux-doc@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>, linux390@...ibm.com,
Heiko Carstens <heiko.carstens@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH 4/5] mm, shmem: Add shmem swap memory accounting
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@...hat.com>
>
> 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
>
Download attachment "signature.asc" of type "application/pgp-signature" (539 bytes)
Powered by blists - more mailing lists