Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count

From: Rik van Riel
Date: Tue Feb 16 2016 - 11:12:32 EST


On Tue, 2016-02-16 at 16:28 +1100, Dave Chinner wrote:
> On Mon, Feb 15, 2016 at 03:52:31PM -0800, Daniel Walker wrote:
> > On 02/15/2016 03:05 PM, Dave Chinner wrote:
> > >Â
> > > As for a replacement, looking at what pages you consider
> > > "droppable"
> > > is really only file pages that are not under dirty or under
> > > writeback. i.e. from /proc/meminfo:
> > >
> > > Active(file):ÂÂÂÂÂ220128 kB
> > > Inactive(file):ÂÂÂÂ60232 kB
> > > Dirty:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ0 kB
> > > Writeback:ÂÂÂÂÂÂÂÂÂÂÂÂÂ0 kB
> > >
> > > i.e. reclaimable file cache = Active + inactive - dirty -
> > > writeback.
> .....
>Â
> > As to his other suggestion of estimating the droppable cache, I
> > have considered it but found it unusable. The problem is the
> > inactive file pages count a whole lot pages more than the
> > droppable pages.
>
> inactive file pages are supposed to be exactly that - inactive. i.e.
> the have not been referenced recently, and are unlikely to be dirty.
> They should be immediately reclaimable.

Inactive file pages can still be mapped by
processes.

The reason we do not unmap file pages when
moving them to the inactive list is that
some workloads fill essentially all of memory
with mmapped file pages.

Given that the inactive list is generally a
considerable fraction of file memory, unmapping
pages that get deactivated could create a lot
of churn and unnecessary page faults for that
kind of workload.

--Â
All rights reversed

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