 Or has anybody ever suspended their Linux laptop in here? Good. And did it work? Yeah. Did it resume once? No. Good enough. Okay. So who is expecting the annual I'll Make Your Suspend Work Talk today? You're wrong. This time it's not. I have tried to be a little bit of the oracle and tell you something about the future of Suspend or what I think will be the future of Suspend. So since it's working for everybody, I don't need to make a work talk. We'll do what's going on next, what's going on, and what will be the new features, what will be the new development. So this is today the future of Linux Suspend or how I see it. First I'll describe what's the state of the art now. That's what most of you should already have seen sometime. The second part is what's next. That's the more interesting part. So today if you want to get Suspend to run working, basically from the comal side it's working well. What does often not work that well is getting the video card back to life. I've had a long, a talk especially about this last year and it's always, it was very interesting for many people, but basically today we need to somehow identify the machines that work and we need to whitelist them based on some matching, if it's a DMI match, and there are two ways to whitelist them today. One is the whitelist in S2rump. Users of OpenSUSE would have ever did a file a bug against Suspend2rump. This bug would be assigned to me and I would have told them to go to the Suspend2rump site on OpenSUSE or Wiki and get their machine whitelisted. There are lots of options. Suspend2rump to this part of the user space, OpenSUSE search, it has a pretty good whitelist, pretty extensive, but also it's benefited. It's a standalone program. You don't need any other programs in stock basically. Just S2rump, it has everything built in, including the whitelist and that's also a drawback of this program. It's a little bit un-flexible to change the whitelist. You can create a scene file and you have to reach the program. We have some conceptual problems because we only do DMI matching. That's the SM BIOS strings that are in the BIOS very much. It's a Dell D600 machine. Unfortunately, some machines are shipped, for example, with different video cards. You can get the same Dell machine with an Intel video card, with an ATI video card and with an Nvidia video card, some of them, and there's often no way to distinguish them by DMI matching. Maybe Dell knows there's some different serial numbers or something like that, but you don't want to match on the serial number. So we can't do that. And yeah, it needs to be reconciled, as I already said. The second whitelist is kept in HAL. There's in HAL, it's also pretty extensive because basically we're merging the whitelist as long as it's possible with the S2rump infrastructure. HAL is much more flexible to match. You can match, for example, on the PCIID of the video cards. Usually they also do DMI matches, but you can't additionally match on the PCIID of the video card. So you can distinguish those, the 820 from Dell with the Nvidia card and the D820 with the Intel card and can apply different options. Basically that's the problem, that you sometimes need different options depending on the video card. Another good thing about HAL is that you can easily extend it by adding a FDI file. That's what Timo showed you in this talk before, that you just changed the FDI file and HAL knows something new about the hardware. The downside is you need HAL running to use it, actually, which means you cannot just put it in it in Lash and try it out from there because there you have no HAL running and you have no database. That's the biggest drawback of using HAL and actually one that's considered major by one of the Suspense developers, but, well, he doesn't maintain the wide list. Then we are by... Suspense disk. Suspense RAM is over at the state of the art. Suspense disk. There are different methods. You can use the proven kernel method where you just do echo disk into syspower states. The machine suspends into the swap device. It works. I have not a single bucking board for 10.3 for those methods, maybe, because it's no longer default. It has no fancy option. It's relatively slow, but basically whenever somebody has a problem with Suspense disk, everybody will tell him to try the kernel method. If this works, then it's not a driver problem, for example. It's for quite some time in kernel. 2.6... I'd say it's usable since about 2.6.5. It was in the first month. It was very adventurous. Then there's the user space suspend. That's what we, in OpenSUSE, are using as a default now, where some parts of the suspend process just got shifted from the kernel space to the user space. Basically the stuff where the kernel developers didn't want to tackle with compression encryption, somewhat fancier user interfaces, progress parts and so on, stuff that when you try to push those to Linus Torvalds they'll go away. I don't want your fancy stuff. I run X. That's enough code for me. It started out as a hack, but it's since in mainline counts in 2.6.17 and it's working quite well. It does for me. We'll come into that later. Then there's Tux on Ice, that's formerly known as Suspend 2, which was developed as a kernel patch by Nigel Cunningham, who's a very nice guy, by the way, and he's maintaining this since 2.4 days. It's relatively easy to set up once the kernel is patched and built, but that's a little bit of a problem, of course. It has lots of fancy options. It can do compression, encryption, splash screens, text mode user interface, almost everything, and it does this in kernel space. That's where most of the kernel developers say, no way is this stuff ever going to be merged. It's quite well supported. It has quite huge following, and many users are very happy with it. This does not mean that the kernel developers are happy with it, but users like it and it deserves to be mentioned. As I said, Nigel is a very nice guy, too. That's what we have now. Those are the methods. In user space, there's nothing new to tell since last year. We're using PMutils, which is evolving. PowerSafeDemon is no longer used for Suspend since 10.2, I believe. There was still the possibility, but then we shifted to Hull and PMutils, as everybody has probably heard in last year's talk. Part 2, that's the interesting part. What's next? In the future, right now it's going on for Suspend. There's a mechanism called the Freezer. Everybody who has tried to Suspend has not used Splashbin as properly seen. Stopping processes, and one in every 100 Suspends, it probably said, failed, and just returned to the graphical display. This sometimes happens. Freezer stops all the processes so that the machine is really quiet and later the kernel can do its atomic image copying stuff. The Freezer, it has some problems. Usually processes that are in state D, which is basically waiting for an L, they cannot be stopped. People complain about the Freezer on the Linux kernel mailing list and then some high-profile kernel developers say, all this stuff is broken anyway, so right now it looks like it will get removed, sooner or later. Probably later, but it will probably be removed. There's a very prominent kernel developer last week again who was renting against Suspends, this Finnish guy, and he's also one problem, and he said, okay, this Freezer maybe we should do away with it. This will happen first for Suspends to ram, just because there is much easier, and later, but probably will also happen for Suspends to disk. It will not happen soon, but it will happen. The removal needs to be carefully considered because there are many parts of the kernel who just don't expect that stuff vanishes under their feet, and so we will see many interesting kernel loops is on the way to have the Freezer done, because right now the system is put basically in a consistent state, all processes are stopped, nobody will do DMA and stuff and then we copy the image to the disk, for example, or we tell the buyers to now shut the machine down, we buy ourselves, we save the CPU state and then we tell the buyers to put this machine into Suspends to ram, so it's always in a consistent state, but the Freezer makes, for example, Suspends to ram slower than it needs to be because it has to stop all processes and has to wait until they're stopped and sometimes it fails. That's the greatest problem is that it sometimes fails, so it's, yeah, what a nice people and instead the trend goes instead of we fix it up, people are not really fixable, there's discussion about that, but the discussion is probably basically over, it will be removed. I don't think removing the Freezer will solve all those problems automatically, just to see shiny new, better problems. As always. Then there's work going on in the driver infrastructure and the power management core. Rafael Dessopi is also a very nice guy from Poland who's doing quite a lot of work in the background of power management stuff and he is, he wanted to do this, the overhauling of the driver infrastructure for kernel 2624, kernel 2624 is out and running on this machine is not completely overhauled just because he did not want to break everybody's machine. So is that okay? First he has a daytime job he has to do and then he needs just more time. That's part of the discussion he had with this Finnish guy last week. Where Linus basically said, why are you using the same code path for suspend to run and for suspended disk? Which is a valid question and this was asked years ago. Basically in four more times it was just easy. Somebody had to develop the code path for suspended disk and it just used the same we just spent the drivers and so everything was done the same for suspended disk and suspended run. Now we can argue that there's two totally different things all that those are similar. That's an argument that has been followed on Linus's main list for two years and basically today everybody agrees okay we're separated but somebody needs to do it. That's Rafael Dessopi's doing it now. It's going on slower than he planned it but it will take place. There's lots of background work that you don't see done in all the drivers in the power management core. All those drivers now until today they only have a suspend method. So if you do suspend to run or suspended disk they get the suspend method and they shut themselves down mostly. Now they get two methods, a method for suspended run and a method for suspended disk and most of them will probably behave the same but some will just say okay I don't need to do anything for suspended run because the system will take care anyway that the state is restored after suspended run but for suspended disk we are sure we lose power and nobody will help us with that so we need to re-visualize on suspension. This depends on the driver. This needs to be done and this will take some time. Then there's the question will there be a merge for suspended run to suspended run to suspended run to did some effort around a year ago or two years ago he wanted to merge suspended to the mainstream kernel because maintaining a patch out stream of the 2.6 mainstream kernel is a pain in the ass because it changes so fast you have to adapt to in former times the chain from 2.2 to 2.4 is today I'd say from 2.15 2.6.15 to 2.6.20 so the kernel changes very fast and the kernel developers say okay that's an internal interface nobody should use it anyway or they should just push the up-stream so he tried to push this up-stream but for the reasons that before there's lots of user interface stuff in there and it will probably never go up-stream that's what many of the involved parties have told me then the next problem is the suspend 2 is heavily dependent on the freezer he has also done improvements to the freezer so that for him it works better but those were considered highly complicated there was some stuff in there but the kernel developers said well maybe this works for you but nobody can explain why it works better than the old one so as long as we don't know why this fixes the problems why make it more complicated than it was maybe it's just what you call programming so he has some problems his problem now is that the freezer is going away sooner or later and then the suspend 2 or tuxonize concept he will have to take care of that that's probably not an easy job what Nigel is doing is contributing lots of through his huge community he has this large community contributing lots of fixes where he gets a bug report and he finds that that's not a suspend 2 or tuxonize problem the project got renamed it's not a tuxonize problem so he fixes the driver and sends the driver fix upstream so Nigel is continuously contributing good bug fixes and he's really doing a great work here I think he deserves more merit for what he does and he's really fighting because it will not get upstream probably, I'm your then there's some funny guys they think oh I this suspended disk is totally broken it never worked for me and we could do this using K-Dump K-Dump is a tool for if I understand it correctly it's a tool for getting crash dumps so you crash the model it puts all like a corner but from the corner to some partition and basically if you do not crash the model but just say dump core and load this core file and start it again well you did a suspended disk and resumed and there was actually somebody who did presentation at LinuxConf Australia and said that will be the way for a suspended disk so I said okay this guy is sometimes proposing interesting stuff and I asked around some people think he had smoke dumps in his brain before he held this talk I'm not sure, I haven't heard it the problem is it's a two hour hack to get this working if you sit down for two hours to get this working but this again will not with some magic dust blow away all the driver problems you had before the driver is still there you still need to re-initialize the devices you still need to make sure that you load the correct image back and so on it's an interesting proof of concept but nobody knows what the real benefit is and so it will happen it will come to the mainline kernel sooner or later but it will not replace the existing methods with the user space suspend and the kernel space suspend or as Raphael has told me this will be the new way to suspend once he sees a working implementation that's comparable with features speed, reliability and ease to set up and then made some blank lines at which it's probably never we will see everybody is working on a, is waiting for a working solution that's actually, in the end I don't care, I really don't care how the suspended disk is done it's working, it's fast and it's reliable so we'll see, that's one of the possible things to do then a pretty interesting project where Raphael Martin is working on is a sleepy linux, it's called sleepy linux where he basically says ok and he says we need to push suspend to run much harder so if the system is idle for 10 seconds why not suspend it in this time and this he has a working prototype his thing is the hardware is capable of doing better but we don't use it and one problem is that for example now in suspend you run the bios switches of the disk but with some help from the vendors, from the bios vendors from the hardware vendors we could probably suspend the machine without switching of the display and then you could still do your mail and once you push a button the machine wakes up and displays the next mail and it can go to sleep again and this is stuff where linux, I think in the PC where leads the pack because on Windows Wista just got worth with the power consumption and we are trying to get even more small stuff out and actually who has seen the Nokia Internet tablets basically they're doing the same they don't have a dedicated suspend state, they just switch off more and more hardware that's unused at the moment and if it's unused for three minutes they also switch off the display and probably stop the CPU clock or something and then the machine is suspend they don't with some help from the hardware vendors if they show that this is doable maybe Intel might be interested and support is better from the bios and it will never work as good as on those Internet tablets with those embedded processors that are especially designed for it but we can probably do much better on the even on PC so that's an interesting thing I will not be able to show this on next Boston in full working condition I'm sure but it's interesting isn't the OLPC doing something similar? probably yes so there we look at the next x86 like it's often it's mostly a matter of firmware it's not a matter of the hardware, the hardware can often do it but the bios is not prepared, we don't have a excuse me, we now have ACKI mode S3 which is a full flash system to run and there are displays of defined this and so maybe we need a state S2.9 where the display stays on and the graphics card still renders the image so and where the machine no longer consumes 10 watts but maybe only 2 and that's ok as long as I can read my mail something like that, yes driver shuts the hardware down when it's not used that's also happening right now for example with USB auto-susband yes PC hardware is quite stupid often and nobody cared about stuff like power management until maybe 2 years ago yes those laptops but they didn't bring the money right now today everybody is wanting to get energy start compliant as data center power consumption is really an issue that people are willing to pay more money for hardware that is able to run with lower electricity because this is all stuff that's going into it it's not only the suspend stuff but it's also the run time power management stuff that will be in the drivers and maybe even in the hardware so yeah we will see there we will see improvements in that, I'm quite sure so the future in the kernel side and now the future on the user space side what will happen to this suspend white list obviously some of you will have thought well why do they have two times the same white list the suspend to run white list is maintained by me so I'm guilty of promoting one of them but actually now I'm trying to get rid of it because first it's a lot of work maintaining it and then we've just found out that it doesn't scale well we can only match DMI strings in suspend to run and of course I can now start building an infrastructure where I can also match PCIIDs but then the problem arises probably you have different options to suspend if you have installed a binary only NVIDIA driver or if you're using the open source driver so which option do you put into the white list with hell I'm not sure if you can do this now but it's probably it will be pretty trivial to match on some instance of software version not just let the software install or set some keys and we have the binary only driver or we have the we have the free driver which need different options so I'm basically saying okay we will drop the suspend to run this sooner or later we'll put it into how for the user this will make no difference because the user hopefully just clicks onto his power manager icon or presses an NF4 and you think the machine just suspends so he doesn't need to know where the white list comes from and we will have we will concentrate the efforts to put one good white list together which is even bigger and works on even more machines than maintaining two in parallel so that's told me this sentence a little bit misleading we will not only move the S2 run white list to how but the efforts will move from maintaining the S2 run white list to maintaining the L white list and then for some it means okay you need to have all installed otherwise you can't you won't be able to suspend out of the box but basically that's true already with the Susie suspend with the Susie 10.3 the Sus suspend is done by our HAL and PM utils yes you can call PM utils manually as root on the console you can call PM suspend but I'm quite sure that's not what everybody uses every day and the one who wants to use it from the command line can still do a wrapper script which calls S2 run with the options he needs for his machine so it's I think it's not that bad as Pavel usually puts it. Pavel is the one who says I want to be able to suspend with from in it and bash without having hard running and I say okay then take over the white list maintenance so this will probably happen PM utils has some pretty interesting stuff going on because it's actually it got forked effectively. A new maintainer has taken over basically without consulting the old one if I have understand this correctly okay the old one wasn't very responsive so often there was silence for a month on the mailing list and then he replied to mails and well during one month of silence the project got moved to a JIT tree and there have been lots of lots of commits but I have still to see a little development is ongoing for the user not much will change the distribution they can use the old version the new version they both work basically I think it's feature complete most of it that's what happens in user space built in here and now it comes to you the users what can you all do to make this future brighter who has reported a bug against us spent here against distribution against the kernel or something like that who now again who had a resume failure so where are your bug reports that's this is really an important issue it's as I told you before I always expect suspend the disk working just fine for everybody because it does for me and I have very little bug reports against it so apparently it just works the problem is everybody everybody probably thinks well this stuff doesn't work anyway so why should I file a bug report that's wrong you need to file bug reports you need to file bug reports at those kernel developers you don't fix the broken drivers you need to file bug reports at the distributions you don't package it correctly file them if it's a distribution bug if you're using open suzi go to baxilla.com if you're using some other distribution they sure have a bug tracker that's file bugs if they don't want it okay then if they say go away we don't want suspend to work but I'm quite sure they won't say that resume failure I hit suspend and the screen went blank and then it woke up again it couldn't go to sleep that's also a bug and there was no log messages no error messages if you omitted what happened then file a bug and if you're using suzi the bug will probably get assigned to me and then I will say the log file is there and if I get 10 people it doesn't work I didn't find the log then I will think about maybe documentation should be better that's even if you find the bug in the documentation that's a bug I cannot find the documentation yeah that's also a bug that's probably the most serious bug if there's a document in it I'm guilty of not writing enough documentation of course there's always stuff that needs to be done first but we need to fix that so file bugs even the kernel developers they are ugly loud probably they are eating their children or something mean ugly people but they don't bite basically just bite back if they do so if they write broken software they need to fix it even if it's this all hyper prominent guy if you have a detailed bug report he will probably be a nice guy and say ok come back or try it like this yeah we fixed this oh that's an embarrassing bug it often happens do not all these resumed failures, all the suspend failures do not accept them they are not given by God this is a bug you need to report it's your job it works for me but can I say it works for me as long as I don't know that there are bugs out there I can fix them even if I know there are bugs I sometimes also can fix them I have to confess but there are bugs that will just get fixed won't fix in Baxilla which is often in my case a config and I write there sorry I believe you it doesn't work for you but I don't have the hardware and I'm just assuming to fix it but even then it's important to know that there are problems out there because for OpenSUSE 10.2 I was quite sure I spent a distant work for everybody because I haven't got a single bug report one or two but there are clear user errors and I didn't get many bug reports for suspend to disk in 10.2 later I found out it didn't work for anybody but nobody told me so that's a problem because I need to know where we need to work on everybody that's for every project on this and again I really want to promote this bug report on suizet factory Baxilla.com product 11.0 component mobile it will get to me or less directly and we will try to fix it that's the real important thing okay these are the usual interesting links so yeah any more questions something you want to tell me yeah yes actually what's there what's already there in the framework but I have not gotten to implementing it in the user interface and in the PMutils we can do a suspend to both so we first write the image to disk but then just do a suspend to run suspend to disk the problem is yeah the suspend to both is relatively easily because you just you do a suspend to disk first but then don't switch it off instead of a suspend to run to do what you want that's what the old IBM ready say 10 years ago one thing they wake up after 3 hours of suspend to run and then do a suspend to disk yes what I will offer I hope I will get it ready for 11.0 the suspend to both as a configuration feature the problem is with the wake up on a alarm timer or the empty battery is that you don't know on which machine it actually works so we need to have some kind of wide list or something like that which is we need somebody who maintains this and that's basically a problem it's a resource problem so you will probably get suspend to both easily configurable and basically you can still just suspend the machine away as long as it works reliably and you assure that it works reliably by reporting every bug you find ok, more questions ok so when you talk about the e-links one of the problems there is that you have to accept a certain amount of loss of functionality in some situations you won't be strange how it works whereas in the old BC case in order to have wireless network in a useful way they need to have a wireless chipset that basically runs its own 8 to 11 stack and most hardware is not capable of doing that so you're going to not be able to do this while also using the wireless network that's what I actually said with we need support from the hardware vendors so how this prototyping a large amount of experience that's in the wireless hardware that's going to add like $8 maybe once the hardware is sold off but Harvill is prototyping this and once he says this would be working if you would be selling appropriate hardware maybe companies like Intel or something can say ok we can put this into the firmware probably or we can do a little bit the hardware just it does not need to be the chipset the most the wireless chips are not anywhere in terms of wireless chips they don't have anywhere near enough hardware capabilities you need to go back to probably you say ok it doesn't work when wireless is turned on I can still do my presentation here with the machine most of the time sleeping so that's it won't work in all cases and it's a prototype yet it's ongoing work and we never know we don't know even if he doesn't know if it leads to anything but it's an interesting project and that's why I wanted to show you to mention ok I think I'm going to use that so thanks for coming fuck your parts fuck your parts fuck your parts