From: Jerome Marchand <jmarchan@redhat.com>
To: Hugh Dickins <hughd@google.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-s390@vger.kernel.org, linux-doc@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@redhat.com>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux390@de.ibm.com, Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH 4/5] mm, shmem: Add shmem swap memory accounting
Date: Fri, 01 Aug 2014 16:44:51 +0200 [thread overview]
Message-ID: <53DBA7E3.6000803@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1407312204000.3912@eggly.anvils>
[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]
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@redhat.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
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 538 bytes --]
next prev parent reply other threads:[~2014-08-01 14:44 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 13:43 [PATCH RESEND 0/5] mm, shmem: Enhance per-process accounting of shared memory Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-07-22 13:43 ` [PATCH 1/5] mm, shmem: Add shmem resident memory accounting Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-08-01 5:01 ` Hugh Dickins
2014-08-01 5:01 ` Hugh Dickins
2014-08-01 14:36 ` Jerome Marchand
2014-07-22 13:43 ` [PATCH 2/5] mm, shmem: Add shmem_locate function Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-08-01 5:01 ` Hugh Dickins
2014-08-01 5:01 ` Hugh Dickins
2014-07-22 13:43 ` [PATCH 3/5] mm, shmem: Add shmem_vma() helper Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-07-24 19:53 ` Oleg Nesterov
2014-07-24 19:53 ` Oleg Nesterov
2014-08-01 5:03 ` Hugh Dickins
2014-08-01 5:03 ` Hugh Dickins
2014-08-01 14:37 ` Jerome Marchand
2014-07-22 13:43 ` [PATCH 4/5] mm, shmem: Add shmem swap memory accounting Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-08-01 5:05 ` Hugh Dickins
2014-08-01 5:05 ` Hugh Dickins
2014-08-01 14:44 ` Jerome Marchand [this message]
2014-07-22 13:43 ` [PATCH 5/5] mm, shmem: Show location of non-resident shmem pages in smaps Jerome Marchand
2014-07-22 13:43 ` Jerome Marchand
2014-08-01 5:06 ` Hugh Dickins
2014-08-01 5:06 ` Hugh Dickins
2014-08-01 15:23 ` Jerome Marchand
-- strict thread matches above, loose matches on Subject: below --
2014-07-01 13:01 [PATCH 0/5] mm, shmem: Enhance per-process accounting of shared memnory Jerome Marchand
2014-07-01 13:02 ` [PATCH 4/5] mm, shmem: Add shmem swap memory accounting Jerome Marchand
2014-07-01 13:02 ` Jerome Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53DBA7E3.6000803@redhat.com \
--to=jmarchan@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=heiko.carstens@de.ibm.com \
--cc=hughd@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=rdunlap@infradead.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.