linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: npiggin@suse.de
To: penberg@cs.helsinki.fi
Cc: stable@kernel.org, linux-mm@kvack.org,
	Matt Mackall <mpm@selenic.com>, Christoph Lameter <cl@linux.com>
Subject: [patch 2/3] mm: SLOB fix reclaim_state
Date: Tue, 05 May 2009 19:13:45 +1000	[thread overview]
Message-ID: <20090505091434.456070042@suse.de> (raw)
In-Reply-To: 20090505091343.706910164@suse.de

[-- Attachment #1: mm-slob-fix-reclaim_state.patch --]
[-- Type: text/plain, Size: 1477 bytes --]

SLOB does not correctly account reclaim_state.reclaimed_slab, so it will
break memory reclaim. Account it like SLAB does.

Cc: stable@kernel.org
Cc: linux-mm@kvack.org
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
 mm/slob.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/mm/slob.c
===================================================================
--- linux-2.6.orig/mm/slob.c
+++ linux-2.6/mm/slob.c
@@ -60,6 +60,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
+#include <linux/swap.h> /* struct reclaim_state */
 #include <linux/cache.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, i
 
 static void slob_free_pages(void *b, int order)
 {
+	if (current->reclaim_state)
+		current->reclaim_state->reclaimed_slab += 1 << order;
 	free_pages((unsigned long)b, order);
 }
 
@@ -407,7 +410,7 @@ static void slob_free(void *block, int s
 		spin_unlock_irqrestore(&slob_lock, flags);
 		clear_slob_page(sp);
 		free_slob_page(sp);
-		free_page((unsigned long)b);
+		slob_free_pages(b, 0);
 		return;
 	}
 


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

  parent reply	other threads:[~2009-05-05  9:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090505091343.706910164@suse.de>
2009-05-05  9:13 ` [patch 1/3] mm: SLUB fix reclaim_state npiggin
2009-05-05 13:46   ` Christoph Lameter
2009-05-06  7:20   ` Pekka Enberg
2009-05-06 13:29     ` Christoph Lameter
2009-05-06 13:42     ` Nick Piggin
2009-05-07  8:50       ` Pekka Enberg
2009-05-06 16:02     ` Johannes Weiner
2009-05-06 16:34     ` Matt Mackall
2009-05-05  9:13 ` npiggin [this message]
2009-05-05 13:47   ` [patch 2/3] mm: SLOB " Christoph Lameter
2009-05-05 16:47   ` Matt Mackall
2009-05-05  9:13 ` [patch 3/3] mm: SLQB " npiggin
2009-05-05 13:47   ` 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=20090505091434.456070042@suse.de \
    --to=npiggin@suse.de \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=mpm@selenic.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=stable@kernel.org \
    /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).