All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: David Chinner <dgc@sgi.com>, Lachlan McIlroy <lachlan@sgi.com>,
	xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [Patch] Cacheline align xlog_t
Date: Fri, 04 Apr 2008 12:02:06 +1100	[thread overview]
Message-ID: <47F57E0E.7010700@sgi.com> (raw)
In-Reply-To: <20080403064608.GS29105@one.firstfloor.org>

Andi Kleen wrote:
> On Thu, Apr 03, 2008 at 08:23:47AM +1000, David Chinner wrote:
>>> For the dynamic allocation you would rather need to make sure it
>>> starts at a cache line boundary explicitely because the allocator doesn't
>>> know the alignment of the target type, otherwise your careful
>>> padding might be useless.
> 
>> There isn't one, right?
> 
> You can always align yourself with kmalloc (or any other arbitary 
> size allocator) with the standard technique:
> get L1_CACHE_BYTES-1 or possibly better cache_line_size() - 1 bytes
> more and then align the pointer manually with ALIGN. Only tricky part
> is that you have to undo the alignment before freeing.
> 
Yeah, how do you know how much was offset for the alignment
to go back for the freeing. I guess you could also keep the original pointer
or the offset handy (a pain). Or can the allocator help out?

--Tim

  reply	other threads:[~2008-04-04  1:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 23:15 [Patch] Cacheline align xlog_t David Chinner
2008-04-02  6:35 ` Lachlan McIlroy
2008-04-02  5:44   ` David Chinner
2008-04-02  8:28     ` Andi Kleen
2008-04-02 22:23       ` David Chinner
2008-04-03  6:46         ` Andi Kleen
2008-04-04  1:02           ` Timothy Shimmin [this message]
2008-04-04  1:18           ` David Chinner

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=47F57E0E.7010700@sgi.com \
    --to=tes@sgi.com \
    --cc=andi@firstfloor.org \
    --cc=dgc@sgi.com \
    --cc=lachlan@sgi.com \
    --cc=xfs-dev@sgi.com \
    --cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.