From: "Gregory Haskins" <ghaskins@novell.com>
To: "Andi Kleen" <ak@suse.de>
Cc: <a.p.zijlstra@chello.nl>, <mingo@elte.hu>, <bill.huey@gmail.com>,
<rostedt@goodmis.org>, <kevin@hilman.org>, <tglx@linutronix.de>,
<cminyard@mvista.com>, <dsingleton@mvista.com>,
<dwalker@mvista.com>, "Moiz Kohari" <MKohari@novell.com>,
"Peter Morreale" <PMorreale@novell.com>,
"Sven Dietrich" <SDietrich@novell.com>, <dsaxena@plexity.net>,
<gregkh@suse.de>, <npiggin@suse.de>,
<linux-kernel@vger.kernel.org>, <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH [RT] 08/14] add a loop counter based timeout mechanism
Date: Thu, 21 Feb 2008 10:02:20 -0700 [thread overview]
Message-ID: <47BD684C.BA47.005A.0@novell.com> (raw)
In-Reply-To: <200802211741.10299.ak@suse.de>
>>> On Thu, Feb 21, 2008 at 11:41 AM, in message <200802211741.10299.ak@suse.de>,
Andi Kleen <ak@suse.de> wrote:
>> +config RTLOCK_DELAY
>> + int "Default delay (in loops) for adaptive rtlocks"
>> + range 0 1000000000
>> + depends on ADAPTIVE_RTLOCK
>
> I must say I'm not a big fan of putting such subtle configurable numbers
> into Kconfig. Compilation is usually the wrong place to configure
> such a thing. Just having it as a sysctl only should be good enough.
>
>> + default "10000"
>
> Perhaps you can expand how you came up with that default number?
Actually, the number doesn't seem to matter that much as long as it is sufficiently long enough to make timeouts rare. Most workloads will present some threshold for hold-time. You generally get the best performance if the value is at least as "long" as that threshold. Anything beyond that and there is no gain, but there doesn't appear to be a penalty either. So we picked 10000 because we found it to fit that criteria quite well for our range of GHz class x86 machines. YMMY, but that is why its configurable ;)
> It looks suspiciously round and worse the actual spin time depends a lot on
> the
> CPU frequency (so e.g. a 3Ghz CPU will likely behave quite
> differently from a 2Ghz CPU)
Yeah, fully agree. We really wanted to use a time-value here but ran into various problems that have yet to be resolved. We have it on the todo list to express this in terms in ns so it at least will scale with the architecture.
> Did you experiment with other spin times?
Of course ;)
> Should it be scaled with number of CPUs?
Not to my knowledge, but we can put that as a research "todo".
> And at what point is real
> time behaviour visibly impacted?
Well, if we did our jobs correctly, RT behavior should *never* be impacted. *Throughput* on the other hand... ;)
But its comes down to what I mentioned earlier. There is that threshold that affects the probability of timing out. Values lower than that threshold start to degrade throughput. Values higher than that have no affect on throughput, but may drive the cpu utilization higher which can theoretically impact tasks of equal or lesser priority by taking that resource away from them. To date, we have not observed any real-world implications of this however.
>
> Most likely it would be better to switch to something that is more
> absolute time, like checking RDTSC every few iteration similar to what
> udelay does. That would be at least constant time.
I agree. We need to move in the direction of time-basis. The tradeoff is that it needs to be portable, and low-impact (e.g. ktime_get() is too heavy-weight). I think one of the (not-included) patches converts a nanosecond value from the sysctl to approximate loop-counts using the bogomips data. This was a decent compromise between the non-scaling loopcounts and the heavy-weight official timing APIs. We dropped it because we support older kernels which were conflicting with the patch. We may have to resurrect it, however..
-Greg
next prev parent reply other threads:[~2008-02-21 17:09 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 15:26 [PATCH [RT] 00/14] RFC - adaptive real-time locks Gregory Haskins
2008-02-21 15:26 ` [PATCH [RT] 01/14] spinlocks: fix preemption feature when PREEMPT_RT is enabled Gregory Haskins
2008-02-21 15:26 ` [PATCH [RT] 02/14] spinlock: make preemptible-waiter feature a specific config option Gregory Haskins
2008-02-22 19:09 ` Pavel Machek
2008-02-21 15:26 ` [PATCH [RT] 03/14] x86: FIFO ticket spinlocks Gregory Haskins
2008-02-21 15:26 ` [PATCH [RT] 04/14] disable PREEMPT_SPINLOCK_WAITERS when x86 ticket/fifo spins are in use Gregory Haskins
2008-02-21 15:26 ` [PATCH [RT] 05/14] rearrange rt_spin_lock sleep Gregory Haskins
2008-02-22 13:29 ` Gregory Haskins
2008-02-22 13:35 ` Steven Rostedt
2008-02-22 13:40 ` Peter Zijlstra
2008-02-22 13:35 ` Ingo Molnar
2008-02-22 13:43 ` Steven Rostedt
2008-02-22 13:46 ` Steven Rostedt
2008-02-21 15:26 ` [PATCH [RT] 06/14] optimize rt lock wakeup Gregory Haskins
2008-02-21 15:27 ` [PATCH [RT] 07/14] adaptive real-time lock support Gregory Haskins
2008-02-22 19:14 ` Pavel Machek
2008-02-21 15:27 ` [PATCH [RT] 08/14] add a loop counter based timeout mechanism Gregory Haskins
2008-02-21 16:41 ` Andi Kleen
2008-02-21 17:02 ` Gregory Haskins [this message]
2008-02-21 17:04 ` Peter W. Morreale
2008-02-21 17:06 ` Sven-Thorsten Dietrich
2008-02-22 19:08 ` Paul E. McKenney
2008-02-22 19:19 ` Bill Huey (hui)
2008-02-22 19:21 ` Bill Huey (hui)
2008-02-22 19:43 ` Paul E. McKenney
2008-02-22 19:55 ` Sven-Thorsten Dietrich
2008-02-22 20:23 ` Paul E. McKenney
2008-02-22 22:03 ` Gregory Haskins
2008-02-23 12:31 ` Andi Kleen
2008-02-23 16:32 ` Paul E. McKenney
2008-02-25 23:52 ` Sven-Thorsten Dietrich
2008-02-22 20:36 ` Peter W. Morreale
2008-02-23 7:36 ` Sven-Thorsten Dietrich
2008-02-22 20:15 ` Peter W. Morreale
2008-02-21 15:27 ` [PATCH [RT] 09/14] adaptive mutexes Gregory Haskins
2008-02-21 15:27 ` [PATCH [RT] 10/14] adjust pi_lock usage in wakeup Gregory Haskins
2008-02-21 16:48 ` Steven Rostedt
2008-02-21 17:09 ` Peter W. Morreale
2008-02-21 15:27 ` [PATCH [RT] 11/14] optimize the !printk fastpath through the lock acquisition Gregory Haskins
2008-02-21 16:36 ` Andi Kleen
2008-02-21 16:47 ` Gregory Haskins
2008-02-22 19:18 ` Pavel Machek
2008-02-22 22:20 ` Gregory Haskins
2008-02-23 0:43 ` Bill Huey (hui)
2008-02-25 5:20 ` Gregory Haskins
2008-02-25 6:21 ` Bill Huey (hui)
2008-02-25 9:02 ` Bill Huey (hui)
2008-02-21 15:27 ` [PATCH [RT] 12/14] remove the extra call to try_to_take_lock Gregory Haskins
2008-02-21 15:27 ` [PATCH [RT] 13/14] allow rt-mutex lock-stealing to include lateral priority Gregory Haskins
2008-02-21 15:27 ` [PATCH [RT] 14/14] sysctl for runtime-control of lateral mutex stealing Gregory Haskins
2008-02-21 16:05 ` [PATCH [RT] 00/14] RFC - adaptive real-time locks Gregory Haskins
2008-02-21 21:24 ` Ingo Molnar
2008-02-21 21:33 ` Bill Huey (hui)
[not found] ` <20080221214219.GA27209@elte.hu>
2008-02-21 21:56 ` Gregory Haskins
2008-02-21 22:53 ` Bill Huey (hui)
2008-02-21 21:40 ` Gregory Haskins
2008-02-21 22:12 ` Peter W. Morreale
2008-02-21 22:42 ` Peter W. Morreale
2008-02-23 8:03 ` Andrew Morton
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=47BD684C.BA47.005A.0@novell.com \
--to=ghaskins@novell.com \
--cc=MKohari@novell.com \
--cc=PMorreale@novell.com \
--cc=SDietrich@novell.com \
--cc=a.p.zijlstra@chello.nl \
--cc=ak@suse.de \
--cc=bill.huey@gmail.com \
--cc=cminyard@mvista.com \
--cc=dsaxena@plexity.net \
--cc=dsingleton@mvista.com \
--cc=dwalker@mvista.com \
--cc=gregkh@suse.de \
--cc=kevin@hilman.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).