
Zircon Fair Scheduler - return_0e
https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/zircon/docs/fair_scheduler.md
======
VanillaCafe
> A NOTE ABOUT DEADLINES: While fair scheduling is appropriate for the vast
> majority of workloads, there are some tasks that require very specific
> timing and/or do not adapt well to overload conditions. For example, these
> workloads include low-latency audio / graphics, high-frequency sensors, and
> high-rate / low-latency networking. These specialized tasks are better
> served with a deadline scheduler, which is planned for later in the Zircon
> scheduler development cycle.

Those seem like important workloads. Does this imply that the deadline
scheduler runs concurrently with the fair scheduler? Otherwise, what's the
point of developing an ideal scheduler for common workloads if it cannot be
used for critical workloads. Is it common to run two different schedulers in
the same system?

~~~
colechristensen
Different scheduling algorithms and implementations have tradeoffs. Pick one
based on your workload. No need to have only one for all applications.

You can approximate the choice down to two dimensions, latency vs. throughput.
Pick your poison.

~~~
VanillaCafe
For instance, I assume for instance a common workload that would otherwise
benefit from the fair scheduler has a fair chance of wanting to do low latency
audio. I believe Android has had this issue. As soon as the platform cares
about low latency audio it would need to abandon the fair scheduler?

~~~
colechristensen
Low latency audio would fit for doing live or studio audio production, not
necessarily watching videos, listening to music or doing video calls (where
there is already network delay an order of magnitude larger than the scheduler
would impart). "Low" will have context-dependent meaning.

If you're doing low latency audio or flight controls on an aircraft for
example, you would absolutely need to abandon the fair scheduler for one that
could guarantee the deadlines you need are met. Sacrificing "performance" that
is throughput/efficiency/etc of your processor for timing performance.

Think of the difference between doing statistics on a billion lines of data
and flight controls on a missile. VERY different needs for scheduling, why not
have a selectable algorithm?

~~~
jblow
> (where there is already network delay an order of magnitude larger than the
> scheduler would impart)

Not the right way to think about it; the connection latency is irrelevant.
What is relevant is that you need to play audio in sync with the video, and
that audio is coming to you approximately simultaneously with the video it's
meant to be synced with.

------
impostir
There are many references to multiple cpu systems throughout the document.
Maybe I missed something, but I didn't know Fuschia was aimed at systems like
that. I am no expert, but aren't the vast majority of multiple cpu systems
servers or high-rnd workstations? If google can supply their own server os,
Linux could lose a lot of support and funding

~~~
wolf550e
"cpu" is "core". Almost all phone CPUs are multi-core. The low end of phone
(and Raspberry Pi 2 V1.2 and newer) CPUs is quad core ARM Cortex A53, which is
a small slow in-order design, similar to the original Intel Pentium from 1995.
Older low end phones used the 32bit quad core ARM Cortex-A7. single core ARM11
phones are extinct.

They don't mean multi-socket systems, and I don't see mention of NUMA, which
is the interesting case for servers where RAM is connected to some memory
controller in a socket and to reach it from a CPU in a different socket you
need to do extra hops, so some memory addresses are more distance than others
and schedulers should take that into account to achieve good performance.

~~~
tonfa
And phone CPUs can be more complex than most desktops, afaik big.LITTLE is
fairly common (multi core, with different performance / power tradeoffs
between the cores).

[https://lwn.net/Articles/501501/](https://lwn.net/Articles/501501/) has some
pointers.

~~~
Twirrim
big.LITTLE is fascinating, and I'm somewhat curious to see if Apple tries to
do something along those lines as it supposedly pushes towards ARM chips in
their machines.

Google have added some interesting stuff to Android to help it learn over time
if tasks should be allocated to the bigger cores or the lower powered smaller
ones, based on all sorts of metrics, and I believe this stuff is making its
way upstream. There's certainly some really interesting potential around that.

~~~
wolf550e
Apple chips are big.LITTLE too, at least since the 2016 A10 in the iPhone7.

[https://en.wikichip.org/wiki/apple/ax/a12](https://en.wikichip.org/wiki/apple/ax/a12)

[https://en.wikichip.org/wiki/apple/ax/a10](https://en.wikichip.org/wiki/apple/ax/a10)

[https://www.anandtech.com/show/13392/the-iphone-xs-xs-max-
re...](https://www.anandtech.com/show/13392/the-iphone-xs-xs-max-review-
unveiling-the-silicon-secrets/2)

~~~
Twirrim
Sure, I should be clear I was thinking about OSX and laptops/desktops, rather
than mobile devices.

------
bepvte
[https://cchalpha.blogspot.com/2019/03/bmq-scheduler-call-
out...](https://cchalpha.blogspot.com/2019/03/bmq-scheduler-call-out-for-
testing.html?m=1)

Someone made a scheduler on linux based on some of the ideas here. Its
included in the postfactum (linux-pf) patch set i believe, which might have
packages for your distro.

~~~
coreytabaka
No, that's based on the deprecated multi-level round-robin scheduler, which we
find tremendously amusing. :)

~~~
bepvte
Oh gosh well thank you for pointing that out

------
dpflan
This post has sky-rocketed to the top! I'm genuinely curious: can someone
explain what's cool/interesting/important about this (maybe EL5)? Thanks!

~~~
terryschiavo22
Well, Google intends for this new OS to replace Android. They'll need to
convince the public that this new OS is somehow better than Android, which
everyone has come to know and love. It seems that they believe the best way to
do that is a grassroots approach beginning with tech discussion hubs like HN
and Reddit.

Of course, they could have just meme'd hard about the fact that they're moving
away from evil Oracle technology and we'd have already all been on board.

~~~
shereadsthenews
> Android, which everyone has come to know and love.

Haha, honestly now. If my Android didn't cost $700 I would long since have
smashed it to bits. It's scheduler is totally garbage, to the point where
Google's own media apps like YouTube and Music drop samples while the screen
is redrawing. Who "loves" Android? To me it is the Win98 of mobile operating
systems.

~~~
stronglikedan
When you only have two real choices, each with their own significant set of
distinct problems, I think the term "love" can be substituted for "hate the
least". Android, which everyone has come to know and _hate the least_. Well,
not _everyone_ , but my point is the same regardless.

~~~
pjmlp
I left Symbian for Android 2.1, after several Android devices, became part of
the 10% of WP share in Europe, now still using one of them as secondary
device.

