Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946006AbXBVMhl (ORCPT ); Thu, 22 Feb 2007 07:37:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946004AbXBVMhk (ORCPT ); Thu, 22 Feb 2007 07:37:40 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:45578 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946006AbXBVMhk (ORCPT ); Thu, 22 Feb 2007 07:37:40 -0500 Date: Thu, 22 Feb 2007 14:37:38 +0200 (EET) From: Pekka J Enberg 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 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1860 Lines: 58 From: Pekka Enberg 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 Cc: Christoph Lameter Signed-off-by: Pekka Enberg --- 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; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/