From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC] Thread Migration Preemption - v4
Date: Sat, 14 Jul 2007 16:26:31 -0400 [thread overview]
Message-ID: <20070714202631.GS6975@Krystal> (raw)
In-Reply-To: <1184441406.5284.79.camel@lappy>
* Peter Zijlstra (a.p.zijlstra@chello.nl) 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. Care should
> > also be taken to check that the thread flags used won't trigger false positives
> > in non selective asm thread flag checks.
> >
> > FIXME (HOTPLUG) :
> >
> > > > /* 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_info(p)->migrate_count)
> > > > + goto out;
> > > > +#endif
> > >
> > > This means that move_task_off_dead_cpu() will spin until the task will be
> > > scheduled
> > > on the dead CPU. Given that we hold tasklist_lock and irqs are disabled, this
> > > may
> > > never happen.
> > >
> >
> > Yes. My idea to fix this issue is the following:
> >
> > If a thread has non zero migrate_count, we should still move it to a
> > different CPU upon hotplug cpu removal, even if this thread resists
> > migration. Care should be taken to send _all_ such threads to the _same_
> > CPU so they don't race for the per-cpu ressources. Does it make sense ?
> >
> > We would have to keep the CPU affinity of the threads running on the
> > wrong CPU until they end their migrate disabled section, so that we can
> > put them back on their original CPU if it goes back online, otherwise we
> > could end up with concurrent per-cpu variables accesses.
> >
> > (I'll wait for reply before coding a solution for this CPU HOTPLUG
> > related problem)
>
> What would, aside from technical issues, be the problem with making
> migration_disable() delay CPU_DOWN until migration_enable()?
>
Because if we thing a little further, migration disabling could be a
very interesting way to provide cheap per-cpu data structure access to
user-space. But we would not want user-space processes to hold CPU_DOWN
forever...
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2007-07-14 20:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-06 6:02 [RFC] Thread Migration Preemption Oleg Nesterov
2007-07-06 14:23 ` Mathieu Desnoyers
2007-07-06 14:56 ` Oleg Nesterov
2007-07-11 4:49 ` [RFC] Thread Migration Preemption - v2 Mathieu Desnoyers
2007-07-11 16:36 ` Oleg Nesterov
2007-07-14 18:27 ` Mathieu Desnoyers
2007-07-14 19:56 ` Oleg Nesterov
2007-07-14 18:40 ` [RFC] Thread Migration Preemption - v3 Mathieu Desnoyers
2007-07-14 18:42 ` [RFC] Thread Migration Preemption - v4 Mathieu Desnoyers
2007-07-14 19:14 ` Peter Zijlstra
2007-07-14 20:25 ` Mathieu Desnoyers
2007-07-14 19:30 ` Peter Zijlstra
2007-07-14 20:26 ` Mathieu Desnoyers [this message]
2007-07-14 20:23 ` Oleg Nesterov
2007-07-14 20:33 ` Mathieu Desnoyers
2007-07-14 20:42 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070714202631.GS6975@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.