[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878vfviv1h.fsf@rustcorp.com.au>
Date: Sun, 10 Jun 2012 15:10:42 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>,
Fenghua Yu <fenghua.yu@...el.com>, Ingo Molnar <mingo@...e.hu>,
H Peter Anvin <hpa@...or.com>,
Suresh B Siddha <suresh.b.siddha@...el.com>,
Tony Luck <tony.luck@...el.com>,
Asit K Mallick <asit.k.mallick@...el.com>,
Arjan Dan De Ven <arjan@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
x86 <x86@...nel.org>, linux-pm <linux-pm@...r.kernel.org>,
"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Subject: Re: [PATCH] kthread: Implement park/unpark facility
On Tue, 5 Jun 2012 15:41:48 +0200 (CEST), Thomas Gleixner <tglx@...utronix.de> wrote:
> Subject: kthread: Implement park/unpark facility
> From: Thomas Gleixner <tglx@...utronix.de>
> Date: Wed, 18 Apr 2012 16:37:40 +0200
>
> To avoid the full teardown/setup of per cpu kthreads in the case of
> cpu hot(un)plug, provide a facility which allows to put the kthread
> into a park position and unpark it when the cpu comes online again.
Like the idea, but the API is awkward. Now you've made returning from a
thread do different things depending on whether it was parked or not.
How about just have the thread call "kthread_parkme()" which only
returns if/when the thread is unparked?
So the thread does:
while (!kthread_should_stop()) {
if (kthread_should_park()) {
... cleanup ...
kthread_parkme();
... restore ...
}
... work ...
}
Threads which never exit have "for (;;)" instead of while
(!kthread_should_stop()).
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists