public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Paul Mundt <lethal@Linux-SH.ORG>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARCH_SLAB_MINALIGN for 2.6.10-rc3
Date: Mon, 06 Dec 2004 23:15:20 +0100	[thread overview]
Message-ID: <41B4D9F8.6000309@colorfullife.com> (raw)
In-Reply-To: <20041205222001.GB25689@linux-sh.org>

Paul Mundt wrote:

>Hi Manfred,
>
>On Sun, Dec 05, 2004 at 10:30:46PM +0100, Manfred Spraul wrote:
>  
>
>>>--- orig/include/asm-sh64/uaccess.h
>>>+++ mod/include/asm-sh64/uaccess.h
>>>@@ -313,6 +313,12 @@
>>>  sh64 at the moment). */
>>>#define ARCH_KMALLOC_MINALIGN 8
>>>
>>>+/*
>>>+ * We want 8-byte alignment for the slab caches as well, otherwise we have
>>>+ * the same BYTES_PER_WORD (sizeof(void *)) min align in 
>>>kmem_cache_create().
>>>+ */
>>>+#define ARCH_SLAB_MINALIGN 8
>>>+
>>>
>>>
>>>      
>>>
>>Could you make that dependant on !CONFIG_DEBUG_SLAB? Setting align to a 
>>non-zero value disables some debug code.
>>
>>    
>>
>align is only being set to ARCH_SLAB_MINALIGN in kmem_cache_create()
>where it is otherwise being set to BYTES_PER_WORD as a default. Unless I
>am missing something, that will always set it non-zero irregardless of
>whether ARCH_SLAB_MINALIGN is set.
>
>  
>
No, you are right. I didn't read the source carefully enough.
Now that I have reread it, I see one problem:
ARCH_KMALLOC_MINALIGN is a hard limit: It's always honored, the only 
exception is that values larger than the kmalloc block size are ignored. 
I.e. _MINALIGN 32 guarantees that the objects are 32-byte aligned (since 
the smallest block size is 32-bytes). The define was added, because some 
archs really need a certain alignment, otherwise they won't boot. The 
normal alignment for kmalloc caches is cache line alignment, except with 
CONFIG_DEBUG_SLAB, then it's word alignment.

With your patch, ARCH_SLAB_MINALIGN is not a hard limit: A few lines 
further down align is reset to word size if SLAB_RED_ZONE is set. I 
don't like the asymmetry - it just asks for trouble.

I must think about it. Perhaps just rename ARCH_SLAB_MINALIGN to 
ARCH_SLAB_DEFAULTALIGN.

--
    Manfred

  reply	other threads:[~2004-12-06 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-05 21:30 [PATCH] ARCH_SLAB_MINALIGN for 2.6.10-rc3 Manfred Spraul
2004-12-05 22:20 ` Paul Mundt
2004-12-06 22:15   ` Manfred Spraul [this message]
2004-12-06 22:59     ` Paul Mundt
2004-12-12 10:48       ` Manfred Spraul
2004-12-12 15:09         ` Paul Mundt
2004-12-13 21:18           ` Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2004-12-05 18:25 Paul Mundt

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=41B4D9F8.6000309@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=lethal@Linux-SH.ORG \
    --cc=linux-kernel@vger.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