Re: computing drop-able caches

From: Rik van Riel
Date: Thu Feb 11 2016 - 17:12:08 EST


On Wed, 2016-02-10 at 11:11 -0800, Daniel Walker wrote:
> On 02/10/2016 10:13 AM, Dave Hansen wrote:
> > On 02/10/2016 10:04 AM, Daniel Walker wrote:
> > > > [Linux_0:/]$ echo 3 > /proc/sys/vm/drop_caches
> > > > [Linux_0:/]$ cat /proc/meminfo
> > > > MemTotal:ÂÂÂÂÂÂÂÂ3977836 kB
> > > > MemFree:ÂÂÂÂÂÂÂÂÂ1095012 kB
> > > > MemAvailable:ÂÂÂÂ1434148 kB
> > > I suspect MemAvailable takes into account more than just the
> > > droppable
> > > caches. For instance, reclaimable slab is included, but I don't
> > > think
> > > drop_caches drops that part.
> > There's a bit for page cache and a bit for slab, see:
> >
> > https://kernel.org/doc/Documentation/sysctl/vm.txt
> >
> >
>
> Ok, then this looks like a defect then. I would think MemAvailable
> wouldÂ
> always be smaller then MemFree (after echo 3 >Â
> /proc/sys/vm/drop_caches).. Unless there is something else be
> accountedÂ
> for that we aren't aware of.

echo 3 > /proc/sys/vm/drop_caches will only
drop unmapped page cache, IIRC

The system may still have a number of page
cache pages left that are mapped in processes,
but will be reclaimable if the VM needs the
memory for something else.

--Â
All rights reversed

Attachment: signature.asc
Description: This is a digitally signed message part