Re: [PATCH] swap migration: Fix lru drain

From: Andrew Morton
Date: Wed Dec 07 2005 - 19:55:36 EST


Christoph Lameter <clameter@xxxxxxxxxxxx> wrote:
>
> +int schedule_on_each_cpu(void (*func) (void *info), void *info)
> +{
> + int cpu;
> + struct work_struct *work;
> +
> + work = kmalloc(NR_CPUS * sizeof(struct work_struct), GFP_KERNEL);
> +
> + if (!work)
> + return 0;
> + for_each_online_cpu(cpu) {
> + INIT_WORK(work + cpu, func, info);
> + __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu),
> + work + cpu);
> + }
> + flush_workqueue(keventd_wq);
> + kfree(work);
> + return 1;
> +}

I'll change this to return 0 on success, or -ENOMEM. Bit more
conventional, no?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/