Re: [RFC] Thread Migration Preemption

2007-07-23 Thread Ingo Molnar
* Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > Thread Migration Preemption > > This patch adds the ability to protect critical sections from > migration to another CPU without disabling preemption. > > This will be useful to minimize the amount of preemption disabling for > the -rt patch. [

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Oleg Nesterov
On 07/14, Mathieu Desnoyers wrote: > > * Oleg Nesterov ([EMAIL PROTECTED]) wrote: > > On 07/14, Mathieu Desnoyers wrote: > > > > > > @@ -4891,10 +4948,42 @@ static int migration_thread(void *data) > > > list_del_init(head->next); > > > > > > spin_unlock(&rq->lock); > > > -

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Mathieu Desnoyers
* Oleg Nesterov ([EMAIL PROTECTED]) wrote: > On 07/14, Mathieu Desnoyers wrote: > > > > @@ -4891,10 +4948,42 @@ static int migration_thread(void *data) > > list_del_init(head->next); > > > > spin_unlock(&rq->lock); > > - __migrate_task(req->task, cpu, req->dest_c

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Mathieu Desnoyers
* Peter Zijlstra ([EMAIL PROTECTED]) wrote: > On Sat, 2007-07-14 at 14:42 -0400, Mathieu Desnoyers wrote: > > > Note: (or we could say FIXME) > > Is we ever want to check migration pending in assembly code, we will have to > > make sure we test the right thread flag bits on each architectures. Car

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Mathieu Desnoyers
* Peter Zijlstra ([EMAIL PROTECTED]) wrote: > Would have been nice if you'd CC'ed me :-/ > Sorry > On Sat, 2007-07-14 at 14:42 -0400, Mathieu Desnoyers wrote: > > > @@ -4891,10 +4948,42 @@ static int migration_thread(void *data) > > list_del_init(head->next); > > > > sp

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Oleg Nesterov
On 07/14, Mathieu Desnoyers wrote: > > @@ -4891,10 +4948,42 @@ static int migration_thread(void *data) > list_del_init(head->next); > > spin_unlock(&rq->lock); > - __migrate_task(req->task, cpu, req->dest_cpu); > + migrated = __migrate_task(req-

Re: [RFC] Thread Migration Preemption - v2

2007-07-14 Thread Oleg Nesterov
On 07/14, Mathieu Desnoyers wrote: > > * Oleg Nesterov ([EMAIL PROTECTED]) wrote: > > > /* Affinity changed (again). */ > > > if (!cpu_isset(dest_cpu, p->cpus_allowed)) > > > goto out; > > > > > > on_rq = p->se.on_rq; > > > +#ifdef CONFIG_PREEMPT > > > + if (!on_rq && task_thread_

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Peter Zijlstra
On Sat, 2007-07-14 at 14:42 -0400, Mathieu Desnoyers wrote: > Note: (or we could say FIXME) > Is we ever want to check migration pending in assembly code, we will have to > make sure we test the right thread flag bits on each architectures. Care > should > also be taken to check that the thread f

Re: [RFC] Thread Migration Preemption - v4

2007-07-14 Thread Peter Zijlstra
Would have been nice if you'd CC'ed me :-/ On Sat, 2007-07-14 at 14:42 -0400, Mathieu Desnoyers wrote: > @@ -4891,10 +4948,42 @@ static int migration_thread(void *data) > list_del_init(head->next); > > spin_unlock(&rq->lock); > - __migrate_task(req->task,

[RFC] Thread Migration Preemption - v4

2007-07-14 Thread Mathieu Desnoyers
Thread Migration Preemption (v3 did not have the latest updates from Oleg review) This patch adds the ability to protect critical sections from migration to another CPU without disabling preemption. This will be useful to minimize the amount of preemption disabling for the -rt patch. It will hel

[RFC] Thread Migration Preemption - v3

2007-07-14 Thread Mathieu Desnoyers
Thread Migration Preemption This patch adds the ability to protect critical sections from migration to another CPU without disabling preemption. This will be useful to minimize the amount of preemption disabling for the -rt patch. It will help leveraging improvements brought by the local_t types

Re: [RFC] Thread Migration Preemption - v2

2007-07-14 Thread Mathieu Desnoyers
* Oleg Nesterov ([EMAIL PROTECTED]) wrote: > On 07/11, Mathieu Desnoyers wrote: > > > > This patch adds the ability to protect critical sections from migration to > > another CPU without disabling preemption. > > > > This will be useful to minimize the amount of preemption disabling for the > >

Re: [RFC] Thread Migration Preemption - v2

2007-07-11 Thread Oleg Nesterov
On 07/11, Mathieu Desnoyers wrote: > > This patch adds the ability to protect critical sections from migration to > another CPU without disabling preemption. > > This will be useful to minimize the amount of preemption disabling for the -rt > patch. It will help leveraging improvements brought by

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Mathieu Desnoyers
* Andi Kleen ([EMAIL PROTECTED]) wrote: > On Fri, Jul 06, 2007 at 10:41:44AM -0400, Mathieu Desnoyers wrote: > > I haven't thought about making it the default for kernel space > > preemption, but yes, it would make sense. > > Now it's too late -- getcpu() has infected the kernel everywhere. > It w

Re: [RFC] Thread Migration Preemption - v2

2007-07-10 Thread Mathieu Desnoyers
Hi, Still as an RFC, here is an updated version of the migration handling code in sched.c that supports migrate_disable()/migrate_enable(). I have taken care of the comments I received, thanks. I switched to migrate_enable/disable following Matt Mackall's comments. He also suggested to create, fo

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Nick Piggin
Mathieu Desnoyers wrote: * Matt Mackall ([EMAIL PROTECTED]) wrote: On Wed, Jul 11, 2007 at 10:02:23AM +1000, Nick Piggin wrote: I like this patch a lot. Even if we don't add the underlying mechanism right now, adding migration_disable as an alias for preempt_disable will much better document

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Mathieu Desnoyers
* Matt Mackall ([EMAIL PROTECTED]) wrote: > On Wed, Jul 11, 2007 at 10:02:23AM +1000, Nick Piggin wrote: > > >I like this patch a lot. Even if we don't add the underlying mechanism > > >right now, adding migration_disable as an alias for preempt_disable > > >will much better document quite a number

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Matt Mackall
On Wed, Jul 11, 2007 at 10:02:23AM +1000, Nick Piggin wrote: > >I like this patch a lot. Even if we don't add the underlying mechanism > >right now, adding migration_disable as an alias for preempt_disable > >will much better document quite a number of the users. > > I'd have no problem with that,

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Nick Piggin
Matt Mackall wrote: On Fri, Jul 06, 2007 at 04:12:10PM +1000, Nick Piggin wrote: Mathieu Desnoyers wrote: Thread Migration Preemption This patch adds the ability to protect critical sections from migration to another CPU without disabling preemption. This will be useful to minimize the amou

Re: [RFC] Thread Migration Preemption

2007-07-10 Thread Matt Mackall
On Fri, Jul 06, 2007 at 04:12:10PM +1000, Nick Piggin wrote: > Mathieu Desnoyers wrote: > >Thread Migration Preemption > > > >This patch adds the ability to protect critical sections from migration to > >another CPU without disabling preemption. > > > >This will be useful to minimize the amount of

Re: [RFC] Thread Migration Preemption

2007-07-08 Thread Nick Piggin
Steven Rostedt wrote: On Fri, 2007-07-06 at 16:12 +1000, Nick Piggin wrote: Mathieu Desnoyers wrote: migration_disable(); local_inc(&__get_cpu_var(&my_local_t_var)); migration_enable(); [...] This seems like way too much stuff to add just for this type of thing. Why not just disable

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Andi Kleen
On Fri, Jul 06, 2007 at 10:41:44AM -0400, Mathieu Desnoyers wrote: > I haven't thought about making it the default for kernel space > preemption, but yes, it would make sense. Now it's too late -- getcpu() has infected the kernel everywhere. It would have made sense a few years ago. > ... getcpu

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Daniel Walker
On Fri, 2007-07-06 at 10:34 -0400, Steven Rostedt wrote: > thing is that in RT an IRQ thread might service a softirq if that > softirq thread is of the same priority as the IRQ thread. The difference > between an IRQ thread and a softirq thread is that the IRQ thread may > migrate but the softirq

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Oleg Nesterov
On 07/06, Mathieu Desnoyers wrote: > > * Oleg Nesterov ([EMAIL PROTECTED]) wrote: > > Mathieu Desnoyers wrote: > > > > > > This patch adds the ability to protect critical sections from migration to > > > another CPU without disabling preemption. > > > > > > Typical use: > > > > > > migration_disabl

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Mathieu Desnoyers
* Andi Kleen ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers <[EMAIL PROTECTED]> writes: > > > Thread Migration Preemption > > > > This patch adds the ability to protect critical sections from migration to > > another CPU without disabling preemption. > > Good idea. > > I sometimes think we coul

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Mathieu Desnoyers
* Nick Piggin ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers wrote: > >Thread Migration Preemption > > > >This patch adds the ability to protect critical sections from migration to > >another CPU without disabling preemption. > > > >This will be useful to minimize the amount of preemption disabling

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Steven Rostedt
On Fri, 2007-07-06 at 16:12 +1000, Nick Piggin wrote: > Mathieu Desnoyers wrote: > > migration_disable(); > > local_inc(&__get_cpu_var(&my_local_t_var)); > > migration_enable(); > > [...] > This seems like way too much stuff to add just for this type of thing. Why > not just disable and reenabl

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Mathieu Desnoyers
* Oleg Nesterov ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers wrote: > > > > This patch adds the ability to protect critical sections from migration to > > another CPU without disabling preemption. > > > > Typical use: > > > > migration_disable(); > > local_inc(&__get_cpu_var(&my_local_t_var)); >

Re: [RFC] Thread Migration Preemption

2007-07-06 Thread Andi Kleen
Mathieu Desnoyers <[EMAIL PROTECTED]> writes: > Thread Migration Preemption > > This patch adds the ability to protect critical sections from migration to > another CPU without disabling preemption. Good idea. I sometimes think we could have avoided _much_ trouble if that had been always defaul

Re: [RFC] Thread Migration Preemption

2007-07-05 Thread Nick Piggin
Mathieu Desnoyers wrote: Thread Migration Preemption This patch adds the ability to protect critical sections from migration to another CPU without disabling preemption. This will be useful to minimize the amount of preemption disabling for the -rt patch. It will help leveraging improvements br

Re: [RFC] Thread Migration Preemption

2007-07-05 Thread Oleg Nesterov
Mathieu Desnoyers wrote: > > This patch adds the ability to protect critical sections from migration to > another CPU without disabling preemption. > > Typical use: > > migration_disable(); > local_inc(&__get_cpu_var(&my_local_t_var)); > migration_enable(); > > --- linux-2.6-lttng.orig/kernel/sched

Re: [RFC] Thread Migration Preemption

2007-07-05 Thread Steven Rostedt
On Thu, 2007-07-05 at 17:51 -0400, Mathieu Desnoyers wrote: > Thread Migration Preemption > > This patch adds the ability to protect critical sections from migration to > another CPU without disabling preemption. > > This will be useful to minimize the amount of preemption disabling for the -rt >

[RFC] Thread Migration Preemption

2007-07-05 Thread Mathieu Desnoyers
Thread Migration Preemption This patch adds the ability to protect critical sections from migration to another CPU without disabling preemption. This will be useful to minimize the amount of preemption disabling for the -rt patch. It will help leveraging improvements brought by the local_t types