Significant Interactivity Boost in Linux Kernel 673
An anonymous reader writes "The Linux kernel team is at it again. Linux creator Linus Torvalds recently proposed a patch to offer interactive processes a boost, greatly benefiting the X desktop, as well as music and movie players. O(1) scheduler author Ingo Molnar merged Linus' patch into his own interactivity efforts, the end result nothing short of amazing... The upcoming 2.6 kernel is looking to be a desktop user's dream come true."
Amazing! (Score:5, Funny)
Now what the hell is this article about?
Re:Amazing! (Score:4, Funny)
It's about how GNU/Linux is violating SCO patents to make a more responsive desktop experience for the user when playing videos, etc. At least, that's what'll be on record when SCO sues IBM for helping them with this 2.6 kernel by stealing their intellectual property. Afterall, everyone knows SCO UNIX was the most responsive multimedia system of it's time. *rolls eyes*.
Re:Amazing! (Score:5, Funny)
Who me? No, I don't know what the hell is going on either.
*woosh* *woosh*
Re:Amazing! (Score:3, Funny)
Re:Amazing! (Score:5, Informative)
huh? (Score:5, Funny)
At it again? At what again? That sorta makes it sound like a girls gone wild video or something. Kernel Dev's Gone Wild volume 3, where Ingo and Linus bare their breasts for beads at a Linux user conference in Tampa Bay - no, that's just too strange...
Oh, one more thing:
Hello, my name is Ingo Molnar. You killed my father: prepare to die.
No no no! (Score:5, Funny)
My name is Ingo Molnar. You kill -9'd my parent process. Prepare to die()
Re:huh? (Score:5, Interesting)
Well, here is Linus replying to Molnar's post:
OK, maybe not gone wild as in baring their breasts, but certainly gone wild as in no-holds-barred flamageRe:huh? (Score:3, Interesting)
Red Hat- Because being a beta tester for kernels is cool!
(I love red hat, I just think AC takes some big risks with the RH kernel wrt controversial patches)
Actually... (Score:4, Informative)
Re:Actually... (Score:3, Interesting)
If this patch is causing great excitement, then I can only assume linux is now more responsive on the desktop than windows.
Now, if only supermount was in the 2.5 kernel tree........
Re:Actually... (Score:5, Informative)
It doesn't. It goes through a UNIX socket. There is a significant difference.
I somehow doubt there was a single reason.
Concentrating on the UNIX socket is a mistake anyway. You need some form of client/server separation; otherwise you could never run more than one client. You also need some form of synchronisation between the clients and the server; otherwise you would have two clients accessing the hardware at the same time and most video hardware would simply lockup. The synchronisation method could be locks or mutexes or message passing or sockets; X11 chose a socket because that gives you UNIX sockets (local, high speed) and TCP/IP sockets (remote, flexible) without needing to code for special cases. Network transparency "for free".
Now the real question with X11 is "who should control the hardware". With X11 they decided a single process - the server - should control the hardware. This is perhaps the serious argument against X11. There are several reasons why this hurts performance but the serious problem - the one you inelegantly complain about - is that the client has to bundle all drawing requests up and send them to the server.
But stop. What's the real problem here. It's not that the bundling had to occur. No matter what model you chose there would have to be some data bundled up and sent between client and server. The real problem is the quantity of data. In Windows the quantity is a single message which is always quite small. In traditional X11 the "message" (aka request) grows without bound. If you're passing a huge bitmap then the request will be several kilobytes. Network transparency comes at a cost.
But stop again! Is this really a problem? The answer is no. X11 is extensible. All of the problem cases - bitmaps, video, 3D - can be special-cased with extensions. So on XFree86 we have Xvideo, MITSHM and DRI. In a traditional X11 model these guys would have stuffed the pipe to overflow and everything would have gone to shit. In modern XFree86 there is a second path that bypasses the pipe. You'll notice that DRI even allows the client to directly access the hardware! Network transparency is still there but can be bypassed on a needs basis. Perfect.
Now your argument shouldn't be "why do we need a client/server model" but "could we use something faster than sockets". The answer is no. There has already been work done by the XFree86 team where they tried a shm transport. It's no faster. Linux sockets are simply too quick. There's no reason to think that message passing would be any faster: effectively the X11 socket is a highly tuned message passing API. The platform independent nature of X11 means you'd need to use a platform independent message passing API. That probably means RPC or CORBA; X11 is going to be faster than either of those.
Anyway, my point from all of this is that the performance problems you complain about are being fixed. The developers are not idle and they are not stupid (far from it). If you wanted somebody to make your desktop faster then you could do no better than to put your trust in the current XFree86 developers team. They are a truly remarkable group of developers. They are not ignoring the performance problems. Give them some credit for understanding the depth of the issues rather than the superficial "why does XFree86 use TCP/IP?" misunderstanding that tries to pass for constructive criticism.
Re:Actually... (Score:3, Informative)
Re:Actually... (Score:4, Informative)
And the real reason apple didn't go with X is because they wanted to use the OpenStep API and that's written to use a display postscript backend. It was easier to change those slightly to use a similar display pdf backend then it would be to rewrite them to use the completely different architecture of X (X is missing things like vector manipulations, resolution intependant objects and generally everything display postscript/pdf does well).
The Tao of Linux (Score:5, Funny)
If the Tao is great, then the box is stable. If the box is stable, then the server is secure. If the server is secure, then the data is safe. If the data is safe, then the users are happy.
In the beginning there was chaos in Unix.
Tanenbaum gave birth to MINIX. MINIX did not have the Tao.
MINIX gave birth to Linux 0.1 and it had promise.
Linux gave birth to v1.3 and it was good.
v1.3 gave birth to v2.0 and it was better.
Linux has evolved greatly from its distant cousins of the old. Linux is embodied by the Tao.
The wise user is told about the Tao and contributes to it. The average user is told about the Tao and compiles it. The foolish user is told about the Tao and laughs and asks who needs it.
If it were not for laughter, there would be no Tao.
Wisdom leads to good code, but experience leads to good use of that code.
The master Cox once dreamed that he was a Kernel. When he awoke he exclaimed: "I don't know whether I am Cox dreaming that I am a Kernel, or a Kernel dreaming that I am Cox!"
The master Linus then said: "The Tao envelopes you. You shall create great code for Linux."
"On the contrary," said Cox, "The Tao has already created the code, I will only have to find it and write it down."
A master was explaining the nature of the Tao to one of his students:
"Is the Tao in the VM subsystem?" he asked. "Yes," replied the master.
"Is the Tao in the scheduler?" he queried again. "The Tao is in the scheduler."
"Is the Tao even in the modules?". "It is even in the modules," said the master.
"Is the Tao in the Low-Latency Patch?"
The master frowned and was silent for much time.
"You fail to understand the Tao. Go away."
The Tao is the yin and the yang. It is the good and the evil, it is everything and yet it is nothing, it is the beginning and the end.
The Tao was there at the kernel compile, and it will be there when the kernel panics.
A novice user once asked a master: "Why compile in C when C++ is more popular?"
"Why a monolythic kernel when Mach is more popular?"
"And why use ReiserFS when ext2 is more popular?"
The master sighed and replied: "Why run Unix when NT is more popular?"
The user was enlightened.
A frustrated user once asked a master: "My kernel has panicked, should I post to lkml?"
"No," replied the master, "You will only bother the Tao."
"Should I rm -rf?"
"No, you will have wasted the Tao's time."
"Well should I search the web?"
"You will search for all eternity," said the master.
"Perhaps I should try FreeBSD?"
"Then you will have disgraced the Tao."
"I suppose I could try gdb," said the user.
The master smiled and replied: "Then you will have made the Tao stronger."
A stubborn user once told a master: "I run version 2.2. I always have, and I always will."
The master replied: "You are foolish and do not understand the Tao. The Tao is dynamic and ever changing. Linux strives for the perfection that is the Tao. It flows from version to version with peace."
"So my Linux does not have the Tao, so what?" said the foolish user. "Oh your Linux is of the Tao," said the master. "However, the Tao of Linux follows the Tao of the C library. One day the C library will change, and your Linux will be left behind." The user was silent.
An angry user once yelled at a master:
"My Linux has panicked! What lousy software it is, I hate it so!"
"You are insulting the Tao," said the master. "The Tao is everywhere bringing order to hundreds of networks, aiding thousands of users, and fighting that of which we call the 'lame.' Do not disrespect the Tao; however, the Tao will forgive you."
"I apologize," said the user, "And I will be more forgiving the next time the Tao fails me."
"The Tao has not failed you, it is you that has failed the Tao," said the master. "The Tao is perfect."
The Tao decides if a kernel shall compile, or if it shall abort.
The Tao decides if a kernel shall boot, or if it shall freeze.
The Tao decides if a kernel shall run, or if it shall panic.
But, the Tao does not decide if a box will have no hardware failures. That is a mystery to everyone.
A young master once approached an old master: "I have a LUG for Linux help. But, I fail to answer my students' problems; they are above me."
The master replied: "Have you taught them of the Tao?" he asked. "How it brings together man and software, yet how it distances them apart; how if flows throughout Linux and transcends its essence?"
"No," exclaimed the apprentice, "These people cannot even get the source untarred."
"Oh, said the master, "In that case, tell them to RTFM."
A master watched as an ambitious user reconstructed his Linux.
"I shall make every bit encrypted," the user said. "I shall use 2048 bit keys, three different algorithms, and make multiple passes."
The master replied: "I think it is unwise."
"Why?" asked the user. "Will my encryption harm the mighty Tao, which gives Linux life and creates the balance between kernel and processes? The mighty Tao, which is the thread that binds the modules and links them with the core? The mighty Tao, which safely guides the TCP/IP packets to and from the network card?"
"No," said the master, "It will hog too much cpu."
The core is like the part of the mind that is static. It is programmed at a child's creation and cannot be changed unless a new child is made; unless a new kernel is compiled.
The modules are like the part of the mind that is dynamic. It is reprogrammed every time one learns new knowledge; every time one learns better code.
One is yin, the other yang. Each is nothing without the other.
A novice came to lkml and inquired to all the masters there: "I wish to become a master. Must I memorize the Linux header files?"
"No," replied a master.
"Must I submit code to Bitkeeper?"
"No," replied the master.
"Must I meditate daily and dedicate my life to Linux?"
"No," replied the master again.
"Must I go on a quest to ponder the meaning of the Tao?"
"No. A master is nothing more than a student who knows something of which he can teach to other students."
The novice understood.
And thus said the master:
"It is the way of the Tao."
A user came to a master who had great status in lkml. The user asked the master: "Which is easier: implementing new features to the kernel or documenting them?"
"Implementing new features," replied the master.
The confused user then exclaimed:
"Surely it is easier to write a few sentences in the man page than it is to write pages of code without error?"
"Not so," said the master. "When coding, the Tao of Linux opens my eyes wide and allows me to see beyond the code, to let the source flow from my fingers, to implement without flaw. When documenting, however, all I have to work with is a C in high school English."
He who compiles from the stable tree is stubborn
and unwilling to change, but is guaranteed reliability.
He who compiles from the current tree is wise but perhaps too conformist, but is guaranteed steadiness.
He who compiles from the unstable tree is adventurous and is guaranteed new innovations: some good, some bad.
He who compiles straight from Bitkeeper is brave but guaranteed turbulence.
They are all of the Tao. One shall respect the old, and debug the new; none shall argue over which is greatest.
There once was a user who scripted in Perl: "Look at what I have to work with here," he said to a master of core, "My code is interpreted dynamically, the syntax is unique and simple, I have sockets, strings, arrays, and everything I could ever need. Why don't you stop meddling in C and come join me?"
The C programmer described his reasoning to the scripter: "Scripting is to C as ebonics is to Latin. If the scripter does not grow beyond that of which he scripts, he will surely {die}. Besides, without C, how can there be script?"
The scripter was enlightened, and the two became close friends.
X11 Beh. (Score:3, Interesting)
My 2 1/2 cents Canadian
Re:X11 Beh. (Score:5, Insightful)
But even considering the larger and more featured system, X11 is as fast, or faster, than windows on all but one of my machines, the one where its slower is because the graphics card is very poorly supported by X.
What causes slowness more than X11 itself, is the programs running on top of it... KDE for instance, its hardly a speed demon compared to say, windowmaker.
You dont need a high end videocard to make X smoothe, you just need one that`s well supported... my PCI ATI Rage Pro works perfectly, as does my Elsa GLoria Synergy, both are oldish 8mb pci cards.
Any system will completely suck with poor drivers, try configuring windows to use generic vga or vesa drivers if you want a laugh.
X11 is FAR superior to any local-display-only gui system, i have several machines here, and 1 monitor for X, apps running from each machine and displayed here and interacting smoothly with each other and with locally running apps.
This is the classic X argument (Score:4, Insightful)
Ugh. I don't buy it.
To put it in perspective, lots of Unix has a big organization problem. X is just emblematic. It's "lower-level" APIs are a big stinking mess. Ever tried to program against it without a super-high-level bit of middleware? Then let's talk about how nice it is. If you're not up on this, try reading JWZ's rants on it (many written as he was porting Netscape)? X is a 4 foot high sandwich of crap, layer after layer between you and the display, full of massive, sucking complexity, the bugs, inefficiency... even during this supposedly wonderful "network transparent" windowing this foul stew shows its colors, as no combination of two applications or X servers quite looks the same. It's a verifiability nightmare, too, of course (and for instance, disabling X's many attempts to listen and talk on the network are one of the first things you do to secure a machine properly - and for real security, you avoid installing X altogether).
The API design itself is atrocious. The much-touted "flexibility" is really code for laziness - it was a lot of work to do a proper GUI, so no one did it. The mishmash of X server extensions, window managers, font handling systems, etc. that's been cobbled together has led to a nightmare for both programers and users, as any given application doesn't just require "X", but a complex recipe of libraries and versions, and an end-user experience where no two applications look or act the same... or even remotely similar... Where cutting and pasting between windows is a pipe dream, and young geniuses still struggle to configure fonts properly for linux distributors.
Or to just put it plainly, as my friend (who from time to time would write X windows gadgets) would say, it's only about twice as hard as managing the video memory yourself.
"And thank god it's not all standardized, or we'd never have had all those wonderful experiments with different ways to do a GUI that never actually happened." In practice, no system is immune from its initial design choices, and it's been an endless series of awful MacOS knockoffs, multi-button madness, color-pallete spinning goofiness. Is X11 a "GUI experimenters toolbench?" Then I think it's time for something a little more grounded in everyday realities of computer use.
I'm not even warmed up yet. I mean, X is still peppering the filesystem with a hedge-maze of exotically formatted text files describing the hex colors of every pixel of the trim of every window for a variety of appliations and classes in a complex inheritance and assignment scheme that few X developers even understand. Check it out, your XDefaults are "human readable."
Shall we even discuss its security model?
Modern Linux has tried to make its peace with X through wrappers, and we write against Tcl/Tk, Qt, inside the Gnome or KDE framework, and yet still the focus groups come back crying... we try to blame overfamiliarity with windows, but the problems are bigger... all of Unix (and of course Linux) suffers from the same class of problems that X does; as, for instance, an application needs to prompt you to insert a series of CD's, but there is no "single, authoritiative, standard" place to go find out what CD drives are installed on the computer, and what their device names are (yes, we know what they _usually_ are), and finding out if any of the CDs are already inserted involves parsing the text output of a proc file or a mount command, and so on and so forth... And all of this is being done by a messy bash script... so it's no surprise this functionatlity is broken even in, for instance, RedHat's own v8 package manager... I hope you can grasp the metaphor.
It's a mess. Patches won't clean it up. Frankly, it's time we took the whole GUI back to the drawing board. But even if MacOS is the end-all/be-all, we can do it a hell of a lot better than we do in X.
Following are some choice quotes from Don Hopkins' [art.net] essay:
X-Windows is the Iran-Contra of graphical user interfaces: a tragedy of political compromises, entangled alliances, marketing hype, and just plain greed. X-Windows is to memory as Ronald Reagan was to money. Years of "Voodoo Ergonomics" have resulted in an unprecedented memory deficit of gargantuan proportions. Divisive dependencies, distributed deadlocks, and partisan protocols have tightened gridlocks, aggravated race conditions, and promulgated double standards.
X has had its share of $5,000 toilet seats -- like Sun's Open Look clock tool, which gobbles up 1.4 megabytes of real memory! If you sacrificed all the RAM from 22 Commodore 64s to clock tool, it still wouldn't have enough to tell you the time. Even the vanilla X11R4 "xclock" utility consumed 656K to run. And X's memory usage is increasing.
...
X was designed to run three programs: xterm, xload, and xclock. (The idea of a window manager was added as an afterthought, and it shows.) For the first few years of its development at MIT, these were, in fact, the only programs that ran under the window system. Notice that none of these program have any semblance of a graphical user interface (except xclock), only one of these programs implements anything in the way of cut-and-paste (and then, only a single data type is supported), and none of them requires a particularly sophisticated approach to color management. Is it any wonder, then, that these are all areas in which modern X falls down?
...
As a result, one of the most amazing pieces of literature to come out of the X Consortium is the "Inter Client Communication Conventions Manual," more fondly known as the "ICCCM", "Ice Cubed," or "I39L" (short for "I, 39 letters, L"). It describes protocols that X clients ust use to communicate with each other via the X server, including diverse topics like window management, selections, keyboard and colormap focus, and session management. In short, it tries to cover everything the X designers forgot and tries to fix everything they got wrong. But it was too late -- by the time ICCCM was published, people were already writing window managers and toolkits, so each new version of the ICCCM was forced to bend over backwards to be backward compatible with the mistakes of the past.
The ICCCM is unbelievably dense, it must be followed to the last letter, and it still doesn't work. ICCCM compliance is one of the most complex ordeals of implementing X toolkits, window managers, and even simple applications. It's so difficult, that many of the benefits just aren't worth the hassle of compliance. And when one program doesn't comply, it screws up other programs. This is the reason cut-and-paste never works properly with X (unless you are cutting and pasting straight ASCII text), drag-and-drop locks up the system, colormaps flash wildly and are never installed at the right time, keyboard focus lags behind the cursor, keys go to the wrong window, and deleting a popup window can quit the whole application. If you want to write an interoperable ICCCM compliant application, you have to crossbar test it with every other application, and with all possible window managers, and then plead with the vendors to fix their problems in the next release.
In summary, ICCCM is a technological disaster: a toxic waste dump of broken protocols, backward compatibility nightmares, complex nonsolutions to obsolete nonproblems, a twisted mass of scabs and scar tissue intended to cover up the moral and intellectual depravity of the industry's standard naked emperor.
Using these toolkits is like trying to make a bookshelf out of mashed potatoes.
- Jamie Zawinski
...
The fundamental problem with X's notion of client/server is that the proper division of labor between the client and the server can only be decided on an application-by-application basis. Some applications (like a flight simulator) require that all mouse movement be sent to the application. Others need only mouse clicks. Still others need a sophisticated combination of the two, depending on the program's state or the region of the screen where the mouse happens to be. Some programs need to update meters or widgets on the screen every second. Other programs just want to display clocks; the server could just as well do the updating, provided that there was some way to tell it to do so.
...
.Xdefaults", but if he happens to have copied Fred's .xsession, he does an xrdb .xresources, so .Xdefaults never gets read. Susie either doesn't xrdb, or was told by someone once to xrdb .Xdefaults. She wonders why when she edits .Xdefaults, the changes don't happen until she 'logs out', since she never reran xrdb to reload the resources. Oh, and when she uses the NCD from home, things act `different', and she doesn't know why. "It's just different sometimes."
.xresources (or was it a file that was #included in .xresources) of the form *fucked*fontList: 10x22, which he copied from Steve who quit last year, and that of course that resources is 'more specific' than his, whatever the fuck that means, so it takes precedence. Sorry, guy. He can't even remember what application that resource was supposed to change anymore. Too bad.
What this means is that the smarter-than-the-average-bear user who actually managed to figure out that
snot.fucked.stupid.widget.fontList: micro
is the resource to change the font in his snot application, could be unable to figure out where to put it. Suzie sitting in the next cubicle will tell him, "just put it in your
Joe Smartass has figured out that XAPPLRESDIR is the way to go, as it allows him to have separate files for each application. But he doesn't know what the class name for this thing is. He knows his copy of the executable is called snot, but when he adds a file Snot or XSnot or Xsnot, nothing happens. He has a man page which forgot to mention the application class name, and always describes resources starting with '*', which is no help. He asks Gardner, who fires up emacs on the executable, and searches for (case insensitve) snot, and finds a few SNot strings, and suggests that. It works, hooray. He figures he can even use SNot*fontList: micro to change all the fonts in the application, but finds that a few widgets don't get that font for some reason. Someone points out that he has a line in his
...
On the whole, X extensions are a failure. The notable exception that proves the rule is the Shaped Window extension, which was specifically designed to implement round clocks and eyeballs. But most application writers just don't bother using proprietarty extensions like Display PostScript, because X terminals and MIT servers don't support them. Many find it too much of a hassle to use more ubiquitous extensions like shared memory, double buffering, or splines: they still don't work in many cases, so you have to be prepared to do without them. If you really don't need the extension, then why complicate your code with the special cases? And most applications that do use extensions just assume they're supported and bomb if they're not.
X11 developers? (Score:3, Interesting)
The XFree86 page is rather spartan, and I get NO idea what the roadmap for XFree looks like.
Re:If Linux drops X11 (Score:3, Interesting)
Lower-end stuff (e.g. xterms) run slower over a dialup link (I'm sure I'm not even getting 40-50 kbps here), but it's entirely usable, particularly if I've been using it for a little while. Netscape 4 was lousy. I just tried it. I'm at 16-bit colour, BTW.
Back when I had a cable modem (before I moved to a place where they said I'd have a cable modem by the end of last year. hah!), which was capped at 3Mbps, I ran Mozilla 1 over the cablemodem, over a long distance (they hadn't hooked in to KANREN, so my traffic to the university went from Manhattan, KS through Manhattan, NY and back) from my older Ultra10 workstation (It had, I think, just been upped to 256MB RAM), displaying on my Debian (XFree 4? Or was it still 3?) PII 400 w/ 512 MB RAM, and it ran just fine. I don't recall it being substantially slower than local. I was either running 16bit or 24bit depth. Quite possiby 24bit, since I wasn't trying to run many games then (I made it 16bit for games over winex).
Oh, did I mention that those were over an encrypted connection? (ssh X11 tunneling)
Heck, the university used Sun IPX/IPC with Linux as thin-clients, displaying from a couple of (actually fairly crummy IIRC) central servers. It was pretty usable, too.
Slow at 100Mbit my ass.
And, according to www.ncl.cs.columbia.edu/publications/cucs-022-00.
Re:X11 Beh. (Score:3, Interesting)
By those standards, Apple's OS X really sucks.
Re:X11 Beh. (Score:2)
Say What? (Score:2, Interesting)
How does what Linus and Ingo are doing this time differ from previous approaches such as the low latency patch and real time enhancements?
How does this compare to preempt and others? (Score:2)
Is there a slight loss in the case of a large app taking all cpu power? I tried preempt after it was overhyped on slashdot, and found it nice for general desktop usage, but it made quake3 and other cpu hungry games jerky when I tried to play them; I hope it's not the case with that new wonderpatch.
Desktop user's dream? (Score:3, Interesting)
Most desktop users don't know what kernel they have. Even users that have Linux say "I have Linux 8.0".
While I think they'll notice some of this, I think users will see more benefit, and notice very much more, when the kernel is more real-time (pre-empting kernel code).
Re:Desktop user's dream? (Score:2)
Um. Wouldn't the pre-emptable kernel patch be rolled into this too? Isn't that a done problem? Of course, RTLinux isn't rolled in, but an RTOS isn't exactly necessary for an acceptable desktop. I guarantee that I don't know what I'm talking about, but you sound like you don't either.
Real-Time OS not something you'd want... (Score:3, Insightful)
A lot more important work is to ensure "fairness", so that no processes is very slow, and in particular that near-real time processes (like playing a movie, 1/30th of a second is not real-time, it could render it _way_ faster) get "enough" time to make it play smoothly.
From what I've been able to gather, both have been greatly improved in 2.6...
Kjella
Re:Desktop user's dream? (Score:3, Interesting)
While I think they'll notice some of this, I think users will see more benefit, and notice very much more, when the kernel is more real-time (pre-empting kernel code).
Actually, the huge benefits from running CONFIG_PREEMPT have mostly disappeared from 2.5. When the preempt patches were coming out for 2.4, we noticed huge differences in performance, but that's mostly due to a lot of rough edges in 2.4 that have largely been addressed in 2.5.
That doesn't mean that preempt is useless now. On the contrary, having the preempt infrastructure has made it easier to check for a lot of error cases, like functions sleeping with spinlocks held. It's just that turning preempt on in 2.[56] won't suddenly make your box a superdesktop anymore :3
The challenge of scheduling for interactivity (Score:5, Insightful)
Note that responsiveness is not something that will scale with increasing processor speed. So these patches could really have an effect in setting the Linux desktop experience apart. Will this help to capture desktop market share? Whoda thunk it :)
Re:The challenge of scheduling for interactivity (Score:2)
Windows NON-reponsiveness (Score:3, Interesting)
If Windows Explorer (not Internet Explorer, but Windows Explorer, the shell program that displays files and directories on the screen) needs something from the network, and the network is slow in responding, it puts up an hourglass. Even though what it needs is only relevant to the topmost window, it may refuse to let you bring up any other window, either in Explorer _or in any other application_. The condition may persist for large fractions of a minute.
The same thing sometimes occurs accessing files on slow media (diskette or CD-ROM).
How to fix this: (Score:3, Informative)
Predicting the future.... (Score:2)
And I Quote "All the others are A) going to go away or B) be merged into Linux. Linux is simply a more competitive paradigm. When IBM, HP, SUN, DEC (Compaq) and every other PC, Computer embeded device run Linux - the market pressures to toss out the others will be enormous. They already are, sumoe people like Sun though just don't (want to) get it yet."
Written in march 2003 ...
Dell CIO Says "UNIX is dead" [slashdot.org]
My next prediction is that Microsoft is going to get kicked off the desktop, Thank you.
explanation needed, please (Score:3, Interesting)
With that lack-of-linux-knowledge, could someone explain why precisly this is a "Significant Interactivity Boost in (the) Linux Kernel"? Thank you.
Re:explanation needed, please (Score:3, Interesting)
Re:explanation needed, please (Score:3, Interesting)
Re:explanation needed, please (Score:5, Informative)
The kernel development team are experimenting with heuristics to determine what processes are "interactive" and to determine "how interactive" those processes are.
An interactive process is a process which spends a portion of it's time sleeping, waiting for some kind of event, and then needs cpu time quickly after the event happens.
In this case the events are user input and screen redraw requests.
So, the trick is that interactive processes don't need any more CPU time than other processes, they just need it very quickly in response to requests. Low latency.
The question is, how do you determine what processare are interactive, and how interactive they are.
They have developed a system whereby there are effectively "interactivity points" that can be given to and taken away from a process.
The act of being woken up from sleeping by an event awards you interactivity points. The act of completely using up lots of timeslices (acting like a CPU-bound process) takes away interactivity points.
With Linus's new patch, once you've reached a certain threshold of interactivity points, some of your points start going to the process that woke you up. So, if an "interactive" process is always waking up in response to an event from a certain other process, than that other process is also awarded interactivity points.
In the end, your interactivity points are taken into account when choosing which processes get the CPU.
So, with this new code, processes which are "interactive" like your X11 apps get more of the cycles they need when they need them, decreasing their latency, and making them appear to work "better."
Justin Dubs
Re:explanation needed, please (Score:3, Informative)
Re:explanation needed, please (Score:4, Interesting)
It can be done, but it's awkard.
Try SuSE, you get a good desktop and (gasp) consistent config tools in one place. Or try Mandrake, you get the latest desktop and good config tools. Or try Debian, you get an ultra-stable system that can be easily upgraded. Or try Gentoo, you get a faster system on the bleeding edge.
Just use a real KDE 3.1 on a non-RedHat distribution and you will never look back at MS Windows.
Re:explanation needed, please (Score:3, Insightful)
Old fashioned managers handled this by simply giving you an outline of the window you were moving and then doing a full screen redraw. The newer system (say the last 10 years) has been to actually do this real time with dozens of small redraws. This is very CPU intesnive. Further there is an accurate measuring device (the human eye) which notices lacks of performance very quickly.
On a single tasking machine where the computer could dedicate itself to doing this task this still wouldn't present a problem. On a modern OS with dozens of processes running doing things like the above is a scheduling nightmare. A very complicated scheduling system is out because the scheduling system needs to run so many times a second. The result is you need to think of cool tricks to make this work.
The cool trick that windows thought of was using the notion of "forground" and "background" to and thus giving certain apps a massive CPU advantage while others got little if any attention except when the CPU wasn't busy. The problem with that is that it forces the user to either:
a) Have extremely unreliable background processes (default for windows NT/2000/XP desktop)
b) Have an unresponsibe desktop (default for the NT/2000.. server)
More importanly this forground/background solution doesn't solve the problem of competing demons which are having other types of CPU problems.
So Linux long ago rejected this cool trick and there is no notion of "forground" and "background". They were going to handle the problem right or not at all. Now with tuning you can make this particular X related problem go away but only at the cost of introducing other problems, and more importanly all you are really doing is covering the symptom of the disease not curing the diesase. The kernel group has figured out a general solution which improves scheduling for all applications without substantially increasing the complexity of the scheduler.
Unlike many kernel improvements this one will have substantial impact on desktop performance right out of the box when distributions start shipping with the 2.6 series which is why people are excited.
Jumpy (Score:2)
On a 475MHz laptop with ATi Rage Pro video, it runs just as smooth as XP does (they both jump a bit when dragging windows around).
I know this shouldn't happen on the fast PC though. I must have something set up wrongly. Maybe the latest kernel will make it less noticeable though
2D accell (Score:2)
You Thieves! (Score:4, Funny)
for all you... (Score:5, Interesting)
Re:for all you... (Score:3, Informative)
Gentoo, while a great idea, isn't _that_ much faster than other distributions once this fact is taken into account.
Remember, 20% of the code is run 80% of the time, and you get your big performance increase by optimising that.
The patch (Score:2, Interesting)
On Fri, 28 Feb 2003, Andrew Morton wrote:
> >
> > Andrew, if you drop this patch, your X desktop usability drops?
>
> hm, you're right. It's still really bad. I forgot that I was using distcc.
>
> And I also forgot that tbench starves everything else only on CONFIG_SMP=n.
> That problem remains with us as well.
Andrew, I always thought that the scheduler interactivity was bogus, since
it didn't give any bonus to processes that _help_ interactive users
(notably the X server, but it could be other things).
To fix that, some people nice up their X servers, which has its own set of
problems.
How about something more like this (yeah, untested, but you get the idea):
the person who wakes up an interactive task gets the interactivity bonus
if the interactive task is already maxed out. I dunno how well this plays
with the X server, but assuming most clients use UNIX domain sockets, the
wake-ups _should_ be synchronous, so it should work well to say "waker
gets bonus".
This should result in:
- if X ends up using all of its time to handle clients, obviously X will
not count as interactive on its own. HOWEVER, if an xterm or something
gets an X event, the fact that the xterm has been idle means that _it_
gets a interactivity boost at wakeup.
- after a few such boosts (or assuming lots of idleness of xterm), the
process that caused the wakeup (ie the X server) will get the
"extraneous interactivity".
This all depends on whether the unix domain socket code runs in bottom
half or process context. If it runs in bottom half context we're screwed,
I haven't checked.
Does this make any difference for you? I don't know what your load test
is, and considering that my regular desktop has 4 fast CPU's I doubt I can
see the effect very clearly anyway ("Awww, poor Linus!")
NOTE! This doesn't help a "chain" of interactive helpers. It could be
extended to that, by just allowing the waker to "steal" interactivity
points from a sleeping process, but then we'd need to start being careful
about fairness and in particular we'd have to disallow this for signal
handling.
Linus
----
===== kernel/sched.c 1.161 vs edited =====
--- 1.161/kernel/sched.c Thu Feb 20 20:33:52 2003
+++ edited/kernel/sched.c Wed Mar 5 19:09:45 2003
@@ -337,8 +337,15 @@
* boost gets as well.
*/
p->sleep_avg += sleep_time;
- if (p->sleep_avg > MAX_SLEEP_AVG)
+ if (p->sleep_avg > MAX_SLEEP_AVG) {
+ int ticks = p->sleep_avg - MAX_SLEEP_AVG + current->sleep_avg;
p->sleep_avg = MAX_SLEEP_AVG;
+ if (ticks > MAX_SLEEP_AVG)
+ ticks = MAX_SLEEP_AVG;
+ if (!in_interrupt())
+ current->sleep_avg = ticks;
+ }
+
p->prio = effective_prio(p);
}
enqueue_task(p, array);
Improves interactive responsitivity, but... (Score:3, Funny)
Using 2.5.x? (Score:2)
Is there some magic ingrediant i missed? I know modutils changed, but i don't even seem to get to a point where that could make the slightest difference
(had this with 2.5.61,
hehehe. It's getting hot in here.. (Score:2)
*ingo > I tried something like this before, and it didnt work.
*linus >You can't have tried it very hard. In fact, you haven't apparently tried it hard enough to even bother giving my patch a look, much less apply it and try it out.
...
Are you _crazy_?
Normal users can't "just increase the priority". You have to be root to do so. And I already told you why it's only hiding the problem.
...
Get your head out of the sand, and stop this "nice" blathering.
Linus
I read what they did and here's my analysis (Score:2)
Nice that Linux finally caught up with BSD... (Score:3, Insightful)
Anyway, I hope Linus and Ingo now have some spare time for real dreams of power users with Linux desktops - drivers! I used to run Linux at work and at home (used to, because I got rid of the Intel box at home). Between these two machines, I had an NVIDIA card, lucent WinModem, CLIE, Zaurus and an NTFS partition that wasn't recognized by default Redhat kernel.
After every kernel upgrade, I had to recompile 5 drivers. CLIE and Zaurus drivers came in the form of patches that usually refused to apply, or caused a hang when the device was attached! Once I tried a 2.5 kernel because it had some features, like suspend and resume that I could really use. While the default configuration built Ok, once I enabled the drivers I wanted, I couldn't get the thing compiled even before applying my patches.
Yes, you could just run "Redhat operating system", never upgrade the kernel and wait a few months to install a new release. Then you might find binary drivers to download for the kernel for your particular kind and number of CPUs. But the whole point of Linux (on a personal desktop) is to have some fun and try new stuff out easily.
Linux developers really need to stabalize driver interfaces. I should be able to go to kernel.org and download the latest kernel *binary*, then install a binary driver from the CD-ROM that came from my NVIDIA card.
USB and Firewire buses should be exposed by kernel as network interfaces, accessible to user programs through socket API. In this way, USB drivers will be both easier to write/debug AND will not contribute to Oops. For the ultimate of cool, Wine should support Windows USB drivers (my Virtual PC does!) and I should be able to just install Palm and Zaurus desktops and use them rather trying to feed ttyUSBNN to kpilot.
Having a stable system that doesn't have to be rebooted to Windows to use some unsupported USB device is far more important than raw performance. I wish any system's developers - Linux, *BSD, Darwin, BeOS, etc - would concentrate on this goal before going back to play with cool toys.
NT (Score:2, Informative)
The "feature" of biasing the scheduler either towards interactive proceses or to background processes has been around since NT 3.51, if I remember correctly. It was definitely in NT4, released in 1994 (again, IIRC). So, while this is welcome, it's not an innovation, and saying that Linus "proposed" it is misleading.
Re:NT (Score:4, Informative)
Re:NT (Score:3, Insightful)
Patch explanation (Score:3, Informative)
But the good thing about the patch is that it will also allow other servers (HTTP, SMTP - not only the X11 server) to be equally interactive and more responsive to external input.
Yes, thank you (Score:3, Insightful)
Go to xterm, try to unzip a 1 gig zip file (on a HD on that box) and the open mozilla and drag the window around...
Wait wait wait, mouse quits moving... Then it starts jumping all over the screen. Time for a coffee.
This is part pager and part interactive task/busy background task thing that these patches try to fix.
That was a big turn off of the 2.4 kernel for me.
m
Linus discovers priority inversions (Score:5, Interesting)
There are various solutions to this problem. It sounds like the Linux kernel people are trying priority inheritance via the messaging system (local sockets). QNX [qnx.com] has had that for over a decade. Because QNX does almost everything, including all I/O, by message passing, it has to do this right. In the UNIX world, message-passing was added quite late, in BSD, and X is one of the few interactive programs that uses socket communication on the local machine. Sockets are used mostly to talk across the network. So support for time-critical local sockets isn't very good. UNIX pipes were the original UNIX interprocess communication mechanism, and they were intended as batch-like devices. Sockets look, and work, a lot like pipes. This legacy is the real cause of the problem.
Of course, the reason Linux users actually want this feature is so that they can play their pirated MP3s in the background while using X-windows.
Re:Linus discovers priority inversions - WRONG (Score:5, Insightful)
Which is wrong. Did you read the article?
Priority inversion is, as you explained yourself, about a high priority task effectively getting a low priority by being dependend and therefore waiting on a low priority task.
The article is about tasks at the same priority[1]. The task scheduler distinguishes between interactive and non-interactive tasks in order to improve latency where the user cares.
Beforehand, the behaviour failed on a slow, loaded system to recognize the X server as interactive, because then X looks like a CPU-hog[2]. That resulted in freezes of several seconds[3]. Simply speaking, the patch solves this by passing some interactivity points between processes.
You could have easily seen that this is not about priority inversion as one of the suggested work-arounds was to simply increase the niceness of the X process (which wouldn't help, if priority inversion had been the problem).
Regarding QNX: As good as it is as a RTOS, as bad it fails to do something sensible when you have too much processes at the same priority. Having a reasonably working system presumes that each task is assigned an appropriate priority. Of course, the people at QNX did a decent job on the default priorities.
[1] It may have an impact on tasks of different priority. I did not care to investigate that aspect, because that is of minor importance to what the patch is about.
[2] And for the scheduler, interactivity is determined by a process going to sleep often (by waiting for interaction).
[3] For non-interactive processes it is beneficial to do them in larger hunks, i.e. let 5 seconds other processes do their work, then work 5 seconds, instead of having 0.01 second slices and do the switching all the time.
Re:Linus discovers priority inversions - WRONG (Score:3, Insightful)
When you treat tasks differently, you're prioritizing them. All the priority information isn't necessarily encoded into the UNIX-type priority number. This is a nomenclature distinction between "priority" in the formal sense of "who gets the (a) CPU", vs. the classical UNIX representation of priority numbers.
Linux support for multiple scheduler classes? (Score:3, Interesting)
Timeshare scheduling class (the default) attempts to evenly share process time across threads.
Interactive class is used for improving performance with windowing applications.
System class is used by the kernel.
Real Time class is used for fixed priority, fixed quantum scheduling.
Now I'm no kernel hacker and couldn't explain the hardcore details if pressed, but this sounds pretty clever and Solaris is a very neat operating system. These scheduler classes are loaded as modules which strongly suggests that they can be plugged in and replaced if necessary.
In 2.4 there were patches that provided realtime and low latency scheduling for the kernel. The new O(1) scheduler is getting positive vibes from the developers from what I've read, but does it cover these bases or are patches still required? In other words, does Linux now scale from realtime embedded to low latency desktop to [whatever NUMA systems require]?
Interactive Scheduling (Score:3, Funny)
This way interactive processes gained a slight boost. Of course, they had to rethink their algorithm as soon as someone figured out that by hitting return a lot they could speed up their programs! Oops
Linus Patch works in 2.4.x (Score:3, Informative)
The interactivity still wasn't perfect, but it was noticably better. Now if I can just track down and apply Ingo's patch as well....
Re:a desktop user's dream come true? (Score:2, Interesting)
Re:a desktop user's dream come true? (Score:2)
As opposed to windows... (Score:2)
Doesn't work for me (Score:3, Interesting)
Well, okay. Look. I just opened up my X server here on my mac os X box, sshed with X tunneling to my university's Solaris box, opened up xchat, selected some text, and attempted to paste it into a nearby xterm. Oh, hey, guess what, didn't work. I tried what you said. I selected some text, i clicked on the xterm, i tried middle-clicking and right-clicking. Nothing there. Care to tell me what i'm doing wrong?
Anyway, the whole select-to-copy thing is HORRIBLE GUI design. What if you want to select something in order to edit it without *blowing away* the clipboard? What if your hand slips and you select a couple letters of text by accident before you can paste something important into its destination? I, personally, have intense problems with the copy-paste thing because at some point i picked up the stupid habit of often scrolling by selecting text and dragging off the edge of the window, which will obliterate the textboard. And, worst of all, there's that nagging little question: let's say i'm editing a file, and i want to select some text in the part of the document i'm editing, "cut" it, scoll up to the top of the document, delete part of a paragraph, write a couple lines, and then paste what i just cut. What X's copy/paste means is that i must select the text i want to move to copy (making sure not to delete it yet, becuase it would be too easy to accidentally select text and copy over what i've written, losing it forever), scroll up, click where i want it to go, paste, and then delete and rewrite the text around it, scroll back down, and then delete the text i copied. Yeah, way to go on making the interface fit the needs of the user. Dammit.
And then there's the fact that, still, mostly due to the broken silliness of X copy&paste, most applications don't quite work the same, becuase they've all fucking implemented the clipboard in nonstandard ways because those unstandard ways are "better". Which they are, unless for some silly reason you want to copy and paste between applications. We've got the "clipboard" and the "cut buffer" and i don't know what either means, and lately some GNOME apps and such have taken to signing up with a sane (i.e., "copy" and "paste" are commands, and as such require a menu use or a key combination). And then vim has like its ten little internal clipboards, and emacs has some clipboard system i don't even pretend to know the first thing about, and i mostly use vim as my text editor in unix. And none of these apps i've ever seen give the option of choosing which copy/paste behavior you want: i mean, none of them will give you a nice little preference that says "select to copy" vs "select 'copy' from menu to copy" vs "have ten little internal cycling cut buffers with some arcane method of manipulation". And i still don't know how copy/paste within vim is supposed to interact with other X apps. I'd test it right now, but for some reason still unknown to me, i can't get gvim to run over my ssh-tunneling setup. When i try, it says:
X11 connection rejected because of wrong authentication.
XIO: fatal IO error 32 (Broken pipe) on X server "localhost:13.0"
after 0 requests (0 known processed) with 0 events remaining.
The connection was probably broken by a server shutdown or KillClient.
Maybe it doesn't like my MIT magic cookies, or something? But I digress. Face it. Copy and paste is still the most broken thing about X, and that's saying a lot. And maybe i'm just dense, but i still can't figure out how to change my X keyboard mapping on these silly Solaris boxes.
-- super ugly ultraman
Re:Doesn't work for me (Score:3, Insightful)
Personally i very much like the way X11 and the linux console handles cut+paste, its perfect for me, fast and doesnt require me to keep jumping between the mouse and keyboard. Ofcourse it would be better if it was configureable to satisfy people such as yourself, and also for machines with 1 button mouse.. i have to use an old mac sometimes.
Copy & Paste behavior is the BEST thing about (Score:3, Interesting)
Whenever I'm on a windows box, I groan at having to manually copy after selecting, and not being able to paste with one mouse click.
Remember one person's UI annoyance is another person's UI bliss. }:) That's why we'll never agree!
Re:Copy & Paste behavior is the BEST thing abo (Score:3, Insightful)
Re:Doesn't work for me (Score:3, Informative)
man xclipboard.
It has been part of the standard X11 distribution (thus, also XFree86) for ages.
Re:left, no right! (Score:5, Insightful)
Re:left, no right! (Score:3, Insightful)
Re:left, no right! (Score:4, Insightful)
Re:left, no right! (Score:5, Insightful)
How about this radical idea--
Let Red Hat, SuSE, etc. compile different kernels with different options and install them as needed
Re:left, no right! (Score:3, Insightful)
The better answer is to either a) make this option compile time, as someone mentioned, or b) make this option configurable (a la sysctl) at runtime. This would allow distribution maintainers to adjust the setting to match the type of installation they are doing, and users on stock installations to quickly adjust the kind of scheduling they have, just like the little check boxes in windows NT/XP.
Re:left, no right! (Score:5, Informative)
Check out the Solaris 9 Resource Manager [sun.com], which can do both types. It allows you specify at a high level how much of the system's resources each group of processes gets under which conditions. You could say for example, group A (interactive) gets up to 100% unless group B (batch) needs some, in which case allow B up to 30% during the day and up to 70% at night. You could do this sort of thing in VMS over a decade ago. Also, even if the underlying OS doesn't give you the capability, an Oracle server running batch and interactive tasks can do it too.
Re:left, no right! (Score:5, Informative)
Suppose there are two CPU-bound processes marked as 'batch' and one process marked as 'interactive' which spends most of its time waiting for user input, but needs to respond quickly in short bursts when that input happens. The interactive process will get high priority and preempt the two batch processes when it needs to run; but when it goes back to sleep the two batch processes are scheduled with long timeslices.
Re:left, no right! (Score:3, Insightful)
Users are dumb.
Not necessarily the users using the system, but the users developing software for it. If you give them the option of choosing whether their program is scheduled as an interactive process or a batch they will always choose the wrong one.
"Why yes, that is my elitist attitude you are observing. Please be careful with... Doh!"
-Adam
Re:FINALLY! Thank you! (Score:2, Insightful)
"As an avid Microsoft fan..."
And you admit this on Slashdot?! You are brave.
Re:FINALLY! Thank you! (Score:2)
One should remember that X was engineered for flexibility and extensibility rather than speed. So the kernel may make some things better, but it is probably not a major bottleneck in many applications.
Most home-users do not use the advanced features of X (such as XDM, and serving out the display over a network), so I think that one of the things that is necessary is the development of a GNOME suite over framebuffer, which would provide even better performance at the cost of stability. Since GNOME could also work on top of X, we could have a truly extensible environment that could suit home users and corporate users (who may use X).
Re:FINALLY! Thank you! (Score:4, Interesting)
I am curious... which GUI do you use in Linux? What speed processor and how much RAM do you have? Which distribution (or kernel) of Linux do you use?
I ask because it has been my experience that Linux is already considerably more responsive (in terms of GUI performance) than Windows. I use KDE 3.1 with Linux 2.4.20 and I have 512 megs of RAM and a 1.46 Ghz processor.
Now, least people accuse me of trolling (or of pandering to the Linux crowd), I should point out that I am not sure why Windows is so unresponsive. It seems to have something to do with hard drive access. It seems to me that Windows XP is acting like I'd expect it to if I didn't have DMA enabled for my hard drives. Basically, whenever I access the hard drive, the GUI becomes almost completely unresponsive, sometimes taking almost a minute to fire up even a browser. I have checked, though, and I do have DMA enabled.
So I truly do not know what is going on with Windows, but in Linux I just don't have these problems. Under heavy disk access, it may take a few seconds to fire up a browser in Linux, but that's it. MP3s keep playing, my apps are still responsive, etc. etc.
Re:FINALLY! Thank you! (Score:4, Informative)
I have to say that KDE 3.1 is pretty snappy on my measly PII 400 with 320 MB of RAM under Gentoo Linux.
Saying KDE is slow is fudding.
Err (Score:5, Insightful)
That would depend on exactly what you talking about. Those linux users running something like Blackbox would laugh at you for saying so. I'd also suggest as a user of both, KDE and XP have about the same interactive performance as well.
There's no doubt Windows still has more polish than Linux as a whole when it comes to the desktop. And while anything that improves any of LInux's many "gui's" is a welcome event, Linux's gui's are hardly inferior performance-wise across the board like your implying.
"Maybee this will finally blur the line between OS's enough to get more people to switch over."
Performance doesn't rate very high on why windows users aren't switching over. Lack of familiar apps and games, lack of widespread OEM bundling, and lack of millions in marketing are what's keeping people from switching over.
Re:FINALLY! Thank you! (Score:5, Insightful)
Its not just a UI issues; it does relate to the kernel in that the kernels job is to manipulate process priorities and give CPU cycles where they "should best be given". This is actually best done at the kernel level, and NOT the GUI level, because the GUI does not know about the other non-GUI processes is "competing with". I've felt for a long time that something like this should be done in both Windows AND Linux.
Windows is TERRIBLE at this. Consider the following scenario, which most here who here run Windows XP will be able to identify with. You boot up, you've just logged in. The task bar is there on the screen, the start button there, you click on it. And nothing happens. You wait. Still nothing happens. You wait some more. You start to get annoyed and click the start button a few more times. The hard disk is grinding away while Windows XP does all sorts of "invisible stuff" in the background. The computer is about as responsive as a brick. Then after anything from 20 seconds to a minute, the start menu suddenly opens and closes rapidly in quick succession a half dozen times.
THIS IS NOT HOW COMPUTERS SHOULD BEHAVE. Its pathetic. This is a perfect example of the necessity of this. The task bar process doesn't know about all those other background processes hogging CPU after you log in; there is no elegant way for it to magically know when to set its priority temporarily high, and for how long. But the kernel can say, OK, the user is trying to press a button, we must respond, and temporarily boost the start bar (explorer.exe) process and block the others.
On desktop machines (i.e. not servers), user input is the most important thing. If the user presses a button, something must happen. The kernel should be continually shifting priorities around to where the user is focusing his/her input.
Re:FINALLY! Thank you! (Score:3, Insightful)
But the kernel can say, OK, the user is trying to press a button
Just to preempt those people who are about to jump down my throat because "the kernel is not supposed to know about things like buttons", I know that, but thats not what I meant. I was speaking on a more abstract / higher level, but obviously this can still be implemented in terms of lower down OS things, e.g. the Win32 message queue and HWND system: the "OS" *does* know when, for example, when mouse click messages are posted to the DefWndProc of an HWND, and it does know which process is associated with that HWND, etc. In the Linux OS design view, this isn't part of the kernel, no. But in Windows, this is just one layer above what Linux people would classify as being "the kernel"; in Windows there is a lower degree of separation between the two.
Re:FINALLY! Thank you! (Score:5, Interesting)
Re:FINALLY! Thank you! (Score:3, Insightful)
Another thing: try this on Windows 98. While Windows 98 is booting up, just as the desktop gets drawn, press the windows key (or wait till the task bar is just shown).
Windows 98 crashes - you have to ctrl-alt-del and select shutdown.
Re:FINALLY! Thank you! (Score:3, Insightful)
Completely wrong. Most people only care that their computers work reliably for up to 8 hours at a time, and shut them off when they're not in use.
Most people don't 24x7 uptime, and wouldn't want it anyway: computers use quite a bit of power, and power costs money.
Indeed, most people I know turn their computers off when not in use.
Re:Simply More Evidence (Score:4, Funny)
Sure thing. What was the address of their anoncvs servers again? Oh wait, I forgot the "turn into a powerful government and sign a couple hundred non-disclosure agreements"-requirement.
Not quite the same (Score:4, Informative)
Now, *that*, I have to say, is bordering on the flamebaitish -- yes, I see what you're trying to say, but that's a kind of offensive way to phrase it.
Uh...check out Windows 2000 scheduling algos.
It's not exactly the same thing, though even Linus mentioned it (rather offensively, IMHO, to Ingo). Windows has a simple heavy priority boost it gives to the foreground app. That works fine if you're working in a fairly modal manner on a single-user system and you have a desktop-with-foreground-and-background paradigm as a fundamental part of the OS.
Linux's scheduler takes a somewhat more ambitious (granted, that probably means you can trick it more nastily) approach, partly because it has a more general, more difficult task. From what I can tell from skimming the conversation, Ingo's work is something more along the lines of advancing the traditional UNIX approach of "this app didn't use (or is tending not to use) its full timeslice, maybe because it's blocking on I/O, so give it higher priority to get another timeslice than an app that *did* use its full timeslice". He's just doing somewhat more sophisticated automatic classification of whether an app is "interactive" or not.
Yes, on the very surface, it's similar in goal. Make the task that the user is working with get more cycles at appropriate times to reduce latency of interface response. However, the approach is very much different, and the potential benefits are higher (since this automatically addresses a wide range of apps, not just making the foreground app peppier to keep scrolling snappy).
I *will* give you that this has little to do with open source. I suspect that there are plenty of closed-source systems that have tried to do more advanced classification of apps as interactive or noninteractive.
Re:Simply More Evidence (Score:4, Informative)
AmigaOS and windows are both fairly similar in purpose and features tho, unix is more tailored to heavy duty server use, and thin clients, and ofcourse its far more powerfull and flexible. Thus you have a powerfull stable kernel, multiuser abilities, and features such as remote displays and authorization in X.
True, windows has tried to copy some of the age old unix features, but the basic design remains the same with extra things kludged in as an afterthought, and theres still no X style remote apps managed by your local wm, its whole desktop or nothing.
So while windows may be faster on a single machine, due to its simpler design, once you scale up.. to say one server serving hundreds of thin clients, unix really pulls into the lead.
Re:Simply More Evidence (Score:3, Informative)
Now that you say it, I also realize that no Windows machine that I have been using has ever been as responsive as the old Amiga. Of course this is also a hardware issue: the Amiga had pretty strict timing for all I/O operations and memory access. The different subsystems had their own time slots in DMA, which was based on the video refresh timing. To a certain amount other subsystems, like the "Blitter", could steal DMA cycles from the CPU. There was even a chip, the "Copper", that could perform certain actions based on the position of the electron beam of the monitor. In my opinion, this chip was the key to most of the impressive effects that could be produced by the Amiga. OTOH, such a design is pretty hard to scale w.r.t. speed. In the end, the Amiga declined because Commodore neglected hardware development for too long.
Re:Simply More Evidence (Score:5, Interesting)
The non-obvious improvements are things like making the applications that depend on, or are depended on, by the interactive app, run faster. There are also additional tweaks to this that that are being considered such as giving interactive programs a smaller time-slice, but more of them, so it'll do things like paint the windows properly in respose to your movements, but it won't bog the rest of the system down.
Technically, scheduling tweaks do add to code complexity, but only in such a tiny way. Linus's patch was five lines. And Linus is very concerned with making sure patches are self-contained and, when possible, aren't spread out, a few lines in many different areas. He's got a very good, very "correct" attitude about design. It comes from him being happy with Linux for years now, he's not rushing to any specific point so it becomes useful. He's willing to put the time in to do it right.
Anyways, this is to say that most kernel patches don't lead to complexity, most decrease the complexity of the code. Linus has often sent patches back to be done the "right way" instead of allowing a hack. This tweak is so small and self-contained that it can't really be said to add complexity to anything.
Re:Dial-up (Score:2)
There was a time .... (Score:5, Informative)
Linux still screams, I have a single server with two gig's of ram in it that runs 100 desktops (KDE) simultaneously. Yes it indeed takes alot of ram to run all of the new software. But for a machine that runs 2200 processes that is a impressive feat. It is a dual processor box and I have yet to see it reach over 30% processor utilization, a testament to the efficency of the kernel.
Software today requires a ton of ram, this has nothing to do with efficency of the linux kernel.
Along with this goes the idiots that think there is something wrong with X. I run this stuff in a corporate environment and X windows is linux's biggest strength. Remove X Windows and I would have to eliminate our corporate use of Linux.
There was also a time when.... (Score:5, Funny)
Oh wait. No there wasn't.
Re:There was a time when... (Score:2)
Re:well .. (Score:2)
another revolution! [...] again
'Round and 'round as in revolutions per minute?
Re:Why not a real-time scheduler? (Score:5, Insightful)
X is the most important example, since it doesn't help how much CPU your xterms or other X clients you run get if X doesn't get enough CPU time to service them, as if X doesn't get enough time the only thing extra CPU time will give your x clients is the ability to go back to sleep faster and more often.
Realtime scheduling is something else alltogether. Realtime scheduling is about predictability, not about CPU time allocated. With a realtime scheduler you can guarantee that task A get some time at least every 10ms, for instance, but if you're maxing out the CPU you still need a way of deciding which tasks have priority, or reduce their overall time slices.
The kernel patches in question attempts to decide which tasks to give priority automatically, instead of resorting to hacks like using nice on specific processes. It achieves that by making the assumption that if task A is interactive, and it frequently waits on B, then task B needs to get more CPU too.
Since a high load desktop scenario will likely have lots of clients waiting on X the result is that X will get more CPU even if X itself isn't an interactive task, and hence the machine will hopefully feel more responsive.
The way this is being accomplished is good because it doesn't special case - any non-interactive task that provides vital services to interactive tasks will get more CPU (though in this particular implementation, I believe only if they communicate using Unix domain sockets), without the user or developers having to guess which processes should get it.
Re:Cool, they're reinventing Windows (Score:3, Interesting)
Did you actually read the article? This has nothing to do with foreground processes, and everything to do with making things more responsive for processes that are going to relinquish their locks more quickly. The only reason X is brought up as a demo is because (being a monolithic and single-process beast) it's easiest to notice when X is lagging behind a bit because of the (previous) sucky heuristics.
The double-whammy of Ingo's patch combined with Linus's little 6-liner is quite impressive. I've got a make -j3 running in my background right now, while I'm running KDE and using the XFree-supplied 'nv' driver (instead of the NVidia supplied one... haven't yet checked to see if NVidia has ported their driver to work with 2.5.x, or if it Just Does [TM]). I can move windows about with better responsiveness than my Win2K install gives me when it's just finished a huge task (compilation of a large project, exiting out of Counter-Strike). This is a very welcome improvement.
As a side note: Isn't it funny how the users with the higher Slashdot IDs seem to be more MS-friendly than those of us who've been here a while (with a few notable low-UID exceptions).