
Nearly full tickless operation in Linux 3.10 - fintler
http://lwn.net/SubscriberLink/549580/82983789866b5fad/
======
phaemon
This is _one_ of the reasons I prefer to use Linux over systems such as
Windows or OSX. I love the public discussion over the direction of technical
details; the to-and-fro on the benefits of esoteric technologies.

The whole openness of the culture.

~~~
mrb
There is not much discussion about Windows internals, not only because they
are not shared, but also because quite frankly the Windows kernel evolves
slower than the Linux kernel in terms of new algorithms implemented. For
example it is almost certain that Microsoft never tested I/O schedulers,
process schedulers, filesystem optimizations, TCP/IP stack tweaks for wireless
networks, etc, as much as the Linux community did. One can tell just by seeing
the sheer amount of intense competition and interest amongst Linux kernel
developers to research all these areas.

The net result of that is a generally acknowledged fact that Windows is slower
than Linux when running complex workloads that push network/disk/cpu
scheduling to its limit: <https://news.ycombinator.com/item?id=3368771> A
really concrete and technical example is the network throughput in Windows
Vista which is degraded when playing audio!
[http://blogs.technet.com/b/markrussinovich/archive/2007/08/2...](http://blogs.technet.com/b/markrussinovich/archive/2007/08/27/1833290.aspx)

Note: my post may sound I am freely bashing Windows, but I am not. This is the
cold hard truth. Countless of multi-platform developers will attest to this,
me included. I can't even remember the number of times I have written a multi-
platform program in C or Java that always runs slower on Windows than on
Linux, across dozens of different versions of Windows and Linux. The last time
I troubleshooted a Windows performance issue, I found out it was the MFT of an
NTFS filesystem was being fragmented; this to say I am generally regarded as
the one guy in the company who can troubleshoot any issue, yet I acknowledge I
can almost never get Windows to perform as good as, or better than Linux, when
there is a performance discrepancy in the first place.

~~~
redstripe
That deleted post from the MSFTer is pretty damning, but is the difference one
that really matters?

Take a look at these benchmarks that were posted here recently:
<https://news.ycombinator.com/item?id=5644880>

There isn't a single comment in that whole thread about how outrageously bad
EC2 performance is. Meanwhile I'd bet that most HN startups run on EC2, heroku
or other virtualized cloud platforms. And how many are using dog slow
interpreted languages like python or ruby? It looks to me like people around
here are quite willing to take very large performance hits for the sake of
convenience.

I find Windows to be a small performance hit for the sake of convenience.

~~~
olalonde
As a developer, I fail to see in what way is Windows convenient.

~~~
chippy
um, it comes on the computer already installed? .... I know weak, but it's the
only idea I could think of.

~~~
Anon_Cow
You can buy computers with Linux pre-installed nowadays too.

I used to use Windows exclusively until about 4 years ago. Up to the time i
switched, I occasionally was testing a few Linux distros, and repeatedly came
to the conclusion that drivers were still an issue, and that Linux wasn't
ready for the average user's desktop.

Not so anymore, since about 2009. From that time on, the only thing without a
Linux driver I encountered (there are many more, just not that widespread that
it should matter) was an HP printer. Which is why I stopped using Windows
altogether.

My experience since then? Windows is a royal PITA to use and maintain. Linux,
with KDE as the desktop manager, isn't just faster, it's way friendlier for
users. One example, which to me is huge: on Windows, you need to run the
updater of every f..ing software provider from which you have purchased an
app. On Linux, there's just one updater for everything. another one: on
Windows, even with all the discount programs for students and others, you have
to spend thousands of dollars before you get equivalents of all apps installed
that you get for free when you select developer workstation for a Linux
installer.

Agreed, games are the only thing that Linux doesn't yet cover as well as
Windows - both development and play. However, wanna bet that Linux will tip
the balance in this area too, in at most five years?

------
ChuckMcM
One wonders if you can go to a full 'subscribe' model which a bunch of pre-
emptive OSes use, which says "I need to run in 'x' nS" or "I need to run when
interrupt 'y' fires." and then they don't get any cycles at all until they
need them, and at that time they are arbitrated.

The challenge of course is priority inversion, which is to say that low
priority thread A gets started on an otherwise idle processor and then higher
priority thread B wants to run, except there isn't a 'tick' where the
processor periodically checks to see that the highest priority thread is
running. Now your low priority thread is running in preference to the high
priority thread.

You can finesse some of that by interrupting on thread state change (which has
its own issues since sometimes threads have to run to know they want to change
their state) but you're still stuck somewhere between ticks when threads are
sleeping and full tickless. Not surprisingly its kind of like building
asynchronous hardware in hardware description languages.

I'm glad to see the experiments continue.

~~~
mwcampbell
I wonder if any general-purpose OS kernel is ahead of Linux in this area.

~~~
cokernel_hacker
Do you consider xnu to be general purpose? OS X/iOS have been tickless for a
long, long time.

~~~
adestefan
This is why power management has been superior in OS X/iOS.

------
dchichkov
Kudos to Frederic. It was quite an effort:
<https://lkml.org/lkml/2012/8/18/77>

And! Yes! Finally. Our 'isolated' cores are finally ours. Bare metal. No more
jitter. Thank you for everyone who put that together. Your efforts are really
appreciated!

------
zokier
The advantages of full tickless elude me somewhat. Single percent performance
gain does not seem worth the effort, so what else? For real-time operation
tickless may make sense, but on the other hand idk how much ticking interferes
currently RT processes on linux.

~~~
IgorPartola
I was under the impression that tickless operation would translate to better
power savings, but I may be wrong on this.

~~~
acallan
Precisely. The latency of some of the more aggressive power states exceeds the
resolution of most OS tick timers, so they are often aborted for no good
reason. So, as I'm typing this reply, in-between keystrokes, voltage to the
CPU can be killed (not just clock-gated).

~~~
sliverstorm
Hmm. Completely brown-out the CPU in between keypresses? I always heard cold
starts are very very slow (compared to regular operation). While I guess I
don't have a measure for _how_ slow, it seems unlikely that if a user is
typing at 360CPM (60WPM * ~7), that you will be able to completely shut off
the CPU much.

~~~
glhaynes
I'm not sure about the CPU numbers either (though my understanding is that
modern CPUs are super-quick to power down and back up), but I think 360 CPM is
way too high: few people type at 60 WPM, most words aren't 7 letters long, and
nearly no one is typing 100% of the time they're at their computer.

