public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Mark Hemment <markhe@veritas.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Q: explicit alignment control for the slab allocator
Date: Fri, 02 Mar 2001 14:22:06 +0100	[thread overview]
Message-ID: <3A9F9E7E.37661415@colorfullife.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0103021218080.11260-100000@alloc>

Mark Hemment wrote:
> 
> > >   Hmm, no that note, seen the L1 line size defined for a Pentium IIII?
> > > 128 bytes!! (CONFIG_X86_L1_CACHE_SHIFT of 7).  That is probably going to
> > > waste a lot of space for small objects.
> > >
> > No, it doesn't:
> > HWCACHE_ALIGN means "do not cross a cache line boundary".
> 
>   Ah, I broke my code!!!!! :(
> 
>   In my original slab, the code to do "packing" of objects into a single
> cache line was #if-def'ed out for SMP to avoid the possibility of
> false-sharing between objects.  Not a large possibility, but it exists.
>
But then you need SMP_CACHE_BYTES, not L1_CACHE_BYTES.
And 128 byte aligning the 32-byte kmalloc cache wastes too much memory
;-)

If the caller of kmem_cache_create really wants do avoid false sharing
he could set align to SMP_CACHE_BYTES. (e.g. for some per-cpu data
structures)

> > Even if the hot zone is larger than the default offset, is there any advantage
> > of increasing the colour offset beyond the alignment?
> >
> > I don't see an advantage.
> 
>   I do, but like you, I don't have any data to prove my point.
>   Time to get profiling?
>

How? You've already noticed that noone in the linux kernel uses offset.

--	
	Manfred

  reply	other threads:[~2001-03-02 13:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-01 17:26 Q: explicit alignment control for the slab allocator Manfred Spraul
2001-03-01 18:09 ` Mark Hemment
2001-03-01 19:55   ` Manfred Spraul
2001-03-01 20:28     ` Mark Hemment
2001-03-01 21:55       ` Manfred Spraul
2001-03-02 10:59         ` Mark Hemment
2001-03-02 11:51           ` Manfred Spraul
2001-03-02 12:39             ` Mark Hemment
2001-03-02 13:22               ` Manfred Spraul [this message]
2001-03-07 20:02     ` Jes Sorensen
2001-03-07 20:32       ` Manfred Spraul
2001-03-08 17:30         ` Jes Sorensen
2001-03-01 19:22 ` David S. Miller
2001-03-01 19:47   ` Manfred Spraul

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=3A9F9E7E.37661415@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markhe@veritas.com \
    /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