public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Joe Thornber <thornber@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	xfs@oss.sgi.com, Christoph Hellwig <hch@infradead.org>,
	xfs-masters@oss.sgi.com,
	device-mapper development <dm-devel@redhat.com>,
	"Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [xfs-masters] [dm-devel] new dm-bufio
Date: Tue, 30 Aug 2011 11:49:06 +1000	[thread overview]
Message-ID: <20110830014906.GJ3162@dastard> (raw)
In-Reply-To: <Pine.LNX.4.64.1108291445460.7825@hs20-bc2-1.build.redhat.com>

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:

http://thread.gmane.org/gmane.linux.kernel.mm/67326

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
code....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-08-30  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.64.1108221600510.26651@hs20-bc2-1.build.redhat.com>
     [not found] ` <20110823113048.GC5442@ubuntu>
     [not found]   ` <Pine.LNX.4.64.1108231012560.2629@hs20-bc2-1.build.redhat.com>
     [not found]     ` <20110823185423.GA10936@infradead.org>
2011-08-29 18:53       ` [dm-devel] new dm-bufio Mikulas Patocka
2011-08-30  1:49         ` Dave Chinner [this message]
2011-08-30  5:27           ` [xfs-masters] " Christoph Hellwig

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=20110830014906.GJ3162@dastard \
    --to=david@fromorbit.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@redhat.com \
    --cc=thornber@redhat.com \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.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