[Top] [All Lists]

Re: [xfs-masters] [dm-devel] new dm-bufio

To: Mikulas Patocka <mpatocka@xxxxxxxxxx>
Subject: Re: [xfs-masters] [dm-devel] new dm-bufio
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 30 Aug 2011 11:49:06 +1000
Cc: xfs@xxxxxxxxxxx, xfs-masters@xxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, device-mapper development <dm-devel@xxxxxxxxxx>, Joe Thornber <thornber@xxxxxxxxxx>, Mike Snitzer <snitzer@xxxxxxxxxx>, "Alasdair G. Kergon" <agk@xxxxxxxxxx>
In-reply-to: <Pine.LNX.4.64.1108291445460.7825@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <Pine.LNX.4.64.1108221600510.26651@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110823113048.GC5442@ubuntu> <Pine.LNX.4.64.1108231012560.2629@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110823185423.GA10936@xxxxxxxxxxxxx> <Pine.LNX.4.64.1108291445460.7825@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Aug 29, 2011 at 02:53:51PM -0400, Mikulas Patocka wrote:
> On Tue, 23 Aug 2011, Christoph Hellwig wrote:
> > FYI, the "shrinker" interface in include/linux/shrinker.h is how the
> > VM tells subsystems to shrink their memory usage.  It is used for
> > various slab caches, and the XFS buffercache in
> > fs/xfs/linux-2.6/xfs_buf.c
> BTW. shrinker functions from xfs_qm.c - xfs_qm_shake and 
> xfs_qm_shake_freelist - look completely bogus. They don't read 
> sc->nr_to_scan to determine how many values they should scan (and compare 
> it with zero to test if they should scan at all) and they return the 
> number of entries freed - the interface specifies that they should return 
> the number of entries remaining the in cache.

It's a relic from the days of Irix that we've kept around and never
really touched because it's never shown up as a problem. Such code
is cleaned up as we go along or as problems arise.

As it is, this patchset:


that I'm currently working on changes the shrinker API to be much
more sane - the shrinker now has a separate "count objects"
operation and the "scan objects" operation now returns the number of
items freed rather than the number of items left in the cache.

As the API is being changed, the xfs_qm shrinker is also fixed to
return the right values according to the new API. It still doesn't
pay attention to nr_to_scan, but that's not a big deal and will get
addressed in future when other upcoming changes are made to the


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>