From: Dave Chinner <david@fromorbit.com>
To: Nag Avadhanam <nag@cisco.com>
Cc: Daniel Walker <danielwa@cisco.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Khalid Mughal <khalidm@cisco.com>,
xe-kernel@external.cisco.com, dave.hansen@intel.com,
hannes@cmpxchg.org, riel@redhat.com,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count
Date: Tue, 16 Feb 2016 19:22:41 +1100 [thread overview]
Message-ID: <20160216082241.GY19486@dastard> (raw)
In-Reply-To: <alpine.LRH.2.00.1602152135280.29586@mcp-bld-lnx-277.cisco.com>
On Mon, Feb 15, 2016 at 09:57:42PM -0800, Nag Avadhanam wrote:
> On Mon, 15 Feb 2016, Dave Chinner wrote:
> >So, to pick a random active server here:
> >
> > before after
> >Active(file): 12103200 kB 24060 kB
> >Inactive(file): 5976676 kB 1380 kB
> >Mapped: 31308 kB 31308 kB
> >
> >How much was not reclaimed? Roughly the same number of pages as the
> >Mapped count, and that's exactly what we'd expect to see from the
> >above page walk counting code. Hence a slightly better approximation
> >of the pages that dropping caches will reclaim is:
> >
> >reclaimable pages = active + inactive - dirty - writeback - mapped
>
> Thanks Dave. I considered that, but see this.
>
> Mapped page count below is much higher than the (active(file) +
> inactive (file)).
Yes. it's all unreclaimable from drop caches, though.
> Mapped seems to include all page cache pages mapped into the process
> memory, including the shared memory pages, file pages and few other
> type
> mappings.
>
> I suppose the above can be rewritten as (mapped is still high):
>
> reclaimable pages = active + inactive + shmem - dirty - writeback - mapped
>
> What about kernel pages mapped into user address space? Does "Mapped"
> include those pages as well? How do we exclude them? What about
> device mappings? Are these excluded in the "Mapped" pages
> calculation?
/me shrugs.
I have no idea - I really don't care about what pages are accounted
as mapped. I assumed that the patch proposed addressed your
requirements and so I suggested an alternative that provided almost
exactly the same information but erred on the side of
underestimation and hence solves your problem of drop_caches not
freeing as much memory as you expected....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2016-02-16 8:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 20:14 [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Daniel Walker
2016-02-14 21:18 ` Dave Chinner
2016-02-15 18:19 ` Daniel Walker
2016-02-15 23:05 ` Dave Chinner
2016-02-15 23:52 ` Daniel Walker
2016-02-16 0:45 ` Theodore Ts'o
2016-02-16 2:58 ` Nag Avadhanam (nag)
2016-02-16 5:38 ` Dave Chinner
2016-02-16 7:14 ` Nag Avadhanam
2016-02-16 8:35 ` Dave Chinner
2016-02-16 8:43 ` Vladimir Davydov
2016-02-16 18:37 ` Nag Avadhanam
2016-02-16 5:28 ` Dave Chinner
2016-02-16 5:57 ` Nag Avadhanam
2016-02-16 8:22 ` Dave Chinner [this message]
2016-02-16 16:12 ` Rik van Riel
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=20160216082241.GY19486@dastard \
--to=david@fromorbit.com \
--cc=corbet@lwn.net \
--cc=danielwa@cisco.com \
--cc=dave.hansen@intel.com \
--cc=hannes@cmpxchg.org \
--cc=khalidm@cisco.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nag@cisco.com \
--cc=riel@redhat.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xe-kernel@external.cisco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).