linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	Robert Love <rml@tech9.net>,
	dipankar@in.ibm.com
Subject: Re: [patch] Make slab allocator work with SLAB_MUST_HWCACHE_ALIGN
Date: Sun, 14 Sep 2003 13:39:42 +0530	[thread overview]
Message-ID: <20030914080942.GA9302@in.ibm.com> (raw)
In-Reply-To: <3F6378B0.8040606@colorfullife.com>

On Sat, Sep 13, 2003 at 10:06:08PM +0200, Manfred Spraul wrote:
> Ravikiran G Thirumalai wrote:
> > ... 
> >
> Interesting. Slab internally uses lots of large per-cpu arrays. 
> Alltogether something like around 40 kB/cpu. Right now implemented with 
> NR_CPUs pointers. In the long run I'll try to switch to your allocator.
> 
> But back to the patch that started this thread: Do you still need the 
> ability to set an explicit alignment for slab allocations? If yes, then 
> I'd polish my patch, double check all kmem_cache_create callers and then 
> send the patch to akpm. 

No, even the arbitrary aligned patch might not fix the current brokenness
of alloc_percpu, because then we would have to change kmalloc caches
(malloc_sizes[]) to explicity align objects on cacheline boundaries
even for small objects.  And that would be a major change at this stage.
Having different alloc_percpu caches for differnt objects is probably not
such a good thing right now -- this is if we tolerate the extra dereference.
So. IMO, going ahead with a new allocator is a good choice for alloc_percpu.

> Otherwise I'd wait - the patch is not a bugfix.

That said, the reason I see arbitray align patch for 2.6 is:

1. SLAB_MUST_HWCACHELINE_ALIGN is broken.  If I understand the code right,
   it will result in BYTES_PER_WORD alignment.  This means there can be false
   sharing between two task_structs depending on the slab calculations
   and there is an atomic_t at the beginning of the task_struct.
   This has to be fixed.
2. The fix should not change the way kmalloc caches currently work, i.e
   by sharing cachelines for small objects.  Later benchmarks might 
   prove that it might not be good to share cachelines for kmalloc, but 
   for now we don't know.
3. IMHO its not right that SLAB_HWCACHE_ALIGN is taken as a hint and not
   as a directive.  It is misleading.  I don't like the fact that the
   allocator can reduce the alignment. IMHO, alignment decisions should be left
   to the user.  
4. There are already requirements from users for arbitrary alignment as you'd
   mentioned in earlier mails in this thread. I guess such requirements will
   go up as 2.6 matures, so it is a good idea to provide alignment upto 
   PAGE alignment.

The patch I posted earlier takes care of 1 & 2, but arbitraty alignment takes
care of all 4, and as you mentioned the patch is small enough.  If interface
change is a concern for 2.6, then IMHO the interface is broken anyways...who
uses offset parameter to specify coloring offsets????  IMHO, Slab 
offset colour should be slab calculation based and if needed arch based.
added to that SLAB_HWCACHE_ALIGN name itself is broken anyways.   Clearly
we should not wait for 2.7 for these fixes, if so now is the good time
right?  This is just my opinion.  It is left to akpm and you to decide....


Thanks,
Kiran

  parent reply	other threads:[~2003-09-14  7:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10  8:16 How reliable is SLAB_HWCACHE_ALIGN? Ravikiran G Thirumalai
2003-09-10 15:41 ` Robert Love
2003-09-11  5:54   ` Ravikiran G Thirumalai
2003-09-11 11:08     ` [patch] Make slab allocator work with SLAB_MUST_HWCACHE_ALIGN Ravikiran G Thirumalai
2003-09-11 16:19       ` Manfred Spraul
2003-09-11 21:49         ` Manfred Spraul
2003-09-12  8:59         ` Ravikiran G Thirumalai
2003-09-12  9:10           ` Arjan van de Ven
2003-09-13 20:06           ` Manfred Spraul
2003-09-13 20:58             ` Dipankar Sarma
2003-09-14  8:09             ` Ravikiran G Thirumalai [this message]
2003-09-14 13:00               ` Dipankar Sarma
2003-09-15  5:13                 ` Ravikiran G Thirumalai
     [not found] <u8mV.so.19@gated-at.bofh.it>
     [not found] ` <ufor.30e.21@gated-at.bofh.it>
     [not found]   ` <usvj.6s9.17@gated-at.bofh.it>
     [not found]     ` <uxv1.5D5.23@gated-at.bofh.it>
     [not found]       ` <uCuI.5hY.13@gated-at.bofh.it>
     [not found]         ` <uRWI.xK.5@gated-at.bofh.it>
     [not found]           ` <voSF.8l7.17@gated-at.bofh.it>
2003-09-13 22:18             ` Arnd Bergmann

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=20030914080942.GA9302@in.ibm.com \
    --to=kiran@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=rml@tech9.net \
    /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;
as well as URLs for NNTP newsgroup(s).