kthread_create
Quoted 11 lines
(quoted diff) +11
-0+struct task_struct *kthread_create(int (*initfn)(void *data), + int (*corefn)(void *data), + void *data, + const char namefmt[], + ...) +{ + va_list args; + struct kthread_create kc; + DECLARE_WORK(work, spawn_kthread, &kc); + /* Or, as we like to say, 16. */ + char name[sizeof(((struct task_struct *)0)->comm)];
Review
Quoted 10 lines
(quoted diff) +10
-0+ + va_start(args, namefmt); + vsnprintf(name, sizeof(name), namefmt, args); + va_end(args); + + init_completion(&kc.done); + kc.k.initfn = initfn; + kc.k.corefn = corefn; + kc.k.data = data; + kc.k.name = name;
Since processor ID info is available, there's no need for per-CPU naming. (I do realize it may be per-disk or per-filesystem though)
With the huge NUMA boxes, a simple "ps -ef" is going to look insane. How about task groups for them? Then the various threads wind up being seen as just that, threads.
BTW, some (p->pid==0) tests may need to become (p->tgid==0) tests instead.