LWN: Comments on "Choosing between portability and innovation" https://lwn.net/Articles/430598/ This is a special feed containing comments posted to the individual LWN article titled "Choosing between portability and innovation". en-us Tue, 16 Sep 2025 09:26:36 +0000 Tue, 16 Sep 2025 09:26:36 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Choosing between portability and innovation https://lwn.net/Articles/487446/ https://lwn.net/Articles/487446/ scientes <div class="FormattedComment"> <font class="QuotedText">&gt; Linux is about features, while BSD emphasizes design.</font><br> <p> While I can't exactly agree with this flame, I will note that this very thing your are describing with kqueue/epoll also happened with /dev/cryto which was on OpenBSD and there even existed a Linux patch, and then Linux did their own thing with AF_ALG. (now, they did do some benchmarking...)<br> </div> Tue, 20 Mar 2012 20:07:34 +0000 Choosing between portability and innovation https://lwn.net/Articles/452742/ https://lwn.net/Articles/452742/ gvy <div class="FormattedComment"> <font class="QuotedText">&gt; OSS came before ALSA and was technologically superior to ALSA.</font><br> I'd ask for some evidence.<br> <p> And regarding<br> <font class="QuotedText">&gt; FreeBSD (at least) also has had software mixing for well over a decade</font><br> <font class="QuotedText">&gt; now (vchans) and Linux is still struggling with this functionality</font><br> -- I've actually forgot since when alsa dmix just works, maybe 5 years or so? (esound would do either back in 1998 IIRC)<br> <p> <font class="QuotedText">&gt; pulls this stuff every release, which is either biannually or annually!</font><br> ORLY<br> </div> Sun, 24 Jul 2011 17:29:24 +0000 Centralized vs Decentralized https://lwn.net/Articles/436643/ https://lwn.net/Articles/436643/ JasperWallace <div class="FormattedComment"> <font class="QuotedText">&gt; And they still seem to think CVS is a good idea for version control, though they do try to offer Subversion as an alternative for the radical young kids.</font><br> <p> The problem the BSD's have is they have the entire history for kernel+userland+X in one repo and the history. If they switched to a dvcs then every developer would have to have have a copy of the history which would take massive amounts of disk space.<br> <p> Also converting 15 years+ of history is not straight forward.<br> <p> NetBSD does have a git repo that shadows the main cvs modules:<br> <p> <a rel="nofollow" href="http://mail-index.netbsd.org/current-users/2009/10/13/msg010821.html">http://mail-index.netbsd.org/current-users/2009/10/13/msg...</a><br> </div> Sat, 02 Apr 2011 02:45:38 +0000 Choosing between portability and innovation https://lwn.net/Articles/435172/ https://lwn.net/Articles/435172/ daenzer <div class="FormattedComment"> Not sure GEM is a really good example, as the people behind it seem to be firmly in the 'who cares about portability, only Linux matters' camp. In fact, it was with GEM that the DRM code stopped being developed shared between Linux and the BSDs.<br> <p> This is all the more interesting as one of those people was previously a major FreeBSD graphics driver developer. Something rather dramatic seems to have happened there at some point, still not sure what that was.<br> </div> Thu, 24 Mar 2011 12:24:35 +0000 Choosing between portability and innovation https://lwn.net/Articles/435170/ https://lwn.net/Articles/435170/ daenzer <div class="FormattedComment"> Nice article, just some minor corrections for the part about X.org and KMS.<br> <p> Konstantin Belousov shouldn't need to implement any new DRI drivers for BSDs. Once the KMS and GEM APIs are available in the kernel, the only userspace changes required (if any) should be in libdrm(_intel).<br> <p> AFAIK TTM stands for Translation Table Manager.<br> <p> Gallium3D isn't tightly coupled to the Linux kernel at all. In fact, it's an explicit goal of it to cleanly separate parts which are specific to an OS (and windowing system etc.) environment from parts which are specific to hardware (and each in turn from parts which are specific to APIs).<br> </div> Thu, 24 Mar 2011 12:13:12 +0000 Choosing between portability and innovation https://lwn.net/Articles/434403/ https://lwn.net/Articles/434403/ jcm <div class="FormattedComment"> The solution (on the POSIX front) is to get newer Linux APIs standardized before forcing everyone to switch to them. It is totally unacceptable to say "we're number one, you do it like this". I'm not singling anyone out, but it's just plain wrong to have that attitude. Not only does it hurt portability, but it also makes it increasingly difficult to document how Operating Systems like Linux are supposed to work. Ever wonder why (even given the demise of the publishing industry) there are so few books coming out these days for developers to read? It's because this train is moving so fast that only those riding it have a hope of making the next stop.<br> </div> Sun, 20 Mar 2011 18:01:31 +0000 Choosing between portability and innovation https://lwn.net/Articles/434402/ https://lwn.net/Articles/434402/ jcm <div class="FormattedComment"> Awesome story. Well said. What is needed, in my personal opinion, is a giant push-back against some of the trends in the Linux area, and back toward standardization across platforms. In the process, a lot of "progress" is going to have to be undone, but that's a good thing.<br> </div> Sun, 20 Mar 2011 17:52:28 +0000 Re: second class citizens https://lwn.net/Articles/434373/ https://lwn.net/Articles/434373/ gvy <div class="FormattedComment"> NB: writing articles on "treating non-Linux operating systems as second-class citizens" doesn't count! :)<br> <p> Would be actually interesting to know why move from Linux to BSD (I suppose that the author isn't prone to "linux sux freebsd is tru unix" meme), *and* to moan subsequently on it lagging behind.<br> <p> When we prepared our yearly FLOSS conference six years ago, some of local *bsd folks moaned that there were too few *bsd reports, and that Tux-branded packets for papers which were printed and generally available then are unacceptable (reminds me of "political correctness"). They were advised to, well, bring in reports, and take care of funding and printing custom packets. They organized a "registration" flashmob tagged "OSDN is not Linux" instead...<br> <p> So my suggestion stays the same: either help or don't pop up.<br> </div> Sat, 19 Mar 2011 18:50:17 +0000 Choosing between portability and innovation https://lwn.net/Articles/433001/ https://lwn.net/Articles/433001/ viro <div class="FormattedComment"> Dear duhveloper. Do not use the worst misdesigns shoved down our throats by Scamantec and its ilk. Yes, I mean fanotify(). No, the fact that it's got in does *NOT* mean it's good to use or should be enabled. Sigh... Lusers - can't live with them, can't dispose of the bodies without violating hazmat regs...<br> </div> Fri, 11 Mar 2011 14:04:40 +0000 Choosing between portability and innovation https://lwn.net/Articles/432982/ https://lwn.net/Articles/432982/ nix <div class="FormattedComment"> Yeah, great, you can do all the flaming horror of sound mixing in kernel space. Thanks but no thanks.<br> <p> </div> Fri, 11 Mar 2011 12:40:34 +0000 Choosing between portability and innovation https://lwn.net/Articles/432978/ https://lwn.net/Articles/432978/ nix <div class="FormattedComment"> Virtually of the things you whine about in this email haven't had any inkling of change in years, and to be honest it doesn't matter a damn who 'did it first', it matters which works better. And in many of these cases, BSD loses massively precisely because they don't reinvent.<br> <p> - /dev filesystem: two implementations (you often have to write one and throw it away to learn how *not* to do it). One upstream, architecture pretty much unchanged since day 1 (though this all depends on what you mean by a '/dev filesystem setup': one of the lessons of devfs was to try to stick to the traditional /dev layout to avoid breaking things unnecessarily). But perhaps you're referring to the shift to a single upstreamed udev database? That's *optional* and several major distros (Debian for one) don't use it.<br> <p> - RC init systems: again, ambiguous. sysvinit was *the* init system for many decades, but is terribly limited, so much so that most of its functionality is almost unused. Init scripts, well, we started with BSD's 'giant shell script' approach. The difference is, BSD stuck with it even though it sucks massively in systems with package managers. Linux moved on, and even now the init script format defined right after that is still accepted by the latest bleeding-edge init replacements.<br> <p> - non-root X: BSD has revoke(). Linux doesn't. Not a problem of reinvention nor NIH, just 'this is a really hard problem'. Most of the BSDs still don't have non-root X because they are NIHing with respect to each other.<br> <p> - Packet filtering: the last packet filter redesign was something like eight years ago. I know of iptables packet filters that've been working unchanged for all that time. Huge code churn this is not.<br> <p> - USB stacks: how many? well, er, one (which didn't work very well until hotplugging worked properly: the same hotplugging you damn elsewhere). Yeah, we have support for things like USB 3.0. That's not a 'new stack', that's changes to an existing stack to support new hardware.<br> <p> Sheesh.<br> </div> Fri, 11 Mar 2011 12:36:41 +0000 Choosing between portability and innovation https://lwn.net/Articles/432974/ https://lwn.net/Articles/432974/ gcooper <div class="FormattedComment"> I stand corrected on that point; thanks for the clarification.<br> </div> Fri, 11 Mar 2011 12:04:16 +0000 Choosing between portability and innovation https://lwn.net/Articles/432960/ https://lwn.net/Articles/432960/ patrick_g >>> <i>OSS came before ALSA and was technologically superior to ALSA. It was in Linux for a while, and has been adopted in *BSD for a long period of time, but was abandoned for licensing disagreements (BSD licensing)</i><br><br> Rubbish ! The Linux community abandoned OSS because the main dev (Hannu Savolainen) made his support for newer sound devices and improvements proprietary.<br> Fri, 11 Mar 2011 09:31:37 +0000 Choosing between portability and innovation https://lwn.net/Articles/432925/ https://lwn.net/Articles/432925/ phoenix <div class="FormattedComment"> As has been shown by the BSDs, you do not need PulseAudio, or any other sound daemon, sound server, etc, in order to have non-blocking, multi-source/single-output sound setup.<br> <p> Just because Linux can't do it, doesn't mean it's not possible, nor that it should be avoided.<br> </div> Fri, 11 Mar 2011 03:46:19 +0000 Choosing between portability and innovation https://lwn.net/Articles/432914/ https://lwn.net/Articles/432914/ gcooper <b>Some history review</b> <ul> <li>kqueues came before epoll and some of the equivalent functionality in inotify. <li>BSD sockets came before the Linux implementation (obviously)? XSI streams are basically dead, hence FreeBSD doesn't make an effort to implement them, along with some other deprecated XSI functionality. <li>OSS came before ALSA and was technologically superior to ALSA. It was in Linux for a while, and has been adopted in *BSD for a long period of time, but was abandoned for licensing disagreements (BSD licensing) and bad blood between Linux devs and the OSS devs and because OSS was done largely within the kernel. FreeBSD (at least) also has had software mixing for well over a decade now (vchans) and Linux is still struggling with this functionality (why outsource to PulseAudio)? What about arts, ESS, etc? <li>systemd is another take on something that upstart was supposed to answer by itself, which is in turn something that SysV init did back in the day (and a simple init clone already does to a large degree on FreeBSD without as much complexity for well over the past decade); granted it has to use devd and devfs for some minor help with event notification, but have you tried creating jobfiles in upstart? Oh yeah, and OSX has launchd, which is probably superior to the rest of the init-like daemons, but isn't really portable after Leopard (surprise, surprise), so it hasn't moved outside of OS X. </ul> <p>So with that in mind, how is tying Freedesktop to Linux better than trying to be somewhat portable (if I screwed up the history lesson, feel free to correct me)?</p> <b>Code churn</b> <p>Brute forcing software design through several revisions of code or several forked projects detracts from the collaboration effort and I would question whether or not true innovation is being made, or if it's just code churn.</p> <p>How often does OSX, Windows, etc dramatically change system interfaces or how components interact with one another, and how do end-users receive the changes? I know based on my experience that people absolutely loathed the Windows 2000 -> XP and XP -> Vista/7 transitions and those only happened every 3-5 or so years. Freedesktop and other associated projects (Gnome, KDE, LXDE, XFCE) pulls this stuff every release, which is either biannually or annually!</p> <b>Impact of churn and becoming less portable</b> <ol> <li>Do the devs have the performance figures to support the fact that the new software truly functions faster? <li>Can the devs qualify all of the wasted hours... <ul> <li>Doing the initial development and unit testing. <li>Effort needed to track the versions qualify the software in multiple releases by package maintainers? <li>Effort needed to track changes required for end-users who depend on Linux or other platforms like BSD, OpenSolaris (now IlluminOS), etc? </ul> </ol> <b>An example of good collaboration / design</b> <p>I find the work that Intel is doing with GEM (even though it's a bit misguided in tying itself to Linux, oh well) to be really good work, because it's a relatively abstract framework for their display drivers. I will applaud them for this effort and others because several folks in Intel have also works on making their NIC drivers and other things sane for non-Linux Unix users.</p> <b>Conclusion</b>: <p>I was a devout Gentoo Linux user for 5 years and gave up running it on my primary system because of the fact that some developers that develop for core components in Linux lose sight that an OS distribution is so much more than a kernel, and stuff broke all too frequently. If Freedesktop devs aren't willing to slow down and think more -- and thinking about portability is one of those things -- then Unix won't be my primary desktop / portable platform, I won't be the only user (BSD, Linux, etc) dropping FreeDesktop software like a hot rock. There's always screen/tmux with SSH on my Mac if I'm pushed to do things that way, so even if folks go the way of Wayland I'll have a way to get my work done.</p> Fri, 11 Mar 2011 01:52:58 +0000 Choosing between portability and innovation https://lwn.net/Articles/432890/ https://lwn.net/Articles/432890/ phoenix <div class="FormattedComment"> Hrm, no, if you actually look back at the development history, you'll note that the Linux devs need to rid themselves of NIH Syndrome.<br> <p> Working, stable, performant wireless networking stacks were developed on BSD first. How many wireless stacks has Linux gone through so far?<br> <p> Working, stable, performant device detection and /dev filesystem was developed on FreeBSD first. How many /dev filesystem setups has Linux gone through so far, and still re-writing them to this day?<br> <p> Working, stable, performant RC systems were developed on BSD first. How many RC init systems has Linux gone through so far, and is still re-writing them to this day?<br> <p> Working, stable, non-root X setups were developed on OpenBSD first. Canonical got to brag about being the first Linux distro maker to accomplish that this past year. But it's still no working right.<br> <p> Working, stable, performant and portable packet filtering was developed on BSD first. How many packet filters has Linux gone through now?<br> <p> Working, stable, performant USB stacks were developed on BSD first. How many different USB stacks has Linux gone through now?<br> <p> Working, stable, in-kernel multi-channel, no-locking, sound mixing was available on FreeBSD before ALSA was ever even thought of. How many <br> "sounds daemons", "sound servers", and sound stacks has Linux gone through now?<br> <p> And the list goes on. Re-writing sub-systems with every release of the kernel is not "innovative".<br> </div> Thu, 10 Mar 2011 23:01:12 +0000 Centralized vs Decentralized https://lwn.net/Articles/432620/ https://lwn.net/Articles/432620/ ldo <div class="FormattedComment"> To me, this BSD-versus-Linux thing revolves around the difference between a centralized model of development versus a decentralized one.<br> <p> Linux is just a kernel, whereas each BSD is a whole distribution. Linux distros take their “upstreams” from thousands of different sources, whereas the BSD folks seem to want to maintain their own copies of everything. And they still seem to think CVS is a good idea for version control, though they do try to offer Subversion as an alternative for the radical young kids. While on the Linux side, look at the number of projects that have moved onto distributed VCSes like Git and Mercurial—the Linux kernel itself never used any centralized VCS.<br> <p> This decentralized approach, not controlled from any single point, is why the Linux ecosystem has been able to move so much faster than the BSD ones. BSD had a thriving community back when Linux was still a snot-nosed little upstart that could very well have died in childhood; yet look at all the great things it has been able to go on to achieve, while the BSDs haven’t really moved much at all.<br> </div> Thu, 10 Mar 2011 01:42:12 +0000 Choosing between portability and innovation https://lwn.net/Articles/432593/ https://lwn.net/Articles/432593/ nix <div class="FormattedComment"> Writing with portability in mind does not imply 'missing functionality' (on platforms capable of it), and *certainly* does not imply 'hundreds of #ifdefs'. Indeed, the latter is generally a symptom of software that was not written with portability in mind, but which had limited portability jammed crudely into it at a later date.<br> <p> </div> Wed, 09 Mar 2011 23:44:21 +0000 Choosing between portability and innovation https://lwn.net/Articles/432525/ https://lwn.net/Articles/432525/ nevyn <div class="FormattedComment"> My biggest concern with doing something like that would be how efficient it is compared to using the native interface (and why I said you'd need to redesign the kernel, so that it could be implemented efficiently), the only benchmark you have is vs. poll() (and uses ab) ... which is pretty sad.<br> <p> epoll &lt;=&gt; kqueue is probably the best case test too, to be convincing you'd want something that benchmarked EVFILT_VNODE/SIGNAL/TIMER at least. To be really convincing you'd want PROC/USER/AIO and play with the EV_* flags.<br> <p> </div> Wed, 09 Mar 2011 20:52:48 +0000 Choosing between portability and innovation https://lwn.net/Articles/432450/ https://lwn.net/Articles/432450/ schabi <div class="FormattedComment"> I agree here.<br> <p> But note that there is a huge difference between writing "non-portable" code targeted for an idealized platform (with a PAL in place to emulate that platform in the real environment), and writing with portability in mind (hundreds of #ifdefs, missing functionality, etc.).<br> <p> </div> Wed, 09 Mar 2011 17:50:27 +0000 Choosing between portability and innovation https://lwn.net/Articles/432351/ https://lwn.net/Articles/432351/ mheily Actually, you don't need to redesign your kernel to implement the kqueue API on Linux. The <a href="http://mark.heily.com/proj/libkqueue">libkqueue</a> project provides a userspace wrapper library that translates each kevent() call into the equivalent epoll/inotify/timerfd/signalfd/etc call for Linux. On Solaris, it uses the event port framework. On Windows, it will use the WaitForMultipleObjects() function. <p> (Disclaimer: I am the main author of libkqueue) Wed, 09 Mar 2011 14:48:48 +0000 Choosing between portability and innovation https://lwn.net/Articles/432337/ https://lwn.net/Articles/432337/ nix <div class="FormattedComment"> There are good reasons why PA runs as you and not as a systemwide user (though it can). PA can be asked to load modules providing new features at runtime: this is obviously forbidden for systemwide daemons. PA can operate in a zero-copy mode, transferring audio data directly over shared memory: for obvious security reasons this must be avoided if the daemon may serve more than one user, forcing everything to be serialized and deserialized again.<br> <p> PA itself is plainly necessary: most modern sound hardware can't mix, so the first open()er blocks all the rest. This is more than slightly aggravating to users (the difference between a very long block and a crash is not very large from a user perspective).<br> <p> PA is really not that bad. Yes, it was buggy once upon a time (mostly because it used features that had never been used by anyone else), but these days it largely Just Works.<br> </div> Wed, 09 Mar 2011 13:49:13 +0000 Choosing between portability and innovation https://lwn.net/Articles/431911/ https://lwn.net/Articles/431911/ lacos <i>boilerplate trolling? At least try to be original</i> <p/> Okay, I'll try to be "original" for him. <p/> All this desktop integration goo is getting increasingly difficult to get rid of. There are users who don't need their features, and certainly don't <i>want</i> their bugs, possible inter-app privacy holes, and very probable security vulnerabilities. So while these components are helpful for most people, there's a small group of "power users" who consciously want to remove them, and it is more and more difficult. <p/> The only thing I run on my "interactive systems" (both home desktop and work laptop, different distributions), out of "ConsoleKit, PolicyKit, systemd, HAL, PulseAudio or dbus" is D-Bus; and even that only because I can't remove it. I like to know why my UID runs a process; for PulseAudio, I was unable to find any reason. <p/> I have four unencrypted pendrives, one encrypted pendrive, one flash card reader, one dumb digital camera; obviously an optical drive, and an encrypted hard disk in a USB disk enclosure. Two non-root users can mount different sets of these, with reasonable file permissions and good IO performance afterwards (for a change). I don't buy gadgets each second day, so it's not hard to update my static config. The inability to mount unseen pieces of hardware is a <i>feature</i>. Tue, 08 Mar 2011 01:10:23 +0000 Choosing between portability and innovation https://lwn.net/Articles/431906/ https://lwn.net/Articles/431906/ lacos <i>people should just forget about the BSDs</i> <p/> You are promoting vendor lock-in. Under this aspect, it does not matter if a given application is free software: unless the end-user has the resources to make the port happen, he's forced to use the kernel/libc <i>you</i> have chosen for him. <p/> Portability of application source code is about adhering to standards that were distilled with meticulous work, considering as many implementations as possible. The answer to divergent implementations is not killing all of them except one, and taking away the choice from the user. The answer is standardization, and a clearly defined set of extensions per implementation, and allowing the user to choose the platform (for whatever reasons) he'll run the application on. <p/> <i>The Unix landscape was splintered and balkanized during most its history. We finally are overcoming that, and that is a good thing</i> <p/> You seem to intend to overcome diversity by becoming a monopoly. The freeness of software (free as in freedom) doesn't matter here, see above. Tue, 08 Mar 2011 00:49:12 +0000 Choosing between portability and innovation https://lwn.net/Articles/431617/ https://lwn.net/Articles/431617/ intgr <div class="FormattedComment"> <font class="QuotedText">&gt; However, that doesn't change the main point I wanted to make, which is</font><br> <font class="QuotedText">&gt; that it ought to be tracking fds internally instead of files</font><br> <p> <font class="QuotedText">&gt; I want it to stop watching (and tell me that it did stop watching), if</font><br> <font class="QuotedText">&gt; the *fd* I originally gave is closed, not if the underlying file is closed</font><br> <p> Seriously, if you want it to stop watching, you use EPOLL_CTL_DEL before closing a file descriptor. The implicit deregister-on-close() is just a safety net -- because it's the only sane thing that the kernel can do when you have watches on a file that's being closed. It's not intended to be used that way.<br> <p> You tried to spin it as a "*HUGE* misdesign", but in practice it's just a trivial edge case that shouldn't affect real applications. Wouldn't be the first time *BSD people criticize parts of Linux they don't actually understand.<br> <p> </div> Sun, 06 Mar 2011 19:04:07 +0000 Choosing between portability and innovation https://lwn.net/Articles/431591/ https://lwn.net/Articles/431591/ pjm <div class="FormattedComment"> <font class="QuotedText">&gt;If you have a single well reviewed implemention I think you are much better off than having 10 badly reviewed ones.</font><br> <p> That sounds good in itself. However, your advocated position is to standardize on a kernel that's featureful and consequently full of bugs (despite having so many developers contributing to it), to the complete exclusion of any kernel with fewer bugs. That's not to say that your advocated position is a bad one; but I do believe it runs counter to a goal of combatting computer insecurity.<br> <p> (Incidentally, if you really did think that 10× the number of bugs is such a bad thing, then I think you'd probably use a different kernel. But most people do use Linux even if they know it has lots of bugs, and would even if they knew it had 10× the number of bugs of some other unixy kernel, even for just one or two extra features important to them. Similarly, each of the N competing implementations presumably has one or two features or attributes not present in (and not feasible to add to) the others.)<br> <p> and other featureful-but-buggy software .)<br> <p> </div> Sun, 06 Mar 2011 12:53:33 +0000 Choosing between portability and innovation https://lwn.net/Articles/431571/ https://lwn.net/Articles/431571/ jthill <p> I wouldn't knock epoll, myself. I recognize the design. It seems odd to me that over the last few days I've run across a spate of gripes about epoll in various places, all of them based on misconceptions like the ones in this thread. It isn't just the original complaint (since retracted), it's the remaining gripes too. <p> There's an unavoidable race between event reporting and any close processing that's most efficiently handled by keeping your own books. It's not so hard to EPOLL_CTL_DEL before you close(), and defer event-tracking cleanup rcu-style until after a nonblocking epoll_wait returns 0, to catch events reported between your decision to close and the actual close. <p> Note that nothing you can do avoids that race. Having close do the deletion processing will not save you: the event may have already been posted. <p> IBM don't want their manuals accessed by non-customers so I won't link the description, but epoll is down there in big-O range of mainframe-style event reporting. The main difference I can see is that on the mainframe, the table is in your address space and sized by how many events can get backed up (posted but as-yet unhandled) before something is badly wrong -- for anything but large-scale work you just size it to handle everything anyway. <p> I notice that nothing in the reporting api constrains epoll to file-based events. Tying any asynchronous event at all to epoll should be possible. Timers come to mind, of course. epoll_pwait handles signals. Me, I think it'd be good to have an epolled_fork, so child termination comes in as just another thing on your events list. Sun, 06 Mar 2011 06:41:40 +0000 Choosing between portability and innovation https://lwn.net/Articles/431565/ https://lwn.net/Articles/431565/ nix <div class="FormattedComment"> Quite (though it can be used properly, it's definitely in the negative half of that API correctness thing gregkh(?) put up a while back: an API for which the obvious use is wrong).<br> <p> Thankfully epoll() is not widely used yet, and being Linux-specific all the users can fall back to other mechanisms. (However, the old syscall would have to stay, anyway: we'd need an epoll2() syscall that did things right.)<br> </div> Sun, 06 Mar 2011 04:30:00 +0000 It's beyond even OS assumptions. https://lwn.net/Articles/431551/ https://lwn.net/Articles/431551/ Tet <div class="FormattedComment"> Precisely. I share my home directory, and mostly it works fine. But the morons at Mozilla don't know how to write software properly, so my Firefox plugins break every time I log in from a different machine. Gimp is slightly better (in that it at least supports the concept of running different versions and multiple instances concurrently), but still problematic.<br> </div> Sun, 06 Mar 2011 00:34:20 +0000 Choosing between portability and innovation https://lwn.net/Articles/431548/ https://lwn.net/Articles/431548/ Tet <div class="FormattedComment"> This is one case where the pain of breaking compatibility with existing code is probably less than the pain of living with a broken design.<br> </div> Sun, 06 Mar 2011 00:27:57 +0000 Choosing between portability and innovation https://lwn.net/Articles/431379/ https://lwn.net/Articles/431379/ skissane Personally -- forget about the Linux monoculture -- what about the Unix monoculture, or the LUW (Linux/Unix/Windows) monoculture? People forget that Unix and Windows are relatives -- Windows shows significant influence of Unix. Some examples: <ul> <li>Base OS only supports unstructured bytestream files, rather than base OS support for more complex file structures (such as record structure, indexed files, forked files, etc.) -- this is Unix influence on Windows via CP/M then DOS <li>Filesystem does not have explicit recording of file types, only convention of file extensions -- again, Unix influence on Windows via CP/M then DOS <li>Hierarchical directories -- DOS 2.0 explicitly modelled these on Unix <li>C programming language -- direct Unix influence on DOS/Windows <li>Berkeley sockets influence on WinSock </ul> If you want a non-monocultural OS, don't look for yet another Un*x or Windows. They are parts of the monoculture. Examples of non-monocultural OSes would be any IBM mainframe/midrange OSes (like z/OS, z/VM, z/VSE, z/TPF, OS/400), HP MPE, Siemens BS2000/OSD, Unisys ClearPath, language-specific OSes like Lisp Machines or PICK (back when PICK was an whole OS not just a database), etc. Of course, many of this stuff is rather ancient and decaying, but it just goes to show how the IT industry was far less monocultural in previous decades than it is today <p> I don't like hierarchical filesystems. We end up with these massive random directory trees and cannot find anything. Better would be a filesystem where we give files tags, some unique and some non-unique, and we can find files by their tags -- in library science terms, hierarchical filesystems are like Dewey Decimal or Library of Congress classification, I think we should adopt faceted classification instead <p> I really like the idea of getting rid of operating systems and making applications run directly on bare hardware. Especially with virtualization, who needs a general purpose OS to run a web server or database server? Why not just run the application directly on the hypervisor, with as thin a level possible in between. This is like MIT's exokernel research. <p> I think Oracle's WebLogic VE is a good implementation of this idea -- run the JVM directly on the hypervisor, with just a very thin custom OS that exists solely to meet the JVM's needs, no general purpose OS needed in between. I'd like to see the same idea extended to other areas (e.g. databases). (Full disclosure: I work for Oracle but this is just my personal opinions not those of my employer) Sat, 05 Mar 2011 02:00:45 +0000 Choosing between portability and innovation https://lwn.net/Articles/431337/ https://lwn.net/Articles/431337/ foom <div class="FormattedComment"> Okay, I must apologize, you are completely right.<br> <p> I was getting myself mixed up with kqueue's API (which actually does have you specify a struct containing both the fd and userdata), and then mis-reread the epoll docs. (As you might be able to tell, I always passed the fd as the user data. :))<br> <p> However, that doesn't change the main point I wanted to make, which is that it ought to be tracking fds internally instead of files -- I don't want it to do anything special with the value it returns, I want it to stop watching (and tell me that it did stop watching), if the *fd* I originally gave is closed, not if the underlying file is closed. Returning events on a file that I no longer have a handle for in the current process is annoying.<br> <p> </div> Fri, 04 Mar 2011 23:08:14 +0000 Choosing between portability and innovation https://lwn.net/Articles/431328/ https://lwn.net/Articles/431328/ nevyn <div class="FormattedComment"> <font class="QuotedText">&gt; No, it really wasn't misleading. The userspace-visible key *is* the fd.</font><br> <font class="QuotedText">&gt; You're required to pass that in, that's what epoll uses to look up the</font><br> <font class="QuotedText">&gt; file object, it will always pass that back</font><br> <p> Yes, you need an fd to register/change the epoll events. But it isn't ever passed back:<br> <p> epoll_wait() returns a list of "struct epoll_event", which is defined as:<br> <p> struct epoll_event<br> {<br> uint32_t events; /* Epoll events */<br> epoll_data_t data; /* User data variable */<br> } __attribute__ ((__packed__));<br> <p> ...epoll_data_t is the union I talked about before, so you can use a pointer or a number for your callback data. You don't get the fd back from the API, unless you use that as your callback data but if you do that it's just "a number" ... so I wouldn't expect the kernel to do anything special with it.<br> <p> </div> Fri, 04 Mar 2011 22:11:36 +0000 Choosing between portability and innovation https://lwn.net/Articles/431320/ https://lwn.net/Articles/431320/ foom <div class="FormattedComment"> No, it really wasn't misleading. The userspace-visible key *is* the fd. You're required to pass that in, that's what epoll uses to look up the file object, it will always pass that back, and that's what you have to pass to epoll_ctl for further modifications/deletions of the watch. You can of course *in addition* register arbitrary user data that it'll pass back to you. But that's optional. The fd is required.<br> <p> Segue into another rant of mine....that's yet another reason why the auto-removal-upon-file-close functionality is broken. There's no way to get a notification that epoll has autoremoved an entry from the epoll set, so, it's not actually possible for you to ever *free* the data (and other resources) you allocated and passed into epoll_ctl. Sigh. (same bug exists with kqueue API btw).<br> </div> Fri, 04 Mar 2011 21:45:23 +0000 Choosing between portability and innovation https://lwn.net/Articles/431307/ https://lwn.net/Articles/431307/ nevyn <div class="FormattedComment"> <font class="QuotedText">&gt; And epoll certainly has a *HUGE* misdesign in it [...]</font><br> <font class="QuotedText">&gt; epoll_ctl lets you register a file descriptor for monitoring. However,</font><br> <font class="QuotedText">&gt; it *actually* registers the underlying file description for monitoring. </font><br> <font class="QuotedText">&gt; But then it remembers in kernel-land the file descriptor number you passed</font><br> <font class="QuotedText">&gt; in and reports all events for the file descriptor with that file</font><br> <font class="QuotedText">&gt; descriptor number you passed in originally.</font><br> <font class="QuotedText">&gt; No matter what you do to the file descriptor afterwards.</font><br> <p> That's a pretty misleading description. You register for events and give the kernel a pointer or a number as your callback data ... you then get that piece of data and a set of flags, when something happens.<br> <p> If you pass in your "original fd number" as the data you want back, that's what you get. Personally, when I've used it, I used a pointer to a struct as the callback data.<br> <p> </div> Fri, 04 Mar 2011 21:04:11 +0000 Choosing between portability and innovation https://lwn.net/Articles/431297/ https://lwn.net/Articles/431297/ nevyn <div class="FormattedComment"> kqueue is a _huge_ interface, combining a number of ideas, you basically need to design your kernel around it if you want users to use it. And much like SYSV streams, expecting other people to reimplement a giant redesign like that is often expecting _way_ too much.<br> <p> On the other side, timerfd(), socketfd() and epoll() are all there to do a single thing. FreeBSD did the retarded thing when they reimplemented sendfile() roughly a week after Linux added it. TCP_CORK is still not implemented in FreeBSD. mremap() was NAKd, there's the whole MMAP_ANON vs. MMAP_ANONYMOUS, or the weird bits of mmap in general.<br> <p> Cooperation is much more like to happen in the FreeBSD =&gt; Linux direction, IMO ... but that could also just be the much bigger developer pool.<br> </div> Fri, 04 Mar 2011 20:59:27 +0000 Choosing between portability and innovation https://lwn.net/Articles/431244/ https://lwn.net/Articles/431244/ dlang <div class="FormattedComment"> I almost agree with you.<br> <p> the thing is that the API you code to should be flexible and evolve over time, with some of the abstraction layers that others have mentioned being in the API -&gt; platform level<br> <p> In the end your API may not directly match any of your destination platforms.<br> <p> the linux kernel does this. Linus has said in interviews that the kernel is not written directly for any type of system, but instead is written for an idealized system that doesn't actually exist, with 'shim code' on every single platform (including x86) to simulate portions of the 'system' the kernel is written for. He says that the kernel is much better as a result of this work.<br> </div> Fri, 04 Mar 2011 17:44:31 +0000 Choosing between portability and innovation https://lwn.net/Articles/431223/ https://lwn.net/Articles/431223/ jeremiah <div class="FormattedComment"> LOL..amen. Gotta love the high black arts of Linux network administration. Maybe it's time for O'reilly and Olaf to come out with a revised version of the Linux Network administrator's guide. My version is from 1995. <br> </div> Fri, 04 Mar 2011 16:45:58 +0000 Choosing between portability and innovation https://lwn.net/Articles/431205/ https://lwn.net/Articles/431205/ trasz <div class="FormattedComment"> Kqueue vs epoll is a pretty good example of lack of willingness to coooperate - kqueue was earlier, yet Linux folks chose to implement something incompatible and functionally inferior.<br> <p> </div> Fri, 04 Mar 2011 14:37:36 +0000 Choosing between portability and innovation https://lwn.net/Articles/431182/ https://lwn.net/Articles/431182/ nix <div class="FormattedComment"> Agreed. It's not like sysvinit ran on non-Linux systems either: they all have their own inits.<br> <p> What *would* be nice is, when systemd calms down a bit and we start to see which of its features are used by other programs, if some other inits could start to gain those features. (I've never heard of another init-like program which could even be described as having features that other programs could use. systemd is a big step forward in that way.)<br> <p> </div> Fri, 04 Mar 2011 12:26:38 +0000