Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-28 Thread Rusty Russell
On Sun, 2007-08-26 at 01:09 -0700, Andrew Morton wrote: > On Sun, 26 Aug 2007 10:47:24 +1000 Rusty Russell <[EMAIL PROTECTED]> wrote: > > Userspace is not monolithic. If you refuse to take a CPU offline > > because a task is affine, then any user can prevent a CPU from going > > offline. > >

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-28 Thread Rusty Russell
On Sun, 2007-08-26 at 01:09 -0700, Andrew Morton wrote: On Sun, 26 Aug 2007 10:47:24 +1000 Rusty Russell [EMAIL PROTECTED] wrote: Userspace is not monolithic. If you refuse to take a CPU offline because a task is affine, then any user can prevent a CPU from going offline. That's a

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-26 Thread Andrew Morton
On Sun, 26 Aug 2007 10:47:24 +1000 Rusty Russell <[EMAIL PROTECTED]> wrote: > On Sun, 2007-08-26 at 05:46 +0530, Gautham R Shenoy wrote: > > On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: > > > Before this patch, process leaves its ->cpuset and migrates to some > > > "random" > >

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-26 Thread Andrew Morton
On Sun, 26 Aug 2007 10:47:24 +1000 Rusty Russell [EMAIL PROTECTED] wrote: On Sun, 2007-08-26 at 05:46 +0530, Gautham R Shenoy wrote: On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: Before this patch, process leaves its -cpuset and migrates to some random

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Rusty Russell
On Sun, 2007-08-26 at 05:46 +0530, Gautham R Shenoy wrote: > On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: > > Before this patch, process leaves its ->cpuset and migrates to some "random" > > any_online_cpu(). With this patch it stays within ->cpuset and migrates to > > CPU 3. >

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Gautham R Shenoy
On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: > On 08/24, Andrew Morton wrote: > > > > On Fri, 24 Aug 2007 17:18:06 -0500 > > Cliff Wickman <[EMAIL PROTECTED]> wrote: > > > > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > > > that have been running on

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Cliff Wickman wrote: > > @@ -5091,6 +5092,17 @@ restart: > if (dest_cpu == NR_CPUS) > dest_cpu = any_online_cpu(p->cpus_allowed); > > + /* try to stay on the same cpuset */ > + if (dest_cpu == NR_CPUS) { > + /* > + * The

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Cliff Wickman wrote: > --- linus.070821.orig/kernel/cpuset.c > +++ linus.070821/kernel/cpuset.c > @@ -2333,6 +2333,25 @@ cpumask_t cpuset_cpus_allowed(struct tas > return mask; > } > > +/** > + * cpuset_cpus_allowed_lock - return cpus_allowed mask from a tasks cpuset. > + *

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Andrew Morton wrote: > > On Fri, 24 Aug 2007 17:18:06 -0500 > Cliff Wickman <[EMAIL PROTECTED]> wrote: > > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > > that have been running on that cpu. > > > > Currently, such a task is migrated: > > 1) to any cpu on

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Andrew Morton wrote: On Fri, 24 Aug 2007 17:18:06 -0500 Cliff Wickman [EMAIL PROTECTED] wrote: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Cliff Wickman wrote: --- linus.070821.orig/kernel/cpuset.c +++ linus.070821/kernel/cpuset.c @@ -2333,6 +2333,25 @@ cpumask_t cpuset_cpus_allowed(struct tas return mask; } +/** + * cpuset_cpus_allowed_lock - return cpus_allowed mask from a tasks cpuset. + * @tsk: pointer

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Oleg Nesterov
On 08/24, Cliff Wickman wrote: @@ -5091,6 +5092,17 @@ restart: if (dest_cpu == NR_CPUS) dest_cpu = any_online_cpu(p-cpus_allowed); + /* try to stay on the same cpuset */ + if (dest_cpu == NR_CPUS) { + /* + * The

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Gautham R Shenoy
On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: On 08/24, Andrew Morton wrote: On Fri, 24 Aug 2007 17:18:06 -0500 Cliff Wickman [EMAIL PROTECTED] wrote: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu.

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-25 Thread Rusty Russell
On Sun, 2007-08-26 at 05:46 +0530, Gautham R Shenoy wrote: On Sat, Aug 25, 2007 at 01:47:40PM +0400, Oleg Nesterov wrote: Before this patch, process leaves its -cpuset and migrates to some random any_online_cpu(). With this patch it stays within -cpuset and migrates to CPU 3. The

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-24 Thread Andrew Morton
On Fri, 24 Aug 2007 17:18:06 -0500 Cliff Wickman <[EMAIL PROTECTED]> wrote: > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > that have been running on that cpu. > > Currently, such a task is migrated: > 1) to any cpu on the same node as the disabled cpu, which is both

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-24 Thread Cliff Wickman
When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2) to any cpu which is both online and

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-24 Thread Cliff Wickman
When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2) to any cpu which is both online and

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-08-24 Thread Andrew Morton
On Fri, 24 Aug 2007 17:18:06 -0500 Cliff Wickman [EMAIL PROTECTED] wrote: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-29 Thread Andrew Morton
On Thu, 24 May 2007 09:56:01 +0200 Ingo Molnar <[EMAIL PROTECTED]> wrote: > > * Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > > > that have been running on that cpu. > > > > So I still have these three patches in the

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-29 Thread Andrew Morton
On Thu, 24 May 2007 09:56:01 +0200 Ingo Molnar [EMAIL PROTECTED] wrote: * Andrew Morton [EMAIL PROTECTED] wrote: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. So I still have these three patches in the pending queue but I

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-24 Thread Ingo Molnar
* Andrew Morton <[EMAIL PROTECTED]> wrote: > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > > that have been running on that cpu. > > So I still have these three patches in the pending queue but I was > rather hoping that the scheduler, sched-domains and cpuset

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-24 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] wrote: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. So I still have these three patches in the pending queue but I was rather hoping that the scheduler, sched-domains and cpuset people could

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Oleg Nesterov
On 05/23, Cliff Wickman wrote: > > On Thu, May 24, 2007 at 01:29:02AM +0400, Oleg Nesterov wrote: > > Cliff Wickman wrote: > > > > > > - * NOTE: interrupts should be disabled by the caller > > > + * NOTE: interrupts are not disabled by the caller > > > */ > > > static void

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Cliff Wickman
On Thu, May 24, 2007 at 01:29:02AM +0400, Oleg Nesterov wrote: > Cliff Wickman wrote: > > > > In order to do this, move_task_off_dead_cpu() must make a call to > > cpuset_cpus_allowed(), which may block. > > > > move_task_off_dead_cpu() has been within a critical region when called > > from

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Oleg Nesterov
Cliff Wickman wrote: > > In order to do this, move_task_off_dead_cpu() must make a call to > cpuset_cpus_allowed(), which may block. > > move_task_off_dead_cpu() has been within a critical region when called > from migrate_live_tasks(). So this patch also changes migrate_live_tasks() > to enable

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Andrew Morton
On Mon, 21 May 2007 15:08:56 -0500 [EMAIL PROTECTED] (Cliff Wickman) wrote: > (this is a third submission -- corrects a locking/blocking issue pointed > out by Nathan Lynch) > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > that have been running on that cpu. So I

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Andrew Morton
On Mon, 21 May 2007 15:08:56 -0500 [EMAIL PROTECTED] (Cliff Wickman) wrote: (this is a third submission -- corrects a locking/blocking issue pointed out by Nathan Lynch) When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. So I still

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Oleg Nesterov
Cliff Wickman wrote: In order to do this, move_task_off_dead_cpu() must make a call to cpuset_cpus_allowed(), which may block. move_task_off_dead_cpu() has been within a critical region when called from migrate_live_tasks(). So this patch also changes migrate_live_tasks() to enable

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Cliff Wickman
On Thu, May 24, 2007 at 01:29:02AM +0400, Oleg Nesterov wrote: Cliff Wickman wrote: In order to do this, move_task_off_dead_cpu() must make a call to cpuset_cpus_allowed(), which may block. move_task_off_dead_cpu() has been within a critical region when called from

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-23 Thread Oleg Nesterov
On 05/23, Cliff Wickman wrote: On Thu, May 24, 2007 at 01:29:02AM +0400, Oleg Nesterov wrote: Cliff Wickman wrote: - * NOTE: interrupts should be disabled by the caller + * NOTE: interrupts are not disabled by the caller */ static void move_task_off_dead_cpu(int dead_cpu,

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-21 Thread Cliff Wickman
(this is a third submission -- corrects a locking/blocking issue pointed out by Nathan Lynch) When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-05-21 Thread Cliff Wickman
(this is a third submission -- corrects a locking/blocking issue pointed out by Nathan Lynch) When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-15 Thread Nathan Lynch
Robin Holt wrote: > On Fri, Mar 09, 2007 at 05:58:59PM -0600, Nathan Lynch wrote: > > Hello- > > > > Cliff Wickman wrote: > > > This patch would insert a preference to migrate such a task to a cpu > > > within > > > its cpuset (and set its cpus_allowed to its cpuset). > > > > > > With this

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-15 Thread Nathan Lynch
Robin Holt wrote: On Fri, Mar 09, 2007 at 05:58:59PM -0600, Nathan Lynch wrote: Hello- Cliff Wickman wrote: This patch would insert a preference to migrate such a task to a cpu within its cpuset (and set its cpus_allowed to its cpuset). With this patch, migrate the task

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-14 Thread Robin Holt
On Fri, Mar 09, 2007 at 05:58:59PM -0600, Nathan Lynch wrote: > Hello- > > Cliff Wickman wrote: > > This patch would insert a preference to migrate such a task to a cpu within > > its cpuset (and set its cpus_allowed to its cpuset). > > > > With this patch, migrate the task to: > > 1) to any

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-14 Thread Robin Holt
On Fri, Mar 09, 2007 at 05:58:59PM -0600, Nathan Lynch wrote: Hello- Cliff Wickman wrote: This patch would insert a preference to migrate such a task to a cpu within its cpuset (and set its cpus_allowed to its cpuset). With this patch, migrate the task to: 1) to any cpu on the same

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Ingo Molnar
* Nathan Lynch <[EMAIL PROTECTED]> wrote: > > > + /* try to stay on the same cpuset */ > > > + if (dest_cpu == NR_CPUS) { > > > + p->cpus_allowed = cpuset_cpus_allowed(p); > > > + dest_cpu = any_online_cpu(p->cpus_allowed); > > > + } > > > > what's the practical effect of this -

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Nathan Lynch
Hi- Ingo Molnar wrote: > > * Cliff Wickman <[EMAIL PROTECTED]> wrote: > > > With this patch, migrate the task to: > > 1) to any cpu on the same node as the disabled cpu, which is both online > > and among that task's cpus_allowed > > 2) to any online cpu within the task's cpuset > > 3)

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Ingo Molnar
* Cliff Wickman <[EMAIL PROTECTED]> wrote: > With this patch, migrate the task to: > 1) to any cpu on the same node as the disabled cpu, which is both online > and among that task's cpus_allowed > 2) to any online cpu within the task's cpuset > 3) to any cpu which is both online and among

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Ingo Molnar
* Cliff Wickman [EMAIL PROTECTED] wrote: With this patch, migrate the task to: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2) to any online cpu within the task's cpuset 3) to any cpu which is both online and among that

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Nathan Lynch
Hi- Ingo Molnar wrote: * Cliff Wickman [EMAIL PROTECTED] wrote: With this patch, migrate the task to: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2) to any online cpu within the task's cpuset 3) to any cpu which

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-10 Thread Ingo Molnar
* Nathan Lynch [EMAIL PROTECTED] wrote: + /* try to stay on the same cpuset */ + if (dest_cpu == NR_CPUS) { + p-cpus_allowed = cpuset_cpus_allowed(p); + dest_cpu = any_online_cpu(p-cpus_allowed); + } what's the practical effect of this - when moving the last

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-09 Thread Nathan Lynch
Hello- Cliff Wickman wrote: > This patch would insert a preference to migrate such a task to a cpu within > its cpuset (and set its cpus_allowed to its cpuset). > > With this patch, migrate the task to: > 1) to any cpu on the same node as the disabled cpu, which is both online > and among

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-09 Thread Cliff Wickman
From: Cliff Wickman <[EMAIL PROTECTED]> (this is a second submission -- the first was from a work area back porting to an older release) When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-09 Thread Cliff Wickman
From: Cliff Wickman [EMAIL PROTECTED] (this is a second submission -- the first was from a work area back porting to an older release) When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-09 Thread Nathan Lynch
Hello- Cliff Wickman wrote: This patch would insert a preference to migrate such a task to a cpu within its cpuset (and set its cpus_allowed to its cpuset). With this patch, migrate the task to: 1) to any cpu on the same node as the disabled cpu, which is both online and among that

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-07 Thread Randy Dunlap
On Wed, 07 Mar 2007 08:24:44 -0600 Cliff Wickman wrote: > > From: Cliff Wickman <[EMAIL PROTECTED]> > > When a cpu is disabled, move_task_off_dead_cpu() is called for tasks > that have been running on that cpu. > > Currently, such a task is migrated: > 1) to any cpu on the same node as the

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-07 Thread Cliff Wickman
From: Cliff Wickman <[EMAIL PROTECTED]> When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed

[PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-07 Thread Cliff Wickman
From: Cliff Wickman [EMAIL PROTECTED] When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2)

Re: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset

2007-03-07 Thread Randy Dunlap
On Wed, 07 Mar 2007 08:24:44 -0600 Cliff Wickman wrote: From: Cliff Wickman [EMAIL PROTECTED] When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled