KSE Progress On FreeBSD SMP Environment 60
Dan writes "This is a significant milestone to be shared with everyone! Khairil Yusof reports that libkse is now running quite well on his FreeBSD 5.1+ current based SMP system. He has tested a bunch of apps on his system, taking the approach of enabling kse one app at a time. He reports a current uptime of 23hrs with these apps running with libkse.so.1, and basically a usable Gnome 2.2 desktop environment. He says that with recent updates, you can now see the threads with top(8). Kernel Scheduler Entities (KSE), is a kernel-supported threading system similar in design to Scheduler Activations [Anderson, et. al.]. It strikes a balance between user-level (1:N) and kernel-level (1:1) threading models, giving most of the advantages of both, and few of the disadvantages of either."
More Power to you (Score:4, Insightful)
Testsuit and benchmark (Score:5, Interesting)
LIBMAP permits to cleanly test it on your system (5.1-RELEASE or -CURRENT) one application at a time (you redefine libraries linking per application). I've tried it with mozilla 1.4b for more than a week now without any trouble.
However I wonder about developper's testsuit and benchmarks in order to give some clues to others about how great KSE is.
How to enable libmap (Score:4, Informative)
cd
make -DWITH_LIBMAP
make install
Then you need to have a libmap.conf in your
Here is a sample with mozilla firebird mapped to libkse:
[/usr/X11R6/lib/firebird/lib/mozilla-1.4b/Mozil
libc_r.so.5 libkse.so.1
libc_r.so libkse.so
Just add more entries if you wish. You can test out whether an application is using libc_r or libkse by running ldd(8).
Note the library mapping can be done as Scott mentions also for libthr also for 1:1 threading.
Re:Elegy for *BSD (Score:1)
Re:Elegy for *BSD (Score:1)
Threads in top (Score:4, Insightful)
I hope this is something you can turn off and on. One of my problems with the Linux threading model is that you see every thread as a proc, which makes it harder to administer a box. top output becomes overwhelming.
Re:Threads in top (Score:4, Informative)
Re:Threads in top (Score:4, Insightful)
The support that I added was to make the kernel return info on all threads unless it is told not to. I then changed ps(1) to tell the kernel to not return all threads unless the user specifies the -H option. I didn't modify top as it is vendor code and I haven't gotten around to tackling it yet.
As for your observation, remember that in KSE/SA the kernel only knows about the threads that have blocked inside of it and the per-CPU scheduler activation (i.e. execution context) that it supplies to the userland scheduler (UTS). It has no knowledge of threads that the UTS creates that stay in userland. Sooo.... it is likely that you saw a thread that blocked in the kernel waiting for the socket, and then left the kernel once the socket woke up.
Don't forget that there is also the libthr 1:1 library. That creates a kernel thread for every user thread. Since the kernel knows about every thread, ps and top will show each thread also.
I'm incredibly pleased with all of this. I finally got around to reading the SA paper last month, and it's very cool to see KSE start to realize its potential. 5.2 and 5.3 will be very exciting releases.
Re:Threads in top (Score:1)
Take MacOS X's top output for example:
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
14055 mozilla-bi 0.8% 7:18.05 12 185 803 43.3M 30.3M 56.2M 278M
As you can see it's just a field in top that shows the # of threads under that process. I'd imagine that would be how it is done in FreeBSD as well. I could be wrong though, can anyone confirm?
Cheers,
-JD-
Re:Threads in top (Score:1)
Re:will this be eventually ported to the other BSD (Score:3, Informative)
I know OpenBSD has a group in a totally different project working on SMP for OpenBSD. The different BSDs have fairly different kernel internals as far as I know. It certainly wouldn't be a cut and paste job.
Hard to do SMP securely (Score:4, Informative)
Re:Hard to do SMP securely (Score:1)
Re:will this be eventually ported to the other BSD (Score:3, Informative)
I'm not sure about OpenBSD, but there's not much shared code in those areas between NetBSD and FreeBSD. On NetBSD, Bill Sommerfeld did most of the i386 SMP code, and Nathan Williams is the guy who's working on scheduler activations. SA is a M:N implementation, not much different from FreeBSD's KSE, which was developed mainly by Julian Elisher. SMPng is the work of many people, specially John Baldwin. Note that KSE is only really finished on i386, Alpha and Sparc64 are still missing some bits.
SA is not a
Re:bsd problems (Score:1)
IT WORKS FOR ME
Re:bsd problems (Score:5, Informative)
It would have been nice for you to mention that you're using a Mac, instead of obtusely implying it (8600, BBEdit Lite).
The section of OSX that copying a file involves is not BSD-related, as I understand it. It's Mach. (People who know more about OSX than I do, feel free to pipe up.) The kernel of OSX is not very BSD-based, and most of what you're talking about (HDD access, scheduling) takes place in the kernel. (To be fair, the scheduler that FreeBSD uses was adapted from Mach.)
The 8600 (which was discontinued over a half decade ago, by the way) is not even compatible with OSX. The minimum requirement for OSX is the Beige Power Mac G3. (See Apple's requirements page [apple.com].) So, I'm guessing you put in a G3 daughterboard. (Find out about the 8600 and available daughterboards at lowendmac.com [lowendmac.com].) But OSX doesn't support processor upgrade cards. (First paragraph of the requirements page.) Maybe you didn't put in an upgrade card, and are using the mach_kernel for the 604 from the Darwin project like this guy did [xappeal.org]. Either way, you're still not using a supported system.
So, you're using unsupported hardware, and a BSD-related OS in an operation that's not related to the BSD bits, and using this to say that BSD sucks. Hmmm.
I'm surprised an 8600 w/ daughterboard (which one, by the way? The 233MHz with 512k of cache?) works at all with OSX. As for why it's slow for you, I can only hypothesize, since I'm not a Mac guy. (That's right, anybody can find this stuff out with a quick google search or two!) The G3 upgrade card is going to need an L2 cache enabler. Do you have one installed? Okay, how about this idea. I'm guessing that your old, discontinued, unsupported hardware uses a bus controller (or other critical chip) that is not being programmed optimally by OSX. Why? Because the programmer writing that code knew that the chip wasn't going to be supported!
My advice is to stick to using 9.1 on your 8600. And don't generalize about BSD from your situation; it's an extreme.
Re:bsd problems (Score:2)
My advice is to stick to using 9.1 on your 8600. And don't generalize about BSD from your situation; it's an extreme.
It's a search-and-replace of an ancient troll [kottke.org]--the original was about classic MacOS; it's been reposted as about MacOS X, and now as about BSD.
In general, keep in mind that stories in the BSD and Apple sections will always have these stock trolls (e.g., "BSD is dying," "Elegy for BSD," "Deve
Re:bsd problems (Score:1, Informative)
Re:bsd problems (Score:1)
This guy is one sour System 7 user.
Comparison (Score:3, Interesting)
TIA
Re:Comparison (Score:4, Informative)
Re:Comparison (Score:2)
Linux has one kernel thread per thread-the-user-program-thinks-it-has ("apparent threads"). The old pthreads lib had one kernel level thread per process no matter how many apparent threads there are. The new KSE has some threads per process, but that can be far fewer then the number of apparent threads.
Having one kernel thread per apparent thread means you don't need non-blocking k
Re:Comparison (Score:1)
Re:Well.... (Score:1, Interesting)
KSE + SCHED_ULE (Score:3, Interesting)
FreeBSD has a number of projects that are nearing production-ready that will greatly enhance an already incredible OS!
FreeBSD on SMP-steroids (Score:1)