Re: Q: explicit alignment control for the slab allocator

2001-03-08 Thread Jes Sorensen
> "Manfred" == Manfred Spraul <[EMAIL PROTECTED]> writes: Manfred> First of all HW_CACHEALIGN aligns to the L1 cache, not Manfred> SMP_CACHE_BYTES. Additionally you sometimes need a Manfred> guaranteed alignment for other problems, afaik ARM needs 1024 Manfred> bytes for some structures due

Re: Q: explicit alignment control for the slab allocator

2001-03-07 Thread Manfred Spraul
From: "Jes Sorensen" <[EMAIL PROTECTED]> > > "Manfred" == Manfred Spraul <[EMAIL PROTECTED]> writes: > > Manfred> Mark Hemment wrote: > >> As no one uses the feature it could well be broken, but is that a > >> reason to change its meaning? > > Manfred> Some hardware drivers use HW_CACHEALIGN a

Re: Q: explicit alignment control for the slab allocator

2001-03-07 Thread Jes Sorensen
> "Manfred" == Manfred Spraul <[EMAIL PROTECTED]> writes: Manfred> Mark Hemment wrote: >> As no one uses the feature it could well be broken, but is that a >> reason to change its meaning? Manfred> Some hardware drivers use HW_CACHEALIGN and assume certain Manfred> byte alignments, and arm n

Re: Q: explicit alignment control for the slab allocator

2001-03-02 Thread Manfred Spraul
Mark Hemment wrote: > > > > Hmm, no that note, seen the L1 line size defined for a Pentium ? > > > 128 bytes!! (CONFIG_X86_L1_CACHE_SHIFT of 7). That is probably going to > > > waste a lot of space for small objects. > > > > > No, it doesn't: > > HWCACHE_ALIGN means "do not cross a cache l

Re: Q: explicit alignment control for the slab allocator

2001-03-02 Thread Mark Hemment
On Fri, 2 Mar 2001, Manfred Spraul wrote: > Zitiere Mark Hemment <[EMAIL PROTECTED]>: > > Could be a win on archs with small L1 cache line sizes (16bytes on a > > 486) - but most modern processors have larger lines. > > IIRC cache colouring was introduced for some sun hardware with 2 memory bus

Re: Q: explicit alignment control for the slab allocator

2001-03-02 Thread Manfred Spraul
Zitiere Mark Hemment <[EMAIL PROTECTED]>: > > > > In which cases an offset > alignment is really a win? > > You've got me. :) I don't know. > In the Bonwick paper, such a facility was described, so I thought > "hey, > sounds like that might be useful". > Could be a win on archs with sma

Re: Q: explicit alignment control for the slab allocator

2001-03-02 Thread Mark Hemment
On Thu, 1 Mar 2001, Manfred Spraul wrote: > Yes, I see the difference, but I'm not sure that it will work as > intended. > offset must be a multiple of the alignment, everything else won't work. The code does force the offset to be a multiple of the alignment - rounding the offset up. The ide

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread Manfred Spraul
Mark Hemment wrote: > > On Thu, 1 Mar 2001, Manfred Spraul wrote: > > > Mark Hemment wrote: > > > > > > The original idea behind offset was for objects with a "hot" area > > > greater than a single L1 cache line. By using offset correctly (and to my > > > knowledge it has never been used anyw

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread Mark Hemment
On Thu, 1 Mar 2001, Manfred Spraul wrote: > Mark Hemment wrote: > > > > The original idea behind offset was for objects with a "hot" area > > greater than a single L1 cache line. By using offset correctly (and to my > > knowledge it has never been used anywhere in the Linux kernel), a SLAB >

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread Manfred Spraul
Mark Hemment wrote: > > The original idea behind offset was for objects with a "hot" area > greater than a single L1 cache line. By using offset correctly (and to my > knowledge it has never been used anywhere in the Linux kernel), a SLAB > cache creator (caller of kmem_cache_create()) could a

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread Manfred Spraul
"David S. Miller" wrote: > > Manfred, why are you changing the cache alignment to > SMP_CACHE_BYTES? If you read the original SLAB papers > and other documents, the code intends to color the L1 > cache not the L2 or subsidiary caches. > I'll undo that change. I only found this comment in the so

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread Mark Hemment
On Thu, 1 Mar 2001, Manfred Spraul wrote: > Alan added a CONFIG options for FORCED_DEBUG slab debugging, but there > is one minor problem with FORCED_DEBUG: FORCED_DEBUG disables > HW_CACHEALIGN, and several drivers assume that HW_CACHEALIGN implies a > certain alignment (iirc usb/uhci.c assumes

Re: Q: explicit alignment control for the slab allocator

2001-03-01 Thread David S. Miller
Manfred, why are you changing the cache alignment to SMP_CACHE_BYTES? If you read the original SLAB papers and other documents, the code intends to color the L1 cache not the L2 or subsidiary caches. Later, David S. Miller [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubs

Q: explicit alignment control for the slab allocator

2001-03-01 Thread Manfred Spraul
Alan added a CONFIG options for FORCED_DEBUG slab debugging, but there is one minor problem with FORCED_DEBUG: FORCED_DEBUG disables HW_CACHEALIGN, and several drivers assume that HW_CACHEALIGN implies a certain alignment (iirc usb/uhci.c assumes 16-byte alignment) I've attached a patch that fixe