| brain activity log
11.07.2007 - Wednesday - 17:20 - Deterministic God
I have always been an Ingo's
fan. A couple of days ago his Completely Fair Scheduler has been
merged into the kernie :)
"Ideal multi-tasking CPU" is a (non-existent :-)) CPU that has 100%
physical power and which can run each task at precise equal speed, in
parallel, each at 1/nr_running speed. For example: if there are 2 tasks
running then it runs each at 50% physical power - totally in parallel.
On real hardware, we can run only a single task at once, so while that
one task runs, the other tasks that are waiting for the CPU are at a
disadvantage - the current task gets an unfair amount of CPU time. In
CFS this fairness imbalance is expressed and tracked via the per-task
p->wait_runtime (nanosec-unit) value. "wait_runtime" is the amount of
time the task should now run on the CPU for it to become completely fair
and balanced.
(small detail: on 'ideal' hardware, the p->wait_runtime value would
always be zero - no task would ever get 'out of balance' from the
'ideal' share of CPU time.)
CFS's task picking logic is based on this p->wait_runtime value and it
is thus very simple: it always tries to run the task with the largest
p->wait_runtime value. In other words, CFS tries to run the task with
the 'gravest need' for more CPU time. So CFS always tries to split up
CPU time between runnable tasks as close to 'ideal multitasking
hardware' as possible.
In practice it works like this: the system runs a task a bit, and when
the task schedules (or a scheduler tick happens) the task's CPU usage is
'accounted for': the (small) time it just spent using the physical CPU
is deducted from p->wait_runtime. [minus the 'fair share' it would have
gotten anyway]. Once p->wait_runtime gets low enough so that another
task becomes the 'leftmost task' of the time-ordered rbtree it maintains
(plus a small amount of 'granularity' distance relative to the leftmost
task so that we do not over-schedule tasks and trash the cache) then the
new leftmost task is picked and the current task is preempted.
The rq->fair_clock value tracks the 'CPU time a runnable task would have
fairly gotten, had it been runnable during that time'. So by using
rq->fair_clock values we can accurately timestamp and measure the
'expected CPU time' a task should have gotten. All runnable tasks are
sorted in the rbtree by the "rq->fair_clock - p->wait_runtime" key, and
CFS picks the 'leftmost' task and sticks to it. As the system progresses
forwards, newly woken tasks are put into the tree more and more to the
right - slowly but surely giving a chance for every task to become the
'leftmost task' and thus get on the CPU within a
deterministic
amount of time.
CFS's design is quite radical: it does not use runqueues, it uses a
time-ordered rbtree to build a 'timeline' of future task execution,
and thus has no 'array switch' artifacts (by which both the vanilla
scheduler and RSDL/SD are affected).
CFS uses nanosecond granularity accounting and does not rely on any
jiffies or other HZ detail. Thus the CFS scheduler has no notion of
'timeslices' and has no heuristics whatsoever. There is only one
central tunable /proc/sys/kernel/sched_granularity_ns
which can be used to tune the scheduler from 'desktop' (low
latencies) to 'server' (good batching) workloads. It defaults to a
setting suitable for desktop workloads.
Due to its design, the CFS scheduler is not prone to any of the
'attacks' that exist today against the heuristics of the stock
scheduler: fiftyp.c, thud.c, chew.c, ring-test.c, massive_intr.c all
work fine and do not impact interactivity and produce the expected
behavior.
10.06.2007 - Sunday - 02:57 - Wrong place ?
It is very interesting to note that a lot of
people I admire, love, consider a friend
or have admired, loved, considered a friend in the
past are disappearing from this place.
They're simply going somewhere else to work,
have fun, live.
Most of them don't even spend time in criticizing
this place anymore: they simply leave.
Ugly ... and maybe a little bit scary too :/
02.06.2007 - Saturday - 03:33 - I know the pieces fit
| |
I know the pieces fit
cuz I watched them fall away.
Mildewed and smoldering,
fundamental differing.
Pure intention juxtaposed
will set two lovers souls in motion.
Disintegrating as it goes
testing our communication.
The light that fueled our fire
then has burned a hole between us so
we cannot see to reach an end
crippling our communication.
I know the pieces fit
cuz I watched them tumble down.
No fault, none to blame
it doesnt mean I dont desire
to point the finger, blame the other,
watch the temple topple over.
To bring the pieces back together,
rediscover communication.
The poetry that comes from
the squaring off between,
and the circling is worth it.
Finding beauty in the dissonance.
There was a time that the pieces fit,
but I watched them fall away.
Mildewed and smoldering,
strangled by our coveting
I've done the the math enough
to know the dangers of a second guessing.
Doomed to crumble unless we grow,
and strengthen our communication.
Cold silence has
a tendency to
atrophy any
sense of compassion.
Between supposed lovers.
Between supposed lovers.
And I know the pieces fit.
And I know the pieces fit.
And I know the pieces fit.
And I know the pieces fit.
|
|
|
|
|
|
I've transcribed the intro and a part of the first verse. It's enough to explain most of the tricks
used in the song. The GP5 file is here.
It contains the parts for two guitars, bass, drums and a guitar-arranged voice melody.
It sounds really better with the RSE engine. Drop me a mail if you want the pdf.
30.05.2007 - Tuesday - 20:07 - A random video from NY
This is a random sax solo, from a random concert of a random
band in a totally random club somewhere in NY in a random weekday...
Click the image to download the video...
Ah.. and I've finally posted some random photos here :)
I'm off to the gym. Later ppl.
21.05.2007 - Monday - 11:35 - Diary Digest
Ok. A lot of things happened in the last month.
As usual in this period, I have a super amount of work.
It's ok: I can do it :)
I'm back from New York. Woah...
The place where I live is obviously not even comparable.
I'll post some photos (and maybe comments) soon.
Yes, Yes, I know, rigel is gone. Please welcome hydra :)
Yes, I know that the kvirc lists are not working
at the moment. I'm working on it...
Something is moving.
There is a placeholder on http://labs.pragmaware.net.
Going to buy a new car. The target is in the european C segment.
Something like "Mazda 3", "Fiat Bravo", "Seat Leon" or "Alfa Romeo 147".
Suggestions are welcome :)
I've missed a veeery strange (but cool) opportunity on Saturday. Too bad
it was soooo unexpected :(
Next saturday we're going to play in our city center with Ace Of Space
and an additional guest guitarist (Cucio Rox!!!). It will be fun :)
I've been working a little bit more on the
article about matrices.
This is also one of the starter projects for http://labs.pragmaware.net:
take a look here.
want more ?
... really ? :D
Browse around then.
You're viewing 5 posts per page: you can view more or less, if you want.
The entries marked in red are the ones you're viewing now.
|