From: Peter Zijlstra <peterz@infradead.org>
To: Gregory Haskins <ghaskins@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>, Marin Mitov <mitov@issp.bas.bg>,
Andi Kleen <andi-suse@firstfloor.org>,
Clark Williams <clark.williams@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
akpm@osdl.org, "Luis Claudio R. Goncalves" <lclaudio@uudg.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH][resubmit] x86: enable preemption in delay
Date: Wed, 18 Jun 2008 14:16:56 +0200 [thread overview]
Message-ID: <1213791416.16944.222.camel@twins> (raw)
In-Reply-To: <4858C286.BA47.005A.0@novell.com>
On Wed, 2008-06-18 at 06:08 -0600, Gregory Haskins wrote:
> >>> On Wed, Jun 18, 2008 at 3:55 AM, in message <20080618075518.GD4135@elte.hu>,
> Ingo Molnar <mingo@elte.hu> wrote:
>
> > * Marin Mitov <mitov@issp.bas.bg> wrote:
> >
> >> Why not something like that (do keep in mind I am not an expert :-):
> >>
> >> static void delay_tsc(unsigned long loops)
> >> {
> >> get and store the mask of allowed cpus;
> >> /* prevent the migration */
> >> set the mask of allowed cpus to the current cpu only;
> >> /* is it possible? could it be guaranteed? */
> >> loop for the delay;
> >> restore the old mask of allowed cpus;
> >> }
> >>
> >> You have got the idea. Could it be realized? Is it more expensive than
> >> the current realization? So, comments, please.
> >
> > hm, changing/saving/restorig cpus_allowed is really considered a 'heavy'
> > operation compared to preempt_disable(). On a 4096 CPUs box cpus_allowed
> > is 4096 bits which is half a kilobyte ...
> >
> > preempt_disable()/enable() on the other hand only touches a single
> > variable, (thread_info->preempt_count which is an u32)
> >
> > Ingo
>
> FWIW: I had submitted some "migration disable" patches a while back
> that would solve this without the cpus_allowed manipulations described
> here. Its more expensive than a preempt-disable (but its
> preemptible), yet its way cheaper (and more correct / less racy) than
> chaning cpus_allowed. I could resubmit if there was any interest,
> though I think Ingo said he didnt like the concept on the first pass.
> Anyway, FYI.
(please teach your mailer to wrap text)
Yeah - migrate_disable() has been proposed several times. The reason I
don't like it is that is creates scheduling artefacts like latencies by
not being able to load-balance (and thereby complicates all that, and
you know we don't need more complication there).
Things like preempt latency and irq off latency are rather easy to
notice and debug in general. migrate_disable() would be fully
preemptable/schedulable which makes it much much harder to instrument or
even detect we have an issue. Which in turn makes it much harder to find
abuse.
next prev parent reply other threads:[~2008-06-18 12:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-25 18:08 Re:[PATCH -v4] x86: enable preemption in delay Marin Mitov
2008-05-25 19:30 ` Steven Rostedt
2008-05-25 19:58 ` [PATCH " Marin Mitov
2008-05-25 22:21 ` Thomas Gleixner
2008-05-26 5:14 ` [PATCH " Marin Mitov
2008-06-01 16:01 ` [PATCH][resubmit] " Marin Mitov
2008-06-01 16:25 ` Andi Kleen
2008-06-01 17:17 ` Marin Mitov
2008-06-09 12:13 ` Ingo Molnar
2008-06-09 16:11 ` Marin Mitov
2008-06-09 16:16 ` Ingo Molnar
2008-06-15 17:58 ` Marin Mitov
2008-06-18 7:55 ` Ingo Molnar
2008-06-18 12:08 ` Gregory Haskins
2008-06-18 12:13 ` Gregory Haskins
2008-06-18 12:16 ` Peter Zijlstra [this message]
2008-06-18 12:25 ` Gregory Haskins
2008-06-18 12:42 ` Nick Piggin
2008-06-18 13:04 ` Gregory Haskins
2008-06-18 16:16 ` Steven Rostedt
2008-06-18 17:18 ` Nick Piggin
2008-06-28 10:44 ` Pavel Machek
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=1213791416.16944.222.camel@twins \
--to=peterz@infradead.org \
--cc=akpm@osdl.org \
--cc=andi-suse@firstfloor.org \
--cc=clark.williams@gmail.com \
--cc=ghaskins@novell.com \
--cc=lclaudio@uudg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mitov@issp.bas.bg \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox