From: Andrea Arcangeli <andrea@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Manfred Spraul <manfred@colorfullife.com>,
agruen@suse.de, linux-kernel@vger.kernel.org
Subject: Re: slab-alignment-rework.patch in -mc
Date: Tue, 20 Apr 2004 16:49:37 +0200 [thread overview]
Message-ID: <20040420144937.GG29954@dualathlon.random> (raw)
In-Reply-To: <20040420002423.469cca01.akpm@osdl.org>
On Tue, Apr 20, 2004 at 12:24:23AM -0700, Andrew Morton wrote:
> So I do think that we should either make "align=0" translate to "pack them
> densely" or do the big sweep across all kmem_cache_create() callsites.
agreed.
> If the latter, while we're there, let's remove SLAB_HWCACHE_ALIGN where it
> isn't obviously appropriate. I'd imagine that being able to fit more inodes
> into memory is a net win over the occasional sharing effect, for example.
One warning here, false sharing here isn' the only reason for hw
alignment, for structures like inodes or other things often are coded
packing the fields used at the same time together in the same cacheline,
this pratically can reduce the cache utilization to 1 cacheline instead
of 2 cachelines at runtime (even if there's no false sharing at all
because the structure is much bigger than the l1 size anyways).
So the hardware alignment should be removed with care looking the layout
of the structures and evaluating if we're losing cacheline packing. For
example the task_struct definitely must be fully l1 aligned, not because
of false sharing issues that are probably non existent in the task
struct anyways, but because most important fileds in the task struct
are packed to maximize the cache utilization at runtime.
For 12 bytes small things including locks like anon-vma the false
sharing is the biggest issue (but still it doesn't worth to l1 align it
in the anon-vma case), for buffer headers and task_structs the cacheline
packing provided by the l1 alignment of the structure is the primary
reason for wanting an l1 alignment. Each case should be evaluated
separately.
next prev parent reply other threads:[~2004-04-20 14:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1082383751.6746.33.camel@f235.suse.de>
2004-04-19 16:25 ` slab-alignment-rework.patch in -mc Andrea Arcangeli
2004-04-19 16:42 ` Manfred Spraul
2004-04-20 0:26 ` Andrea Arcangeli
2004-04-20 7:24 ` Andrew Morton
2004-04-20 14:49 ` Andrea Arcangeli [this message]
2004-04-20 17:23 ` Manfred Spraul
2004-04-20 18:25 ` Andrew Morton
2004-04-20 18:52 ` Linus Torvalds
2004-04-21 17:22 ` Manfred Spraul
2004-04-21 21:46 ` Andrew Morton
2004-04-20 18:53 ` Arjan van de Ven
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=20040420144937.GG29954@dualathlon.random \
--to=andrea@suse.de \
--cc=agruen@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.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