Re: block: use kmalloc alignment for bio slab

2014-04-07 Thread Jens Axboe
On 04/07/2014 12:15 PM, Mike Snitzer wrote: On Wed, Apr 02 2014 at 2:04pm -0400, Mike Snitzer wrote: From: Mikulas Patocka Various subsystems can ask the bio subsystem to create a bio slab cache with some free space before the bio. This free space can be used for any purpose. Device mappe

Re: block: use kmalloc alignment for bio slab

2014-04-07 Thread Mike Snitzer
On Wed, Apr 02 2014 at 2:04pm -0400, Mike Snitzer wrote: > From: Mikulas Patocka > > Various subsystems can ask the bio subsystem to create a bio slab cache > with some free space before the bio. This free space can be used for any > purpose. Device mapper uses this per-bio-data feature to p

[PATCH] block: use kmalloc alignment for bio slab

2014-04-02 Thread Mike Snitzer
From: Mikulas Patocka Various subsystems can ask the bio subsystem to create a bio slab cache with some free space before the bio. This free space can be used for any purpose. Device mapper uses this per-bio-data feature to place some target-specific and device-mapper specific data before the b

Re: kmalloc() alignment

2001-03-06 Thread Alan Cox
> > There are people who assume 16byte alignment guarantees. I dont think anyone > > has formally specified the guarantee beyond 4 bytes tho > > Userspace malloc is "suitably aligned for any kind of variable", so I think > expecting 8 bytes alignment (long long on 32-bit platforms) should be okay

Re: kmalloc() alignment

2001-03-06 Thread Xavier Bestel
Le 06 Mar 2001 09:31:01 +0100, Rogier Wolff a écrit : > > > Followup to: <[EMAIL PROTECTED]> > > By author:Kenn Humborg <[EMAIL PROTECTED]> > > In newsgroup: linux.dev.kernel > > > > > > On Sun, Mar 04, 2001 at 11:41:12PM +0100, Manfred Spraul wrote: > > > > > > > > > > Does kmalloc() make a

Re: kmalloc() alignment

2001-03-06 Thread Philipp Rumpf
On Sun, Mar 04, 2001 at 10:34:31PM +, Alan Cox wrote: > > Does kmalloc() make any guarantees of the alignment of allocated > > blocks? Will the returned block always be 4-, 8- or 16-byte > > aligned, for example? > > There are people who assume 16byte alignment guarantees. I dont think anyon

Re: kmalloc() alignment

2001-03-06 Thread Rogier Wolff
> Followup to: <[EMAIL PROTECTED]> > By author:Kenn Humborg <[EMAIL PROTECTED]> > In newsgroup: linux.dev.kernel > > > > On Sun, Mar 04, 2001 at 11:41:12PM +0100, Manfred Spraul wrote: > > > > > > > > Does kmalloc() make any guarantees of the alignment of allocated > > > > blocks? Will the

Re: kmalloc() alignment

2001-03-05 Thread H. Peter Anvin
Alan Cox wrote: > > > > It might be worth asking the question if larger blocks are more > > > aligned? > > > > OK, I'll bite... > > Are larger blocks more aligned? > > Only get_free_page() > I wonder if it would be practical/reasonable to guarantee better alignment for larger allocations (at l

Re: kmalloc() alignment

2001-03-05 Thread Alan Cox
> > It might be worth asking the question if larger blocks are more > > aligned? > > OK, I'll bite... > Are larger blocks more aligned? Only get_free_page() Alan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordo

Re: kmalloc() alignment

2001-03-05 Thread Kenn Humborg
On Mon, Mar 05, 2001 at 04:15:36PM -0800, H. Peter Anvin wrote: > > So, to summarise (for 32-bit CPUs): > > > > o Alan Cox & Manfred Spraul say 4-byte alignment is guaranteed. > > > > o If you need larger alignment, you need to alloc a larger space, > >round as necessary, and keep the orig

Re: kmalloc() alignment

2001-03-05 Thread H. Peter Anvin
Followup to: <[EMAIL PROTECTED]> By author:Kenn Humborg <[EMAIL PROTECTED]> In newsgroup: linux.dev.kernel > > On Sun, Mar 04, 2001 at 11:41:12PM +0100, Manfred Spraul wrote: > > > > > > Does kmalloc() make any guarantees of the alignment of allocated > > > blocks? Will the returned block al

Re: kmalloc() alignment

2001-03-05 Thread Kenn Humborg
On Sun, Mar 04, 2001 at 11:41:12PM +0100, Manfred Spraul wrote: > > > > Does kmalloc() make any guarantees of the alignment of allocated > > blocks? Will the returned block always be 4-, 8- or 16-byte > > aligned, for example? > > > > 4-byte alignment is guaranteed on 32-bit cpus, 8-byte align

Re: kmalloc() alignment

2001-03-05 Thread Rogier Wolff
Alan Cox wrote: > > As far as I know, you can count on 16-bytes alignment from > > kmalloc. The trouble is that you would have to keep the original > > Actually it depends on the debug settings Actually THAT's a bug in the debug stuff Roger. -- ** [EMAIL PROTECTED] ** ht

Re: kmalloc() alignment

2001-03-05 Thread Alan Cox
> As far as I know, you can count on 16-bytes alignment from > kmalloc. The trouble is that you would have to keep the original Actually it depends on the debug settings - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More

Re: kmalloc() alignment

2001-03-05 Thread Rogier Wolff
Alan Cox wrote: > > Does kmalloc() make any guarantees of the alignment of allocated > > blocks? Will the returned block always be 4-, 8- or 16-byte > > aligned, for example? > There are people who assume 16byte alignment guarantees. I dont > think anyone has formally specified the guarantee be

Re: kmalloc() alignment

2001-03-04 Thread Manfred Spraul
> > Does kmalloc() make any guarantees of the alignment of allocated > blocks? Will the returned block always be 4-, 8- or 16-byte > aligned, for example? > 4-byte alignment is guaranteed on 32-bit cpus, 8-byte alignment on 64-bit cpus. -- Manfred - To unsubscribe from this list: send

Re: kmalloc() alignment

2001-03-04 Thread Alan Cox
> Does kmalloc() make any guarantees of the alignment of allocated > blocks? Will the returned block always be 4-, 8- or 16-byte > aligned, for example? There are people who assume 16byte alignment guarantees. I dont think anyone has formally specified the guarantee beyond 4 bytes tho - To unsub

kmalloc() alignment

2001-03-04 Thread Kenn Humborg
Does kmalloc() make any guarantees of the alignment of allocated blocks? Will the returned block always be 4-, 8- or 16-byte aligned, for example? Later, Kenn - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo