linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Christoph Lameter <cl@linux.com>
Cc: akpm@linux-foundation.org, npiggin@kernel.dk,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, Andi Kleen <andi@firstfloor.org>
Subject: Re: shrinkers: Add node to indicate where to target shrinking
Date: Sat, 13 Nov 2010 18:26:20 -0800	[thread overview]
Message-ID: <AANLkTinXftrp0NxGjsQAkoroMGDXozbA0XgUhSiOJ-xz@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1010211259360.24115@router.home>

On Thu, Oct 21, 2010 at 11:00 AM, Christoph Lameter <cl@linux.com> wrote:
> Add a field node to struct shrinker that can be used to indicate on which
> node the reclaim should occur. The node field also can be set to NUMA_NO_NODE
> in which case a reclaim pass over all nodes is desired.
>
> Index: linux-2.6/mm/vmscan.c
> ===================================================================
> --- linux-2.6.orig/mm/vmscan.c  2010-10-21 12:50:21.000000000 -0500
> +++ linux-2.6/mm/vmscan.c       2010-10-21 12:50:31.000000000 -0500
> @@ -202,7 +202,7 @@ EXPORT_SYMBOL(unregister_shrinker);
>  * Returns the number of slab objects which we shrunk.
>  */
>  unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
> -                       unsigned long lru_pages)
> +                       unsigned long lru_pages, int node)
>  {
>        struct shrinker *shrinker;
>        unsigned long ret = 0;
> @@ -218,6 +218,7 @@ unsigned long shrink_slab(unsigned long
>                unsigned long total_scan;
>                unsigned long max_pass;
>
> +               shrinker->node = node;
>                max_pass = (*shrinker->shrink)(shrinker, 0, gfp_mask);
>                delta = (4 * scanned) / shrinker->seeks;
>                delta *= max_pass;

Apologies for coming late to the party, but I have to ask - is there
anything protecting shrinker->node from concurrent modification if
several threads are trying to reclaim memory at once ?

(I note that there was already something similar done to shrinker->nr
field, so I am probably missing some subtlety in the locking ?)

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2010-11-14  2:26 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 17:59 vmscan: Do not run shrinkers for zones other than ZONE_NORMAL Christoph Lameter
2010-10-21 18:00 ` shrinkers: Add node to indicate where to target shrinking Christoph Lameter
2010-10-21 18:12   ` Andi Kleen
2010-10-21 20:57   ` David Rientjes
2010-10-21 21:07     ` Christoph Lameter
2010-10-22 13:27     ` Andi Kleen
2010-10-21 23:58   ` Nick Piggin
2010-10-22 12:12     ` Andi Kleen
2010-10-22 15:55     ` Christoph Hellwig
2010-10-22 16:32       ` Christoph Lameter
2010-10-24  1:42         ` Nick Piggin
2010-10-25  0:57           ` KOSAKI Motohiro
2010-10-25 14:59           ` Christoph Lameter
2010-11-09  4:03             ` Nick Piggin
2010-10-22 16:46       ` Andi Kleen
2010-10-24  1:31       ` Nick Piggin
2010-11-14  2:26   ` Michel Lespinasse [this message]
2010-11-14  7:10     ` KOSAKI Motohiro
2010-11-14 11:05       ` Michel Lespinasse
2010-11-15  0:29         ` KOSAKI Motohiro
2010-10-21 18:13 ` vmscan: Do not run shrinkers for zones other than ZONE_NORMAL Andi Kleen
2010-10-21 18:22   ` Christoph Lameter
2010-10-21 18:27   ` Christoph Lameter
2010-10-21 18:33     ` Andi Kleen
2010-10-21 20:48     ` David Rientjes
2010-10-21 20:54       ` Christoph Lameter
2010-10-21 19:40 ` Andrew Morton
2010-10-21 20:03   ` Christoph Lameter
2010-10-21 20:14     ` Andrew Morton
2010-10-21 20:28       ` Christoph Lameter
2010-10-21 20:36         ` Andrew Morton
2010-10-21 20:49           ` Christoph Lameter
2010-10-21 20:59             ` Andrew Morton
2010-10-21 21:13               ` Christoph Lameter
2010-10-21 21:21                 ` Andrew Morton
2010-10-21 23:04                   ` Christoph Lameter
2010-10-21 23:56 ` Nick Piggin
2010-10-22  1:37 ` KOSAKI Motohiro
2010-10-22 14:06   ` Christoph Lameter
2010-10-24  1:37     ` Nick Piggin
2010-10-25  1:22     ` KOSAKI Motohiro
2010-10-25 15:07       ` Christoph Lameter
2010-10-26  2:52         ` KOSAKI Motohiro
2010-10-26 12:42           ` KOSAKI Motohiro
2010-10-26 13:10           ` Christoph Lameter

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=AANLkTinXftrp0NxGjsQAkoroMGDXozbA0XgUhSiOJ-xz@mail.gmail.com \
    --to=walken@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@kernel.dk \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).