Re: [patch] sched: prevent bound kthreads from changing cpus_allowed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Rientjes
Date: Thursday, June 5, 2008 - 2:12 pm

On Thu, 5 Jun 2008, Paul Jackson wrote:


Not in the drivers/pci/pci-driver.c case because the setting of 
cpus_allowed to nodecpumask is only temporary (as is the disabling of the 
mempolicy).  It's just done for the probe callback and then reset to the 
old cpumask.  So any migration here would be lost.

I can't speculate about the net/sunrpc/svc.c case because I don't know if 
user migration is harmful or discouraged.  The behavior with my patch is 
the same for any calls to set_cpus_allowed_ptr() for tasks that haven't 
called kthread_bind(), so I'll leave that decision up to those who know 
best for this networking code.


This particular case is simply moving the thread to any online cpu so that 
it survives long enough for the subsequent kthread_stop() in 
destroy_comp_task().  So I don't see a problem with this instance.

A caller to kthread_bind() can always remove PF_THREAD_BOUND itself upon 
return, but I haven't found any cases in the tree where that is currently 
necessary.  And doing that would defeat the semantics of kthread_bind() 
where these threads are supposed to be bound to a specific cpu and not 
allowed to run on others.

		David
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] sched: prevent bound kthreads from changing cp ..., David Rientjes, (Thu Jun 5, 2:12 pm)
cpusets and kthreads, inconsistent behaviour, Max Krasnyansky, (Tue Jun 10, 9:30 am)
Re: cpusets and kthreads, inconsistent behaviour, David Rientjes, (Tue Jun 10, 11:47 am)
workqueue cpu affinity, Max Krasnyansky, (Tue Jun 10, 1:24 pm)
Re: cpusets and kthreads, inconsistent behaviour, Max Krasnyansky, (Tue Jun 10, 1:44 pm)
Re: cpusets and kthreads, inconsistent behaviour, David Rientjes, (Tue Jun 10, 1:54 pm)
Re: cpusets and kthreads, inconsistent behaviour, Max Krasnyansky, (Tue Jun 10, 2:15 pm)
Re: workqueue cpu affinity, Peter Zijlstra, (Tue Jun 10, 11:49 pm)
Re: workqueue cpu affinity, Oleg Nesterov, (Wed Jun 11, 9:08 am)
Re: workqueue cpu affinity, Max Krasnyansky, (Wed Jun 11, 12:02 pm)
Re: workqueue cpu affinity, Max Krasnyansky, (Wed Jun 11, 12:21 pm)
Re: workqueue cpu affinity, Max Krasnyansky, (Wed Jun 11, 12:21 pm)
Re: workqueue cpu affinity, Max Krasnyansky, (Wed Jun 11, 1:44 pm)
Re: workqueue cpu affinity, Oleg Nesterov, (Thu Jun 12, 9:35 am)