linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Haggai Eran <haggaie@mellanox.com>
To: linux-mm@kvack.org
Cc: Pekka Enberg <penberg@kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Haggai Eran <haggaie@mellanox.com>
Subject: [PATCH] mm/sl[aou]b: Shrink __kmem_cache_create() parameter lists fix
Date: Wed, 19 Sep 2012 16:08:21 +0300	[thread overview]
Message-ID: <1348060101-32288-1-git-send-email-haggaie@mellanox.com> (raw)

Fixes compilation with CONFIG_DEBUG_PAGEALLOC, which was broken when the align
parameter was removed.

Signed-off-by: Haggai Eran <haggaie@mellanox.com>
---
I encountered a problem compiling linux-next today with the
CONFIG_DEBUG_PAGEALLOC configuration option. This patch solves the problem
by reading the align parameter from the cachep struct, as the original patch
does in other occurences.

 mm/slab.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index a23b70f..749c7a9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2477,9 +2477,10 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 			size += BYTES_PER_WORD;
 	}
 #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
-	if (size >= malloc_sizes[INDEX_L3 + 1].cs_size
-	    && cachep->object_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
-		cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
+	if (size >= malloc_sizes[INDEX_L3 + 1].cs_size &&
+	    cachep->object_size > cache_line_size() &&
+	    ALIGN(size, cachep->align) < PAGE_SIZE) {
+		cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
 		size = PAGE_SIZE;
 	}
 #endif
-- 
1.7.11.2

--
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:[~2012-09-19 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 13:08 Haggai Eran [this message]
2012-09-19 19:34 ` David Rientjes

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=1348060101-32288-1-git-send-email-haggaie@mellanox.com \
    --to=haggaie@mellanox.com \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@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