linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Dquot slab cache: Fix competing alignments
@ 2007-05-05  5:19 Christoph Lameter
  2007-05-05 17:29 ` Christoph Lameter
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Lameter @ 2007-05-05  5:19 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

There is a competing specification of an alignment and hardware
cache alignment in the kmem_cache_create call. Remove the cache 
alignments. Convert call to use a macro and specify cache line alignment 
on the struct.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: slub/fs/dquot.c
===================================================================
--- slub.orig/fs/dquot.c	2007-05-04 21:56:20.000000000 -0700
+++ slub/fs/dquot.c	2007-05-04 22:17:50.000000000 -0700
@@ -1848,11 +1848,8 @@ static int __init dquot_init(void)
 
 	register_sysctl_table(sys_table);
 
-	dquot_cachep = kmem_cache_create("dquot", 
-			sizeof(struct dquot), sizeof(unsigned long) * 4,
-			(SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-				SLAB_MEM_SPREAD|SLAB_PANIC),
-			NULL, NULL);
+	dquot_cachep = KMEM_CACHE(dquot,
+			SLAB_MEM_SPREAD|SLAB_RECLAIM_ACCOUNT|SLAB_PANIC);
 
 	order = 0;
 	dquot_hash = (struct hlist_head *)__get_free_pages(GFP_ATOMIC, order);
Index: slub/include/linux/quota.h
===================================================================
--- slub.orig/include/linux/quota.h	2007-05-04 22:06:09.000000000 -0700
+++ slub/include/linux/quota.h	2007-05-04 22:06:54.000000000 -0700
@@ -225,7 +225,7 @@ struct dquot {
 	unsigned long dq_flags;		/* See DQ_* */
 	short dq_type;			/* Type of quota */
 	struct mem_dqblk dq_dqb;	/* Diskquota usage */
-};
+} ____cacheline_aligned;
 
 #define NODQUOT (struct dquot *)NULL
 

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-05 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-05  5:19 Dquot slab cache: Fix competing alignments Christoph Lameter
2007-05-05 17:29 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox