[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120926181230.GC12544@google.com>
Date: Wed, 26 Sep 2012 11:12:30 -0700
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, tangchen <tangchen@...fujitsu.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 02/12] workqueue: disallow set_cpus_allowed_ptr() from
work item
On Thu, Sep 27, 2012 at 01:20:33AM +0800, Lai Jiangshan wrote:
> workers depend on local-wake-up, if a work function change its CPU, it will
> corrupt workqueue, disallow this behavior.
>
> When set_cpus_allowed_ptr() is called from workqueue.c in worker_thread(),
> we clear the PF_WQ_WORKER before set_cpus_allowed_ptr() and set it back
> after. (rescuer thread has no PF_WQ_WORKER, skip this behavior)
>
> It prevents other/future BUGs like https://bugzilla.kernel.org/show_bug.cgi?id=47301.
Hmmm... maybe. We better clear up PF_THREAD_BOUND semantics first
tho.
I think the two possible choices are,
* Don't allow set_cpus_allowed_ptr() at all and make the caller
responsible for turning it off if it explicitly wants to change
cpus_allowed.
* Don't allow changing affinity from userland.
Peter, Thomas?
--
tejun
--
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