[Top] [All Lists]

Re: kmalloc alignment

Subject: Re: kmalloc alignment
From: Atsushi Nemoto <>
Date: Wed, 20 Oct 2004 14:56:25 +0900 (JST)
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
>>>>> On Tue, 19 Oct 2004 18:59:01 +0200, Ralf Baechle <> 
>>>>> said:
ralf> The alignment needs to be large enough to store an arbitrary
ralf> fundamental data type including the 64-bit types such as long
ralf> long or double.

ralf> cache_line_size() is only used if a slab has SLAB_HWCACHE_ALIGN
ralf> set.

SLAB_HWCACHE_ALIGN is default ARCH_KMALLOC_FLAGS, so normal kmalloc
will use cache_line_size() (if no ARCH_KMALLOC_MINALIGN).

ralf> The alignment requirements are documented in
ralf> Documentation/DMA-API.txt and they are specified the way they
ralf> are for good reason.

Hmm... I had been thought of many PCI ether driver (which maps
skbuff), but I found skb_init() calls kmem_cache_create with
SLAB_HWCACHE_ALIGN.  Maybe I should learn much about it...  Thank you.

<Prev in Thread] Current Thread [Next in Thread>