| To: | Andi Kleen <andi@xxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [Patch] Cacheline align xlog_t |
| From: | Timothy Shimmin <tes@xxxxxxx> |
| Date: | Fri, 04 Apr 2008 12:02:06 +1100 |
| Cc: | David Chinner <dgc@xxxxxxx>, Lachlan McIlroy <lachlan@xxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx> |
| In-reply-to: | <20080403064608.GS29105@xxxxxxxxxxxxxxxxxx> |
| References: | <20080401231552.GV103491721@xxxxxxx> <47F3293C.6090708@xxxxxxx> <20080402054403.GF103491721@xxxxxxx> <87myocek4o.fsf@xxxxxxxxxxxxxxxxx> <20080402222347.GK103491721@xxxxxxx> <20080403064608.GS29105@xxxxxxxxxxxxxxxxxx> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Thunderbird 2.0.0.12 (Macintosh/20080213) |
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 |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 6/7] XFS: Native Language Support for Unicode in XFS, David Chinner |
|---|---|
| Next by Date: | Re: [Patch] Cacheline align xlog_t, David Chinner |
| Previous by Thread: | Re: [Patch] Cacheline align xlog_t, Andi Kleen |
| Next by Thread: | Re: [Patch] Cacheline align xlog_t, David Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |