lkml.org 
[lkml]   [2003]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: How to initialize complex per-cpu variables?
Date

> From: Perez-Gonzalez, Inaky [mailto:inaky.perez-gonzalez@intel.com]
> ...
> 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);
> }

Uh, I think it can be done perfectly as:

on_each_cpu (rtf_h_init, NULL, 1, 1);

with:

rtf_h_init (void *dummy) {
const int cpu = get_cpu();
struct rtf_h *h = per_cpu (rtf_lh, cpu);
/* ... blah ... init the queues */
put_cpu();
}

If I am wrong, pls let me know ...

TIA again

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

-
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.157 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site