lkml.org 
[lkml]   [2009]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHSET] percpu: generalize first chunk allocators and improve lpage NUMA support
> I don't think it will be too complex.  The necessary bits are already
> there and they are necessary for other stuff too, so...

Are we looking at a different source base? Here's a random example
using possible per cpu data I picked in current git: icmp.c

static int __net_init icmp_sk_init(struct net *net)
{
int i, err;

net->ipv4.icmp_sk =
kzalloc(nr_cpu_ids * sizeof(struct sock *), GFP_KERNEL);
if (net->ipv4.icmp_sk == NULL)
return -ENOMEM;

for_each_possible_cpu(i) {
... allocate per cpu socket and some other setup ...
}
}

static void __net_exit icmp_sk_exit(struct net *net)
{
int i;

for_each_possible_cpu(i)
inet_ctl_sock_destroy(net->ipv4.icmp_sk[i]);
kfree(net->ipv4.icmp_sk);
net->ipv4.icmp_sk = NULL;
}

You would need to convert that to use a CPU notifier and callbacks
setting up the sockets. Then make sure there are no races in all of
this. And get it somehow tested (where is the user base who
tests cpu hotplug?)

And there is lots of similar code all over the tree

-Andi
--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2009-07-01 08:45    [W:0.153 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site