[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160129223346.GA30068@cmpxchg.org>
Date: Fri, 29 Jan 2016 17:33:46 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Daniel Walker <danielwa@...co.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, "Khalid Mughal (khalidm)" <khalidm@...co.com>,
"xe-kernel@...ernal.cisco.com" <xe-kernel@...ernal.cisco.com>,
Rik van Riel <riel@...hat.com>
Subject: Re: computing drop-able caches
On Fri, Jan 29, 2016 at 01:21:47PM -0800, Daniel Walker wrote:
> On 01/28/2016 05:55 PM, Johannes Weiner wrote:
> >On Thu, Jan 28, 2016 at 05:29:41PM -0800, Daniel Walker wrote:
> >>On 01/28/2016 05:03 PM, Daniel Walker wrote:
> >>[regarding MemAvaiable]
> >>
> >>This new metric purportedly helps usrespace assess available memory. But,
> >>its again based on heuristic, it takes 1/2 of page cache as reclaimable..
> >No, it takes the smaller value of cache/2 and the low watermark, which
> >is a fraction of memory. Actually, that does look a little weird. Rik?
> >
> >We don't age cache without memory pressure, you don't know how much is
> >used until you start taking some away. Heuristics is all we can offer.
>
> With a simple busybox root system I get this,
>
> MemTotal: 16273996 kB
> MemFree: 16137920 kB
> MemAvailable: 16046132 kB
>
> shouldn't MemAvailable be at least the same as MemFree ? I changed the code
> somewhat so it subtracted the wmark_low only, or the pagecache/2 only, both
> are still under MemFree. This system has very little drop-able caches.
No, a portion of memory is reserved for the kernel and not available
to userland. If the kernel doesn't use it it will remain free. Hence
the lower MemAvailable.
Powered by blists - more mailing lists