All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, xfs-masters@oss.sgi.com,
	reiserfs-dev@namesys.com
Subject: Re: [PATCH] Cleanup and kernelify shrinker registration (rc5-mm2)
Date: Tue, 03 Apr 2007 14:45:02 +1000	[thread overview]
Message-ID: <1175575503.12230.484.camel@localhost.localdomain> (raw)
In-Reply-To: <20070402205825.12190e52.akpm@linux-foundation.org>

On Mon, 2007-04-02 at 20:58 -0700, Andrew Morton wrote:
> On Tue, 03 Apr 2007 13:44:45 +1000 Rusty Russell <rusty@rustcorp.com.au> wrote:
> 
> > 
> > I can never remember what the function to register to receive VM pressure
> > is called.  I have to trace down from __alloc_pages() to find it.
> > 
> > It's called "set_shrinker()", and it needs Your Help.
> > 
> > New version:
> > 1) Don't hide struct shrinker.  It contains no magic.
> > 2) Don't allocate "struct shrinker".  It's not helpful.
> > 3) Call them "register_shrinker" and "unregister_shrinker".
> > 4) Call the function "shrink" not "shrinker".
> > 5) Rename "nr_to_scan" argument to "nr_to_free".
> 
> No, it is actually the number to scan.  This is >= the number of freed
> objects.
> 
> This is because, for better of for worse, the VM tries to balance the
> scanning rate of the various caches, not the reclaiming rate.

Err, ok, I completely missed that distinction.

Does that mean the to function correctly every user needs some internal
cursor so it doesn't end up scanning the first N entries over and over?

Rusty.


WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, xfs-masters@oss.sgi.com,
	reiserfs-dev@namesys.com
Subject: Re: [PATCH] Cleanup and kernelify shrinker registration (rc5-mm2)
Date: Tue, 03 Apr 2007 14:45:02 +1000	[thread overview]
Message-ID: <1175575503.12230.484.camel@localhost.localdomain> (raw)
In-Reply-To: <20070402205825.12190e52.akpm@linux-foundation.org>

On Mon, 2007-04-02 at 20:58 -0700, Andrew Morton wrote:
> On Tue, 03 Apr 2007 13:44:45 +1000 Rusty Russell <rusty@rustcorp.com.au> wrote:
> 
> > 
> > I can never remember what the function to register to receive VM pressure
> > is called.  I have to trace down from __alloc_pages() to find it.
> > 
> > It's called "set_shrinker()", and it needs Your Help.
> > 
> > New version:
> > 1) Don't hide struct shrinker.  It contains no magic.
> > 2) Don't allocate "struct shrinker".  It's not helpful.
> > 3) Call them "register_shrinker" and "unregister_shrinker".
> > 4) Call the function "shrink" not "shrinker".
> > 5) Rename "nr_to_scan" argument to "nr_to_free".
> 
> No, it is actually the number to scan.  This is >= the number of freed
> objects.
> 
> This is because, for better of for worse, the VM tries to balance the
> scanning rate of the various caches, not the reclaiming rate.

Err, ok, I completely missed that distinction.

Does that mean the to function correctly every user needs some internal
cursor so it doesn't end up scanning the first N entries over and over?

Rusty.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-04-03  4:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03  3:44 [PATCH] Cleanup and kernelify shrinker registration (rc5-mm2) Rusty Russell
2007-04-03  3:44 ` Rusty Russell
2007-04-03  3:47 ` Rusty Russell
2007-04-03  3:47   ` Rusty Russell
2007-04-03  3:58 ` Andrew Morton
2007-04-03  3:58   ` Andrew Morton
2007-04-03  4:45   ` Rusty Russell [this message]
2007-04-03  4:45     ` Rusty Russell
2007-04-03  4:57     ` Andrew Morton
2007-04-03  4:57       ` Andrew Morton
2007-04-03  5:44       ` [xfs-masters] " David Chinner
2007-04-03  5:44         ` David Chinner
2007-04-03  6:01         ` Andrew Morton
2007-04-03  6:01           ` Andrew Morton
2007-04-03  6:19           ` David Chinner
2007-04-03  6:19             ` David Chinner
2007-04-04  0:30             ` Rusty Russell
2007-04-04  0:30               ` Rusty Russell
2007-04-03  5:47       ` Rusty Russell
2007-04-03  5:47         ` Rusty Russell
2007-04-03  6:09         ` Andrew Morton
2007-04-03  6:09           ` Andrew Morton
2007-04-03  7:18           ` Rusty Russell
2007-04-03  7:18             ` Rusty Russell
2007-04-03 12:37             ` [xfs-masters] " David Chinner
2007-04-03 12:37               ` David Chinner
2007-04-03 17:36               ` Andrew Morton
2007-04-03 17:36                 ` Andrew Morton
2007-04-04  0:03                 ` David Chinner
2007-04-04  0:03                   ` David Chinner
2007-04-03  9:57 ` Andi Kleen
2007-04-03  9:57   ` Andi Kleen

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=1175575503.12230.484.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=reiserfs-dev@namesys.com \
    --cc=xfs-masters@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.