linux-mips
[Top] [All Lists]

Re: kmalloc alignment

To: ralf@linux-mips.org
Subject: Re: kmalloc alignment
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 20 Oct 2004 14:56:25 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20041019165901.GA18385@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20041019.235129.25480859.anemo@mba.ocn.ne.jp> <20041019165901.GA18385@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
>>>>> On Tue, 19 Oct 2004 18:59:01 +0200, Ralf Baechle <ralf@linux-mips.org> 
>>>>> 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>