lkml.org 
[lkml]   [2007]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] make schedule_on_each_cpu() look like on_each_cpu()
On 07/26, Peter Zijlstra wrote:
>
> -int schedule_on_each_cpu(work_func_t func)
> +int schedule_on_each_cpu(void (*func)(void *info), void *info, int retry, int wait)
> {
> int cpu;
> - struct work_struct *works;
> + struct schedule_on_each_cpu_work **works;
> + int err = 0;
>
> - works = alloc_percpu(struct work_struct);
> + works = kzalloc(sizeof(void *)*nr_cpu_ids, GFP_KERNEL);

Not a comment, but a question: why do we need nr_cpu_ids at all?
num_possible_cpus() looks more "correct" if cpu_possible_map has
holes (not sure this can happen in practice).

Another off-topic question: shouldn't we kill the unused "retry"
parameter of on_each_cpu() instead of mirroring it here?

> +out:
> + for_each_possible_cpu(cpu) {
> + if (works[cpu])
> + kfree(works[cpu]);
> + }

Small nit, kfree(NULL) is OK.

Oleg.

-
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: 2007-07-26 20:31    [W:0.049 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site