From patchwork Thu Feb 12 17:47:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peppe CAVALLARO X-Patchwork-Id: 6881 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1CHBmWX010605 for ; Thu, 12 Feb 2009 17:11:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759212AbZBLRLr (ORCPT ); Thu, 12 Feb 2009 12:11:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759146AbZBLRLr (ORCPT ); Thu, 12 Feb 2009 12:11:47 -0500 Received: from eu1sys200aog110.obsmtp.com ([207.126.144.129]:59485 "EHLO eu1sys200aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758817AbZBLRLq (ORCPT ); Thu, 12 Feb 2009 12:11:46 -0500 X-Greylist: delayed 1433 seconds by postgrey-1.27 at vger.kernel.org; Thu, 12 Feb 2009 12:11:45 EST Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKSZRYUFPvdKBkuTzUFCbggwiZ2Y/n/Mup@postini.com; Thu, 12 Feb 2009 17:11:45 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5F61BDA8F; Thu, 12 Feb 2009 16:47:06 +0000 (GMT) Received: from mail3.ctn.st.com (mail3.ctn.st.com [164.130.116.150]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 94E634C55A; Thu, 12 Feb 2009 16:47:47 +0000 (GMT) Received: from localhost (mdt-dhcp43.ctn.st.com [10.52.139.43]) by mail3.ctn.st.com (MOS 3.8.7a) with ESMTP id CRB61661 (AUTH cavagiu); Thu, 12 Feb 2009 17:47:45 +0100 (CET) From: Giuseppe CAVALLARO To: linux-kernel-owner@vger.kernel.org Cc: linux-sh@vger.kernel.org, Giuseppe Cavallaro Subject: [PATCH] slab: fix slab flags for archs use alignment larger 64-bit Date: Thu, 12 Feb 2009 18:47:28 +0100 Message-Id: <1234460848-23253-1-git-send-email-peppe.cavallaro@st.com> X-Mailer: git-send-email 1.5.6.6 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org I think, this fix is necessary for all the architectures want to perform DMA into kmalloc caches and need a guaranteed alignment larger than the alignment of a 64-bit integer. An example is sh architecture where ARCH_KMALLOC_MINALIGN is L1_CACHE_BYTES. As side effect, these kind of objects cannot be visible within the /proc/slab_allocators file. Signed-off-by: Giuseppe Cavallaro --- mm/slab.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index ddc41f3..031d785 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2262,7 +2262,7 @@ kmem_cache_create (const char *name, size_t size, size_t align, ralign = align; } /* disable debug if necessary */ - if (ralign > __alignof__(unsigned long long)) + if (ralign > ARCH_KMALLOC_MINALIGN) flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); /* * 4) Store it.