davej's talk on why user space sucks was really good. he'll be giving it again at akademy, so definitely check it out.
but to be fair to user space devs, it's not like the kernel devs are imbued with magic powers either. i've been having fun with linux on my laptop for two reasons beyond the usual "suspend working depends on the astrological chart of the day": the sky2 driver and partition checks. perhaps these are both problems with the ubuntu kernel only, but perhaps not ...
so, the sky2 driver was really broken when i first installed dapper on here. it often wouldn't even let me get an ip address over dhcp. it's slowly gotten better and now only dies every once in a while if there's sustained traffic in the 100-200k/s range. after one kernel update it would cause a kernel panic, but now it just stops working and i have to reload the driver. i understand the suse people have patches for this problem and they claim it works perfectly on opensuse. i wouldn't know because the machine i have opensuse on doesn't use the sky2 driver. but if this information is correct, why the hell isn't this patch shipping everywhere? thankfully wireless works like a champ so i'm only occasionally stuck with ethernet and the sky2 flakiness.
my favourite issue is with fsck on boot. currently an fsck is forced on every 30th power cycle. with a laptop, that happens fairly quickly. on a server that can and should be a long time between fsck's, and most desktops are probably similar.
but for someone travelling about turning the laptop off is often required, such as when getting on an airplane. given that suspend usually works, but not always, i also end up shutting down more than i'd like to. this means i get fsck's fairly regularly, which aren't exactly swift on a 100gb disk. i have two problems with this:
it's my computer. it's my file system. it's my data. software should never, ever, ever force something like an fsck on me unless the filesystem is having actual problems. preventative maintenance must be optional. why?
because maybe i need to boot up to find something in my email and i only have a couple of minutes to do so. the fsck comes up and i'm screwed.
or perhaps i need to look something up and i'm on battery and don't have the power left for a full fsck. i often drain my laptop down to <5% battery on the airplane, giving me enough juice for an emergency boot in the airport/cab/wherever in case i need to. an fsck would be very, very bad at this point. i was told by one kernel dev that the fsck only happens when there is power and i believed him. foolishness. =) for just the other day i powered up unplugged at a coffee shop and the fsck started. great way to waste my battery.
so if one can honestly say user space sucks (and it does ;) then at least we have good company when it comes to the linux kernel. =P
Tuesday, September 05, 2006
Subscribe to:
Post Comments (Atom)

