[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.11.1407312204000.3912@eggly.anvils>
Date: Thu, 31 Jul 2014 22:05:06 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Jerome Marchand <jmarchan@...hat.com>
cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, linux-doc@...r.kernel.org,
Hugh Dickins <hughd@...gle.com>,
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 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.
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.
Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists