From 5b0274476b1a2bf349d11667fad1c055ee04d248 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 16 Jan 2009 15:31:15 -0800 Subject: [PATCH] --- yaml --- r: 129955 b: refs/heads/master c: 31ad9081200c06ccc350625d41d1f8b2d1cef29f h: refs/heads/master i: 129953: 5fb332cd6f73bfa5e2282198e843931d7c4eac17 129951: 02d577e5c0a8ab9aed5a8c002938b1b4cc8b7072 v: v3 --- [refs] | 2 +- trunk/kernel/workqueue.c | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index a7764cac87f4..de1716b5dc3b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c7f8562a51c2e5dcc1a00a2bdd232b9965ff960d +refs/heads/master: 31ad9081200c06ccc350625d41d1f8b2d1cef29f diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 2f445833ae37..a35afdbc0161 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -991,8 +991,8 @@ static void do_work_for_cpu(struct work_struct *w) * @fn: the function to run * @arg: the function arg * - * This will return -EINVAL in the cpu is not online, or the return value - * of @fn otherwise. + * This will return the value @fn returns. + * It is up to the caller to ensure that the cpu doesn't go offline. */ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) { @@ -1001,14 +1001,8 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) INIT_WORK(&wfc.work, do_work_for_cpu); wfc.fn = fn; wfc.arg = arg; - get_online_cpus(); - if (unlikely(!cpu_online(cpu))) - wfc.ret = -EINVAL; - else { - schedule_work_on(cpu, &wfc.work); - flush_work(&wfc.work); - } - put_online_cpus(); + schedule_work_on(cpu, &wfc.work); + flush_work(&wfc.work); return wfc.ret; }