lkml.org 
[lkml]   [2003]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to initialize complex per-cpu variables?
On Thu, Jun 05, 2003 at 09:35:37PM +0000, Perez-Gonzalez, Inaky wrote:
> Now the question is: how do I walk each structure that is
> associated to each CPU - I mean, something like:
>
> struct rtf_h *h;
> for_each_cpu (h, rtf_lh) {
> rtf_h_init (h);
> }

One way to do this would be to do -

for (i = 0; i < NR_CPUS; i++) {
if (cpu_possible(i))
rtf_h_init(&per_cpu(rtf_lh, i));
}


However you might want to actually use the CPU notifiers to do this. See
rcu_init() in kernel/rcupdate.c.

Thanks
Dipankar
-
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: 2005-03-22 13:36    [W:0.037 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site