On Thu, May 30, 2002 at 08:56:36AM -0500, Mala Anand wrote:
>>
>> [email protected]
>> m To: BALBIR
SINGH <[email protected]>
>>
>>The per-cpu data allocator allocates one copy for *each* CPU.
>> >It uses the slab allocator underneath. Eventually, when/if we have
>> >per-cpu/numa-node slab allocation, the per-cpu data allocator
>> >can allocate every CPU's copy from memory closest to it.
>>
>> Does this mean that memory allocation will happen in "each" CPU?
>> Do slab allocator allocate the memory in each cpu? Your per-cpu
>> data allocator sounds like the hot list skbs that are in the tcpip stack
>> in the sense it is one level above the slab allocator and the list is
>> kept per cpu. If slab allocator is fixed for per cpu, do you still
>> need this per-cpu data allocator?
>Actually I don't know for sure what plans are afoot to fix the slab
allocator
>for per-cpu. One plan I heard about was allocating from per-cpu pools
>rather than per-cpu copies. My requirements are similar to
>the hot list skbs. I want to do this -
I looked at the slab code, per cpu slab is already implemented by Manfred
Spraul.
Look at cpu_data[NR_CPUS] in kmem_cache_s structure.
Regards,
Mala
Mala Anand
E-mail:[email protected]
Linux Technology Center - Performance
Phone:838-8088; Tie-line:678-8088
On Mon, Jun 03, 2002 at 02:12:29PM -0500, Mala Anand wrote:
> I looked at the slab code, per cpu slab is already implemented by Manfred
> Spraul.
> Look at cpu_data[NR_CPUS] in kmem_cache_s structure.
>
Sorry, I should have been more clear saying what I wanted.
Yes, kmem_cache_alloc() allocates one object from "this" CPU's slabs. What
I want is a kmalloc_percupu() that allocates one copy for every
CPU in the system. Think of this as dynamically allocacting an
array of NR_CPUS objects with objects residing on different cachelines.
Thanks
--
Dipankar Sarma <[email protected]> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.