25 comments:
Would probably be a good idea to mention this somewhere around the ext4 development - this could definitely be a point which should be improved on the way to ext4.
Btw., I'm running ext3 only on the root partition, and I'm not forced to check it (the other partitions are XFS, which does not need stuff like that).
So probably it is a config related problem?
Hey now, that's not 100% fair :)
Your sky2 hangs should be fixed in the mainline kernel. I had the same problem for a while. It turned out to be a NAPI race.
As for fsck, fsck is user-space. If user-space is forcing fsck, that's user-space's damn fault :)
About the fcsk... why don't you just turn it off? It's just a fs parameter.
A fsck every 30. reboot looks like a ext2/ext3 filesystem:
man tune2fs
I thinks this default is reasonable. Your distribution could set another default during install or let you change it. SuSE at least offers this possibility if you enter the "expert" mode.
As someone already mentioned, you can choose the number of remounts required to trigger a fsck with tune2fs (or the eqiv for your fs flavor), but you can just as easily ^C a fsck during init (though you might not want to do that if its been running for a bit).
I just use ReiserFS throughout and don't have those checks forced on me. I have found to have by far the best experience with ReiserFS from all the filesystems I have tried although as many others in the community seem to dislike it so do Ubuntu and you can't format in ReiserFS from the graphical installer and so I still had to use the text based installer but that works just as well as the new installer.
yeah, i keep hearing that sky2 is fixed. if so, this is very good news and it can't come too soon. it's just very sad that such an obvious problem hit so many people; shows that we need more hardware testing of drivers. not sure what the solution is there, though perhaps the kernel devs have ideas.
and yes, the fsck is configurable. but that's a cop out. defaults are what matter to users. a system that does the obviously wrong thing of forcing an fsck on me has the wrong defaults and will cost us users. period.
this is why i try and run an as-default-as-possible system: it helps me remember the problems we force on our users. developers who change the defaults because they are too annoying really ought to consider if they are doing so because they are using power user features that aren't appropriate for the general user populace or if the defaults really do suck in general.
in this case, i think it's very safe to say the defaults suck. they are simply inappropriate for laptops and only marginly more appropriate for desktops.
i remember how at least year's guadec one of the presenters noted that developers often ignore problems in the software because we become acclimatized to them and/or figure out ways to work around them.
and saying that fsck runs in user space .. well, fsck tends to be written by kernel developers. =)
Lets simplify it some. Software sucks! It our perpetual jobs to reduce suckage. ;)
Which suspend system do you use? The one coming by default with the kernel or swsusp2? Because personally I've never been able to get the in-kernel version working (it might suspend but it never wakes up) while I've been a very happy swsusp2 user for the last couple of years.
Who knows, you might get equally lucky.
Recently a friend of mine mentioned that on his Ubuntu system, fsck was not run when the system was running only on the battery. It seems that someone somewhere implemented exactly the feature you are missing. :)
But I don't know if this is a feature of the fsck version he is using, or a feature of the init scripts of Ubuntu.
Aaron, this is at the point where you would like to log a fault report to get this default changed to something more appropriate so you go to launchpad.net to log the fault and that sucks the worst because it's impossible to use properly: -
Website pops up - click on bugs at the left after searching the screen: you can go to bug number or go to package - you don't know which package so you search for ubuntu and find many results pop up and non match - you go back in your browser find the top ten on the left which says top 10 and at the top ubuntu-bugzilla click on that and then there is no way to search to see if it has been logged before so you give up and find a work around because it is easier than logging a fault.
I have a Marvel 88E1111 in a new MSI server motherboard I've bought, and apparently it needs sky2. They seem to be thrown in many boards these days as cheap muck. Should prove interesting, although I may just chicken out and steal the decent 3com nic from the other machine ;-). Apparently those Marvel nics, even when they work successfully, decide to eat about 50% of your CPU time at 500 Mbit/s - if you can get there. No thanks. Rule of thumb - if an ethernet card doesn't work properly in Linux by now it's crap, and we should vote with our money where necessary.
Silly me. I looked at the two ethernet ports in the back of the board and didn't think anything of it, as many users will do when using Linux these days.
As for the fsck thing. If a developer said an fsck only happens when you're on AC power then he's talking out of his proverbial. The only way this would be possible is if a userspace program started up at boot time, checked that you were on battery power and modified the fsck settings or controlled fsck itself accordingly so it didn't do a check. As far as I know, no such userspace program exists nor is one planned. The only way stuff like this has started to become possible in any unified way has been through things like HAL, and that has a fair way to go.
> As far as I know, no such
> userspace program exists nor is
> one planned
Now I need to check with my friend when he saw this feature, and see who is wrong here.
I've had the nice surprise on FC6 test2 that it skips the fsck if i'm on battery.
Very convenient really.
There is Ubuntu specification which is supposed to address fsck on startup problem:
https://wiki.ubuntu.com/ext3-shutdown-forcedcheck
It will move fsck to shutdown, which should cover your use-cases, but may still be an issue for some users.
I tried the 2.6.18-rc6 kernel to see if sky2 was working but noooo...not for toshiba tecra a5 :( I filed a bug about it and hope it will be fixed soon...luckely the sk98lin driver with the patch from syskonnect works. I haven't gotten around to try a workaround which consists of running the command " ethtool -s eth1 speed 100 duplex half autoneg off".
Thanks for reminding me to change the default 30 mounts...I always forget :P
//Steven
The fsck on battery is due to a bug in the Ubuntu initscripts: https://launchpad.net/distros/ubuntu/+source/sysvinit/+bug/59080
The forced fsck is more like a safety measure - ext3 has journaling, so in theory you "shouldn't" need fsck
(in practice, the forced fsck often has found minor errors on my disk, which means that ext3 doesn't "journals" as good as it should, and it's the reason why I don't turn it off)
try this: "sudo tune2fs -c180 -i180d /dev/*d**"
check every 180 mounts or every 180 days
I'm very much looking forward to davej'S talk at akademy this year. It's going to be fun watching and discussing afterwards why kernel-space sucks so much more than user-space ;-)
Somewhat off-topic, but Digikam rocks! :)
Just used it to download some photographs from my digital camera, and organize and edit them.
Very easy, very powerful! :D
Re: fsck
One convenient option for laptop users is to use the clock-time based check interval for ext2/3. For example, "tune2fs -i 60d -c 0" will force a fsck on the first reboot every 60 days (and disable the 'every n mount-counts' interval).
I read the User space sucks report and I found it really good. The author finds out some inefficiencies in several gnome programs. However, he did not profile kde programs.
Has anyone done this sort of testing with kde? Do kde programs also have the "font madness" problem, is the problem in freetype maybe?
sky2 is terrible on every distro. It's a bad driver, and the dev can't reproduce the bugs on his hardware, so we can't get a fix.
Move fsck to shutdown.
Make it depending on AC power from a simple script checking (say in halt.local).
Disable altogether auto fsck by tune2fs exxagerated max mount count.
Post a Comment