linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: Dquot slab cache: Fix competing alignments
Date: Fri, 4 May 2007 22:19:23 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705042218140.21707@schroedinger.engr.sgi.com> (raw)

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>

             reply	other threads:[~2007-05-05  5:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-05  5:19 Christoph Lameter [this message]
2007-05-05 17:29 ` 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=Pine.LNX.4.64.0705042218140.21707@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.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