LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pekka J Enberg <penberg@cs.helsinki.fi>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, wli@holomorphy.com, clameter@sgi.com
Subject: [PATCH] slab: remove colouroff from struct slab
Date: Thu, 22 Feb 2007 14:37:38 +0200 (EET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0702221436460.14523@sbz-30.cs.Helsinki.FI> (raw)

From: Pekka Enberg <penberg@cs.helsinki.fi>

As the color offset is always within the first page of the slab,
virt_to_page() works just fine without slabp->colouroff.

Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 mm/slab.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Index: 2.6/mm/slab.c
===================================================================
--- 2.6.orig/mm/slab.c	2007-02-22 13:51:41.000000000 +0200
+++ 2.6/mm/slab.c	2007-02-22 13:57:39.000000000 +0200
@@ -219,7 +219,6 @@
  */
 struct slab {
 	struct list_head list;
-	unsigned long colouroff;
 	void *s_mem;		/* including colour offset */
 	unsigned int inuse;	/* num of objs active in slab */
 	kmem_bufctl_t free;
@@ -1908,18 +1907,16 @@
  */
 static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
 {
-	void *addr = slabp->s_mem - slabp->colouroff;
-
 	slab_destroy_objs(cachep, slabp);
 	if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) {
 		struct slab_rcu *slab_rcu;
 
 		slab_rcu = (struct slab_rcu *)slabp;
 		slab_rcu->cachep = cachep;
-		slab_rcu->addr = addr;
+		slab_rcu->addr = slabp->s_mem;
 		call_rcu(&slab_rcu->head, kmem_rcu_free);
 	} else {
-		kmem_freepages(cachep, addr);
+		kmem_freepages(cachep, slabp->s_mem);
 		if (OFF_SLAB(cachep))
 			kmem_cache_free(cachep->slabp_cache, slabp);
 	}
@@ -2585,7 +2582,6 @@
 		colour_off += cachep->slab_size;
 	}
 	slabp->inuse = 0;
-	slabp->colouroff = colour_off;
 	slabp->s_mem = objp + colour_off;
 	slabp->nodeid = nodeid;
 	return slabp;

             reply	other threads:[~2007-02-22 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 12:37 Pekka J Enberg [this message]
2007-02-23 14:00 ` Christoph Lameter
2007-03-02  7:14 ` Andrew Morton

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=Pine.LNX.4.64.0702221436460.14523@sbz-30.cs.Helsinki.FI \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.com \
    --subject='Re: [PATCH] slab: remove colouroff from struct slab' \
    /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

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