lkml.org 
[lkml]   [2006]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 3/4] net: Percpufy frequently used variables -- proto.sockets_allocated
Ravikiran G Thirumalai a écrit :
> On Fri, Jan 27, 2006 at 11:30:23PM +0100, Eric Dumazet wrote:
>> There are several issues here :
>>
>> alloc_percpu() current implementation is a a waste of ram. (because it uses
>> slab allocations that have a minimum size of 32 bytes)
>
> Oh there was a solution for that :).
>
> http://lwn.net/Articles/119532/
>
> I can quickly revive it if there is interest.
>

Well, nice work ! :)

Maybe a litle bit complicated if expected percpu space is 50 KB per cpu ?

Why not use a boot time allocated percpu area (as done today in
setup_per_cpu_areas()), but instead of reserving extra space for module's
percpu data, being able to serve alloc_percpu() from this reserved area (ie no
kmalloced data anymore), and keeping your

#define per_cpu_ptr(ptr, cpu) ((__typeof__(ptr)) \
(RELOC_HIDE(ptr, PCPU_BLKSIZE * cpu)))

Some code from kernel/module.c could be reworked to serve both as an allocator
when a module percpudata must be relocated (insmod)/freed (rmmod), and serve
alloc_percpu() for 'dynamic allocations'

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-28 00:23    [W:0.061 / U:1.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site