FreeBSD SMPng Interview with Scott Long
animus9 writes "There's an interesting interview with Scott Long over at the ONLamp.com. Scott explains the difference between the various locking methods, and the current status of SMP in FreeBSD 5. He also compares the new SMP implementation with that of FreeBSD 4.x, NetBSD, DragonFly, and Linux. Other items touched upon include scalability, the status of KSE & ULE, and much more."
I must say that reading this interview only reinforced my gut feeling that FreeBSD and other BSD variants start to look as a viable alternative to Solaris and Linux. This is consistent with the attitude in my company. To make a long story short, I received the email first thing in the morning from the IT department. Our network would be undergoing a major overhaul to correct the ad hoc growth it had experienced in the last year, and starting next week Internet access would be sporadic. There would also be a new firewall and security measures, replacing the old OpenBSD system I'd managed to get installed last Spring. Happy for the heads-up, I went to work right away to make sure Linux had no place on our network. This was not the first time that I had faced this threat.
One day about a year ago our network guy gets asked to draw up firewall plans for this subnet of servers we have. Our network guy was your typical GNU-slinger save that he had a cascade of flowing hair down the back of his head and not a beard hanging from his face. And yeah, you can guess what he thought those firewalls were gonna run. Fast forward two days. I'd caught wind of the plans and had charts, graphs, and comparisons written up detailing OpenBSD and Linux security. Since this GNU guy had a mullet and dressed like a slob, I got taken seriously. Not to mention my data, impenetrable by any hippy "logic." OpenBSD was the more secure, even to the beancounters and idtiot management. So thanks to me, our firewalls happily run OpenBSD and not Linux, which would have buffer-overflowed into no-man's land every other hour. The Open Source Mullet gives me a lot of dirty looks lately.
Since the Open Source Mullet had been canned, a new threat had arisen at my workplace: the Fat Perl Hacker had assumed most of the Open Source Mullet's system and network administration duties, and it was no mystery to anyone at my workplace that he had a hard-on for Linux tucked away under his enormous, cascading gut. Since he was a major suck-up and workaholic, he had a lot more credibility than the Open Source Mullet this would be a real challenge for once. Dealing with the Open Source Mullet had been cake.
That night, I went to work on my strategy. First, I would document the changes in Linux and OpenBSD since a year ago when we last went with a security plan. Linux was still at version 2.4, while OpenBSD had raced from version 2.8 to 3.1 a major revision! This was good so far, and I included the relevant diffs for each. I wondered what the Fat Perl Hacker was up to and pushed ahead with my preparations.
Tuesday morning, I went to talk with the VP of Operations, who had final say on the network project. I wouldn't leave anything to chance. But after chatting with him for a few minutes, I learned of a major monkey-wrench I hadn't expected: instead of a Unix firewall system, he was planning on installing a dedicated firewall box running Windows XP. Thankful for my fortuitous social engineering, I went back to my desk and began making over my strategy to deal with this new threat. Not only would I have to deal with Linux, I'd have to eschew the Windows option now.
Sitting in front of my iBook after work, I realized that taking on Windows XP in the same manner I was going to deal with Linux would be foolish if not wasteful. Obviously the Windows option was not about numbers, anecdotes, or experience. It was a bean-counting decision and all of the security statistics in the world wouldn't matter. Since I hadn't the foggiest about how our accountants viewed the whole operation and didn't have time to learn, I'd have implement a rapid-fire real-life assault on the Windows box, which was sitting on the VP's desk awaiting its place on the network. It was time to put on my Black Hat, and that night I stayed up until 02:00 researching Windows XP vulnerabilities. Linux would have to wait.
With just two days before the network changeover was to take place, I marched into work Wednesday morning knowing
"First they ignore you. Then they laugh at you. Then they fight you. Then you win." by M. Gandhi.
This phrase has often be used to describe the MS Windows - Gnu/Linux relationship.
It seems to mee some of the Linux zealots forgot there heritage.
Forgot that Linux is just a kernel without GNU.
Forgot that there could not have been there, where there are now, without the BSD licensed software.
Forgot what free software was all about.
I'll stick to my BSD's at least there is some real progress there without the attitude.
This article discusses FreeBSD's preference for sleep locks as versus the spin locks in Linux.
Anybody know why Linux went for the spin lock approach? What are the relative merits?
... facts are facts. ;)
FreeBSD:
FreeBSD, Stealth-Growth Open Source Project (Jun 2004)
"FreeBSD has dramatically increased its market penetration over the last year."
Nearly 2.5 Million Active Sites running FreeBSD (Jun 2004)
"[FreeBSD] has secured a strong foothold with the hosting community and continues to grow, gaining over a million hostnames and half a million active sites since July 2003."
What's New in the FreeBSD Network Stack (Sep 2004)
"FreeBSD can now route 1Mpps on a 2.8GHz Xeon whilst Linux can't do much more than 100kpps."
NetBSD:
NetBSD sets Internet2 Land Speed World Record (May 2004)
NetBSD again sets Internet2 Land Speed World Record (30 Sep 2004)
OpenBSD:
OpenBSD Widens Its Scope (Nov 2004)
Review: OpenBSD 3.6 shows steady improvement (Nov 2004)
*BSD in general:
..and last but not least, we have the cutest mascot as well - undisputedly. ;)
Deep study: The world's safest computing environment (Nov 2004)
"The world's safest and most secure 24/7 online computing environment - operating system plus applications - is proving to be the Open Source platform of BSD (Berkeley Software Distribution) and the Mac OS X based on Darwin."
--
Being able to read *other people's* source code is a nice thing, not a 'fundamental freedom'.
Same old GNU/Linux FUD, that has been disproved countless times... :)
In short: the MIT research is *11 years old*, and that Rice study on the TCP/IP stack uses FreeBSD 2.2.6.
There's been seven BSD articles on slashdot since the beginning of the year.
;)
And apache? Nothing. Last year, just after Christmas, a bit about test mod_perl (and that's barely apache).
BSD is doing fine. Apache is dying.
"I'll stick to my BSD's at least there is some real progress there without the attitude."
Which BSD is that? From what I have seen BSD is not lacking in attitudes.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
It's the Fat Perl Hacker.
It isn't even worth arguing whether or not this study is flawed. Until somebody at least claims to find that Firefox has more than a single-digit market share, any report that Firefox is "gaining ground" is just hype, and actually hurts the product.
I disagree with zealotry in any form, and that includes ignoring Linux as an alternative when it's actually pretty decent at a lot of things.
However, the 2.6 kernel has been a mess from day one. I'm used to new versions being a bit buggy, but the kernel developers keep adding new bugs.
First, there was that memory leak with burners. Now more recently they've been moving to libata, and that prevents SATA and PATA drives from being used at the same time on my system because libata does not yet support PATA drives, and all the ATA controllers are on the same chipset. I've had to install an old Promise ATA controller to have a CD drive on my system.
They say it's up to the distributions to stabalize their own kernels, but the distributions clearly don'thave the resources to do that.
Time to fork 2.7 guys!
I rarely criticize things I don't care about.
And I wish I'd have seen mention of it. Oh well.
I thought BSD already had SMP, but this is a great article about BSD's SMP vs Linux. What is the SMP implementation in OSX ? ...?
I use Linux a lot, I was wondering when BSD will have as good hardware support as linux. Yes I know linux hardware support is bad but I am talking about RAID cards and other devices? I don't mean on the desktop market but in the server market, PPC etc
BSD is mos def a cool system but Linux has a wider user base which makes problem solving a snatch.
forgot there heritage
"their".
Forgot that there could not have been
where there are now
"they".
"Their" is a correct correction, "they" IMHO is not, that was a reference to a place/position. Fine example that you could read english, know the grammar but not understand wat it all ment.
IMHO the corrections were both right, but they were made just to draw the attention away from what you were saying. ;)
Don't fall for it..
--
Requiem for the FUD
I got an idea. If you really don't see this obvious thing, then maybe I can start doing something about it myself. Is it possible for me to replace all daemon logos with some neutral logo and sell this modified FreeBSD to corporations? I have some contacts and I think I could sell this OS but ONLY if the mascot is changed.
The frequency of releases seems to be in inverse proportion to quality. Linux releases half-arsed 'stable' releases which may not even work very frequently. The three 'definitive' BSDs typically release twice a year (this is a hard-coded tradition for Open*) and, excusing the developmental nature of FreeBSD 5.x, these are very solid and already have a full package tree and ready documentation, etc. which Linux never has had.
DragonFly has made one major release and another is on the horizon (if you read the lists or talk in #dragonflybsd on efnet). The first had an installer bug, they fixed it and released a new one immediately. The next should be in much better shape as the system is getting much more contribution and testing now (heck, even I submitted a trivial patch in response to joerg's request for GMP->OpenSSL arbitrary precision math translation).
It's the difference between the intelligent man who sits quietly and the idiot who never shuts up. "Those who release the worst, release it the most often".
Sam ty sig.
The lamer is a GNU/Linux advocate that has been going on for *years*. So he won't stop, it's a kind of "job" to him - easily, the best he can find.
So, please Shut Up and Don't Feed The Troll.
(..but I have the suspect that you are the same person who posted gp, pretending to pay attention to himself - since apparently nobody does anymore)
It's the difference between the intelligent man who sits quietly and the idiot who never shuts up.
You're obviously in the latter category. You're a blatent troll, and you can't back up your so called facts. Piss off.
What's wrong with the grammar? Try re-reading.
And no, Linux has never had a full package tree, because LINUX IS NOT AN OPERATING SYSTEM. It's a kernel. DISTRIBUTIONS have package trees, but they don't release at the same time new kernel versions do, so being able to install a distro from the latest kernel isn't always possible until the next release; this becomes important when your installation requires new drivers only found in the latest kernel.
FreeBSD's SMP is not substandard, by all rights it's one of the better free ones, its entire code base just needs a LOT more work before it's 'there'. And I doubt you'll find a definitive SMP 'standard' there too. What, Linux is the standard for everything? Looks like all the BSDs have super-standard security, quality assurance, release engineering, consistency, documentation and developer support. I'll also remind people that eth1394 (Linux ip-over-firewire driver) is less than half as fast as FreeBSD's fwe and fwip, and has not improved in this regard since 2.4 days. Hardly anyone even notices; but benchmark it on your home machines and just TRY to get netperf to report more than 116Mb/s throughput.
Sam ty sig.
Really? try reading that again:
Forgot that there could not have been there, where there are now, without the BSD licensed software.
vs.
Forgot that they could not have been there, where they are now, without the BSD licensed software.
Hint: use the preview button, silly!
And no, Linux has never had a full package tree, because LINUX IS NOT AN OPERATING SYSTEM. It's a kernel. DISTRIBUTIONS have package trees, but they don't release at the same time new kernel versions do, so being able to install a distro from the latest kernel isn't always possible until the next release; this becomes important when your installation requires new drivers only found in the latest kernel.
If you don't know what you're doing, you shouldn't be doing it, right?
FreeBSD's SMP is not substandard,
Yes it is, considering that was the primary focus of the FreeBSD5 development branch, and its taken them 5 years to get here.
by all rights it's one of the better free ones,
No it isn't. I've seen posts within the last 6 months of people not being able to scale database workloads to 2 Opteron CPUs. That's right, their 2 and 4 processor results were the same or worse than their single processor results. Linux scaled linearly, naturally.
And don't tell me "oh they just fixed that". We're talking about 5 years to get it right.
Show me a benchmark comparing FreeBSD with Windows, Linux, Solaris, AIX, IRIX, or anything else with decent SMP support. Only then will I believe you.
its entire code base just needs a LOT more work before it's 'there'. And I doubt you'll find a definitive SMP 'standard' there too. What, Linux is the standard for everything? Looks like all the BSDs have super-standard security, quality assurance, release engineering, consistency, documentation and developer support. I'll also remind people that eth1394 (Linux ip-over-firewire driver) is less than half as fast as FreeBSD's fwe and fwip, and has not improved in this regard since 2.4 days. Hardly anyone even notices; but benchmark it on your home machines and just TRY to get netperf to report more than 116Mb/s throughput.
Stop your blathering and trolling. What the fuck "may I remind people that [blah blah is better in FreeBSD", WTF is that? May I remind you that you're a troll and have provided exactly zero evidence for any of your wild claims?
Hardly anyone notices probably because nobody using Linux cares about IP over firewire.
You keep using it though, I guess you might say it makes up for the lack of 10GbE, Infiniband, USB2 (that actually works), PCI express, etc support. Or not.
Hey, may I remind you that FreeBSD 5's IO subsystem performance is pathetic compared to Linux? This time with actual facts.
Not my point actually. My point is that you insist everything in Linux MUST be perfect, because it's Linux, and everything in BSD MUST be 'SUBSTANDARD', becuase it's in BSD.
I am well aware of all the failures in FreeBSD 5. But it's SMP design is not sub-standard. There is no standard. Let's say there are 5 major free OS players that just about everyone can name: Linux, FreeBSD, DragonFly BSD, NetBSD and OpenBSD. Linux and FreeBSD have (different but conceptually familiar) mutex SMP models, and while Linux' one clearly owns the FreeBSD one hard, the design of FreeBSD's one is not too terrible... if they coded it right. They didn't. It has sub-standard code, not sub-standard SMP design. DragonFly has a much better approach with much better code, so while it beats FreeBSD 5, it's not made the 'standard' just by that. Net and Open have the giant lock so they are the worst players, but in practice they still beat FreeBSD 5 so design isn't everything.
And why do you defend a driver being unpopular/irrelevant (not true if you realise not all machines in the world have GigE cards, or even the capacity to use them) as an excuse for it sucking? Why not just break support for all notamd64 architectures because they're not mainstream and modern enough? All those sparc, alpha, etc. guys should move up to amd64! Isn't that right? Same thing with firewire networking versus gige. Sure it's not even half the theoretical bandwidth, but that's no reason to ignore the possibilities and necessities it can have.
I'm tired of this, I've been swatting away you trolls (who call me a troll, by the way) since morning. If you think Linux is the final solution to every software problem, you are now commanded to touch a computer again.
Where's ulib? He can help here. Much more experience in troll squashing than I have.
Sam ty sig.
Not my point actually. My point is that you insist everything in Linux MUST be perfect, because it's Linux, and everything in BSD MUST be 'SUBSTANDARD', becuase it's in BSD.
Err... no.
I am well aware of all the failures in FreeBSD 5. But it's SMP design is not sub-standard.
Nobody ever said anything about its SMP design. It was the implementation being talked about, if you'd care to actually read anything.
And that is substandard when compared to a modern SMP implementation.
There is no standard. Let's say there are 5 major free OS players that just about everyone can name: Linux, FreeBSD, DragonFly BSD, NetBSD and OpenBSD.
We're not just comparing with other substandard free operating systems here, where did you get that idea?
Linux and FreeBSD have (different but onceptually familiar) mutex SMP models, and while Linux' one clearly owns the FreeBSD one hard, the design of FreeBSD's one is not too terrible... if they coded it right. They didn't. It has sub-standard code, not sub-standard SMP design.
Firstly, nobody said anything was wrong with the design. Secondly, Linux and FreeBSD SMP models are not "conceptually familiar". Linux is based primarily on lock free algorithms and per CPU data in the hottest paths, and object level fine grained spinlocks elsewhere. Semaphores are used when they are not performance critical, or need the convenience of being able to sleep. They are by no means the primary object to achieve parallelism.
DragonFly has a much better approach with much better code, so while it beats FreeBSD 5, it's not made the 'standard' just by that.
I haven't seen any scalability benchmarks of DFBSD at all. Where do you get that info from? (I have seen single threaded benchmarks - it is usually better than FreeBSD 5 but worse than 4).
Net and Open have the giant lock so they are the worst players, but in practice they still beat FreeBSD 5 so design isn't everything.
Again, I haven't seen any data. Care to share your facts?
[snip idiotic ranting]
Dude. If you can't stay on the topic go away. "Might I add FreeBSD is better than Linux in some completely unrelated area", indeed. Nice attempt to change the subject. You're the troll here. We're talking about SMP performance.
FreeBSD vs Linux - The Definitive Comparison
Flamewars between FreeBSD and Linux advocates occur all the time, so it's often hard to make a judgement. Our 500-employee company (which will naturally go un-named) recently decided to convert almost entirely to Open Source software and OSes; I was put in charge of making the decisions. It boiled down to FreeBSD and Linux, and without letting any bias or emotions get in the way, I established the following criteria.
Performance
This is a complicated issue, so let's consider these three types of machine (in use at our company):
Single CPU server: FreeBSD just edged ahead of Linux on this one. The differences weren't drastic, but large enough - consequently, score 1 for FreeBSD here.
Multi CPU server: With kernel 2.6, Linux performed considerably better than both FreeBSD 4.9 and 5.2.1. The updated SMP code and revised scheduler have worked wonders here, so 1 for Linux.
Desktop: Linux 2.6 is much faster than either FreeBSD, particularly when the system is heavily loaded. Application start times are slightly better, while responsiveness is remarkably superior to FreeBSD. Another 1 for Linux.
Result: FreeBSD 1, Linux 2
Stability
Linux distributions vary greatly in terms of stability, with Mandrake Linux and Fedora Core aiming for bleeding-edge desktop features, while Slackware and Debian put great emphasis on stability. FreeBSD is indeed a reliable OS, but the smaller development and testing community puts it behind Linux - additionally, there are more full-time Linux developers working with commercial companies on hardware support and core component testing.
Our Debian and Slackware systems have never crashed or suffered any other major glitches in five years of use, and we know of other individuals and companies that can say the same. With the correct distribution selection, Linux systems are extremely reliable. The far greater amount of testing by the community and companies gives Linux a boost here.
Result: FreeBSD 0, Linux 1
Support
Ease of updating: Although a third-party binary updaing system exists, it's not yet part of the official FreeBSD system (and consequently, problems with trust occur). Current FreeBSD releases rely on manual CVS updating, patch applying, compilation and installation. Debian GNU/Linux, conversely, only needs a single command to update; this is a major win for Linux, as it saves a huge amount of time on a large number of machines. 1 to Linux.
Length of support: Each FreeBSD point release is only supported for 12 months. The Debian Project supports each of its releases for over two years, and other distros such as Red Hat Enterprise Linux are supported for five years. Although upgrading FreeBSD is fairly simple, the changes in userland tools and Ports means that extensive re-testing of home-grown apps needs to be made. A major win for Linux here.
Commercial support: FreeBSD is significantly weaker on this front, with Linux vendors offering a much greater range and variety of support contracts than are available for FreeBSD. 1 to Linux.
Result: FreeBSD 0, Linux 3
Hardware
Server: FreeBSD's driver range for server-class machines is very good, and the drivers themselves are robust and well-tested. Linux is strong on this front too, but FreeBSD just pips it to the post. 1 to FreeBSD.
Desktop: Linux far surpasses FreeBSD in terms of desktop hardware support, with a gigantic range of drivers and subsystems from both kernel developers and third parties. 1 to Linux.
Other platforms: Debian supports more architectures than FreeBSD, although the gap is narrowing. NetBSD supports even more, but that involves throwing another BSD variant into the mix - and this causes problems. Similarly, Linux's laptop support is quite complete and is more mature than FreeBSD's. So 1 to Linux.
Result: FreeBSD 1, Linux 2
>Our 500-employee company (which will naturally go un-named)
:)
:D
:)
Naturally.
>It boiled down to FreeBSD and Linux, and without letting any bias or emotions get in the way,
Of course.
>I was put in charge of making the decisions.
You were put in charge of trolling.
It is interesting to see how and when various operating system concepts get implemented. Interrupt threads are a pretty common technique in realtime systems, and have been around since the early 90's or so; they were the first driver technique that I learned.
(S(SKK)(SKK))(S(SKK)(SKK))
>Much more experience in troll squashing than I have. ;)
But I do it only when it's worth.
Anyway, regarding the SMP model, I think it would be wise to wait, in order to say which is the best approach. I don't think it can be inferred by the literature, and all the camps still have a lot of code to write.
And if I may suggest one thing, let's be more constructive in criticizing FreeBSD: it can have some regressions due to the new technology, but this hardly means anything regarding the validity of the design. FreeBSD's model might turn out the winner, in the light of BSD's reputation to ultimately do things the Right Way. We'll see
--
Being able to read *other people's* source code is a nice thing, not a 'fundamental freedom'.