~~~
sliverstorm
Oh, I agree there is ample opportunity for shutting down the CPU. I probably
spend more time just looking at the screen reading, than any other activity.

------
lallysingh
Posting a subscriber link to HN is a bit abusive, no? Quoting:

    
    
      The "subscriber link" mechanism allows an LWN.net subscriber to generate a 
      special URL for a subscription-only article. That URL can then be given to 
      others, who will be able to access the article regardless of whether they 
      are subscribed. This feature is made available as a service to LWN 
      subscribers, and in the hope that they will use it to spread the word about 
      their favorite LWN articles.
    
      If this feature is abused, it will hurt LWN's subscription revenues and 
      defeat the whole point. Subscriber links may go away if that comes about.

~~~
bmm6o
> This feature is made available [...] _in the hope_ that they will use it to
> spread the word about their favorite LWN articles

Emphasis mine. Can you make a case for it being "abusive" in the context of
the full text? I take it to mean generating an excessive number of links, not
posting one link to a wide audience.

~~~
lallysingh
I took it as sending the occasional article to people you know. Not as a way
to poke a hole through the paywall and send (via HN) it to thousands and
thousands of people.

~~~
corbet
FWIW I (as the editor of LWN and the author of the article) do not mind the
posting of this link. It has brought in 16,000 people (at last count), many of
whom are probably unfamiliar with LWN. Some subscriptions have been sold in
the process.

Certainly I don't want large amounts of our content to be distributed this
way, but an occasional posting that puts an LWN article at #1 on HN is going
to do us far more good than harm.

(That said, I do appreciate your concern!)

~~~
nnnnni
Hey, look at that! A smart, forward-looking attitude! I really need to renew
my subscription. I let it lapse a while ago due to a lack of free time.

I think that this may convince me that I need to move it up higher on my list
of priorities!

~~~
MBCook
I've been addicted to the kernel page since I first found out about it 10+
years ago. When they put up the pay wall it looks than a month before I cave
and subscribed so I wouldn't have to wait.

I read the kernel page and front page religiously, and read bits of the
others.

I can't imagine how many things I've learned following the kernel's
development. But the mailing lists are HUGE and thus hard to follow. LWN makes
keeping up possible.

------
stcredzero
How is 1 process per CPU not a "real load?" How about a server or a VM on that
processor?

~~~
claudius
You will always have more than one process running, if only for the kernel
threads handling filesystems, networking etc., so you can only get that if you
have at the very least two CPUs. And even then you usually have more processes
than CPUs and the ‘application’ split up in various processes that in turn
require scheduling by the kernel.

~~~
stcredzero
Yes, but specialized server installations where multi-core CPUs have one
process sitting on one core are still "real" loads. They're just specialized
and not the common case.

------
swah
Anyone knows if the paid OSes have this?

~~~
dantle
Windows 8 pushes out the tick. See "Idle Hygiene" here:

[http://blogs.msdn.com/b/b8/archive/2011/11/08/building-a-
pow...](http://blogs.msdn.com/b/b8/archive/2011/11/08/building-a-power-smart-
general-purpose-windows.aspx)

~~~
blinkingled
You sure about that? I read that section and it seems to be about idle
duration whereas this is about turning off the timer interrupt on non-idle
CPUs.

~~~
dantle
You're right, FULL_NO_HZ isn't mentioned in the blog I linked. It's more
similar to CONFIG_NO_HZ.

