 Hi, first remember to if you have a question ask for a mic wait for it and look at the camera in the front Don't cross in front of the camera And well now we are going to hear a talk about how to enhance Linux power management using less what from Let your America community manager at Intel Sula Mita Garcia Gracias Buenos Dias English sorry Hi, good morning to everyone. It's kind of high the volume and hi to everyone watching the streaming Thank you very much for the organization for putting together this this conference Before joining here. I was hurting a lot of things and it's really amazing their jobs and thank you for Accepting me here. I feel almost join a secret society and By the clapping I saw there would be some kind of cold the morning cold or something. It's okay So I work for Intel and I represent many of our open source projects developed by the Intel open source technology center and I'm here to talk to you today about one of those projects that is related to Enhancing the power management In Linux, I think we all can agree that we still have a long way to go on this area Powerage management the management in Linux is not our best thing. So Power has become a new focus area in the industry so because It's also related to the questions about the environment the global warming How many how much the computers has spread on our lives and around the world and how many energy are we expanding on that? it's Demands also a lot of costs in the in the data centers in our lives and Whatever there is a lot of computers. There is heating. There is energy expanding So as become this become a new concern on this How this can affect you if you save if you have a better power management system in your Linux You can save Money in your electrical bill and this might be not a huge difference in One house who has one computers are just a few computers but when it comes to data centers who have thousand of hundreds and This this come this can matters a lot It can make your battery battery less longer Whatever whoever have a laptop running Linux know that that's kind of an issue and Of course is more friendly environment friendly so less what it's actually a project Fostering a lot of other projects. It's it also is more like a community One year ago when this project were launched. It was pretty much around just one two less what Who started to raise the attention the awareness about? Which applications were expanding most of our energy around Linux when you're running Linux? There are some application that can use like 30% of your battery just that application alone. So and they started to write to They started to Build a community around that and everybody that joined that community brought a new vision a new perspective About where could we save? Power so we started to we started to have other tools besides Partop Everybody knew a trick knew a tool will have some tips about software development So about configuration of some applications And so we joined all came together and there is a lot of gate lines a lot of documentation And it's all open source is open documentation is open source so there is a lot of distributions that just go there and take the patch patch and some just in and some projects who also go there and take the patch and To their applications. So On the beginning there was this application power top made by Arjan Arjan from the real Arjan from something Sorry too many weird names and This this is a quite simple application There is just some dependencies and what this it does is to show you how your CPU are is running And what are the most? The applications that are taking most of their energy on your system So and also there is this tiny area We keep telling you tips that you can change your configuration So for example, there is this future on the kernel that if you enable it you might save you a lot of Energy a lot of your batteries resting longer You can set this configuration for your wireless to enter in a idle state when you are not using that also is going to save your Your battery and there is options to do that To do that for you, but that was the simple thing and so when they started to look at there was some applications that Very quickly be started to be always on the top applications wasting your your battery So after that they kind of created. No, okay, so that they applied a lot They work it a lot of the kernel they applied a lot of patches They fix it a lot of things and they had a great a great report from saving energy with the kernel But we all know there is just the kernel is not the whole system. So they started to notice a lot of Applications that started to show every time on the top of the applications consuming most of your of your battery and Some applications like paging can is one of can of those who can expand like 30% of your battery so if your batteries Remains like five hours Just the the guy in running alone is going to consume more than one hour One hour and half Firefox XR genome are always the top on the list So they started to working with them to create patches. So paging for example, they lasted the lasted version The less the version has has a lot better Power management than the the previous one because everybody started to noticing and join it to fix it Firefox also is receiving a lot of effort on that and so other other Applications But how can we do that for new applications? How we can create this new mentality? The developers Responsible for this project last words. They told me that They explained me the whole story about that because we get to use that the fact that we have a lot of Possessor We have a lot of power Available available and we don't think anymore on this trains to That used to be on the beginning of the industry that they have very small memory to program They have very small power processor power and So we just use those resources without any any further thoughts and so we became a lot of Consuming energy. So how can we change that? Just thinking on how can we better manage the power while we are developing so there is a lot of Few tricks that we can follow that is going to to make this To make the development more power-friendly. Oh, by the way, if there is any questions I'm totally hoping that people just just join. I don't know if I have content for a full hour So I'll be really glad if everybody Comment make questions anything So for example, everybody feels better when they have a full eight hours of sleep Instead of having two hours and then wake up for one hour and have more two hours and waking up for other for another one hour, so it's the same thing when we Charging the battery or where you're saving power the longer you can stay on the Recharging states on the either states the better. So if you can put this all together instead of queuing in In between it's better for your power consumption always try to go out Finish all the tasks and go idle on your applications is also going to To help to save powers Instead of trying to wake up any devices trying to turn it off the ones that are not being used They are also going just to be wasting energy without no Without needing Create longer idle times between activities again trying to always Put the activity together to have a bigger idle time Avoid pulling there is a lot of applications that keep pulling the processor all the time to just make question Or just to checks for status for new data And sometimes it's just too much and every time that you pull the the processor It needs to wake up and starts to wasting more power More energy and so I'm good. I have another slide on that Try to group the timers. There's another slide on that use large buffers like trying to do a lot of Get a lot of data or for example for a video try to get a lot of bigger buffer for video So you can process everything once at once and go idle right after that Optimize the the sleep That is kind of recharging without interruptions, but try to Yeah, that's the same thing sorry and be aware of high-level languages They are very useful for creating quickly applications But most of them are not very power-optimized So try to every time that you can choose the runtime environment choose a better version Check if there is other Patches that can provide a better power management So there is applications that keep pulling for Something that is not really necessary. So for example, there is some applications that can check if the mouse Moved once in a once every second. There are some applications that can check if the volume and change ten times per second and For example checking if there is data on the pipe like a 10,000 times per second So is that really necessary? Can we optimize that? So it's it's okay that we want to respond as fast as the data have come But sometimes probably some delayed can be accepted in order to save better energy And grouping timers is kind of the same thing if you will need to use timers try to do that all at once and then go to idle The most of time that you can it's much better than to having Having them Always spread in the in the time Arrays to idle is like trying to speed the maximum of your processor try to use it the maximum because it's better to use To use the other processor at maximum for some time and go then go to idle They try then try to use like just half of speed Because that's not going to save any power actually. So I say pu consumes like 34 watts in full speed and 24 and half speed and just one when idle so if you can join if you can execute every all instructions at full speed and Then go to idle is much better than Processing it longer at half speed and then go into idle So an example here So there is a lot of Documentations about how to put more to have those tricks and how to Create a man mindset of development. That's more intended to to have the power consumption in mind when you're writing code But also there is a lot of tools Designer to check Where can you can you can you do better? So for example, I'm going to present some of those tools available unless what one of them is the battery life toolkit It's related to check. How is your laptop battery going on? It's a framework that has a lot of work loads So you can check how your battery is performing when you're reading when you're Browsing when you're seeing some When you're doing tasks related to media when you're developing so they have a lot of Workloads preset that make a lot of tests and collect a lot of numbers on your battery to check How is your battery going if there is anything you might check before it goes worse and With that we can also check. How is the software going into? Manage managing the the battery life There is the power policy manager who can which there is a some Some user modes or you can create your own user modes and they're related to tasks Where you can enable or disable or power off some applications So for example when you are on a airplane you don't need to To you actually don't have to shouldn't Power off your radio your Bluetooth your other your with wireless Cards so we when you go to this kind of user mode. It's all going to turn it off for you in Presentation you don't need just screensaver And there is some events activate like when the CPU is overheated There is some actions that you can too to to decrease the the heating Priorities and and and everything This is more related to Intel graphic drivers. There is a lot of Features included on the chipset This is just to have to give you one idea that there is a lot of Features already included on the hardware that they are working to see how much can they Can they save and there are some of them already included on the drivers But there are some of them who still need some development work So if anyone is interested in this in that area, it's a good way to to check There is a lot of other projects some of them are really related to Kernel development So I would not go there because I'm not a kind of developer. So I don't quite Feel comfortable to talking about them But there is some of them There's just to create a quality of service related of power. So application would be developed having this in mind There is the T-class idle who try to avoid pulling and try to put to aggravate the pulling with all you having to To understand too much about that. That's all in the kernel. So it's It's already preventing and grouping better the pulling There are performance C and power there The patches for the ACPI to have a better power management And I think I spoke I spoke too fast because that was Sorry But I was expecting that Some of you were more into this We're already knowing some of this this stuff But my my pretty much my job here was to show you that this can be interesting for Debian But also that the Debian community would be really interesting for this project Because when it started one year ago was just about less watts all this other Documentation all other tools or other stuff were for people who joined the less watts Website and created more tools and created more documentation intrigue So everybody who joins that community brings another Another item another perspective and this is have become a very really big Resource website. So if you want to check that and if I can answer any question regarding the high level Development tools you said which those kind of tools should be avoided. Is it why why high-level development Language should be avoided. Oh Because because they they they wouldn't exactly develop design it to be To be worried about power consumption So they they pretty they most of the time they don't have the best Performing they are they are like using all the bad Bad things that you should not use in development like pulling off the time Like not using full resources and not racing to idle So there is a lot of people working on many Many languages trying to improve that but when you use More high-level languages there are more tend and they tend to use More resources without caring too much about the power Just to be sure to start a good flame. What do you have the names of the bad guys? Well in top of my mind Java pretty obvious Yeah, you talked a little bit about the the power policy management. I wanted to ask something about The tools that you have to control those different Sort of modes like you just mentioned the airplane mode so As I understand it you can switch between Different layers so for example when a device enters the airplane it It would turn into the airplane mode and be layered across Say like the default policy manager I wondered about what tools a developer would have to control which specific Mode was enabled on the on the device. I mean, how does that happen? Is it like a D bus call through the to the application? I saw mentioned on the on the less well site something PPM tools is mentioned Can you explain a little bit more about that or if you know about that? Power policy management If I record correctly what I understood is that some of the things that this application can do it's like Turning off the devices that you don't need and also turning off the applications that might be using those devices Because they were going to try to wake up the device It and we're going to keep pulling to see when the device is going to be turning it on but I Think that's like I started Project and so the where they can go can be much Brother than much bigger than that but what I understood was that I don't know if that answer your question I just made a check on my laptop very quickly about Battery life took it and power policy management in Debian. We don't have any of those So I'm quite ashamed to see that we don't have done any of those That's what I'm here. I'm here to ask you guys to package that today Yeah, I think this these are definitely things someone should pick up and package and if there are Application managers are in the room if you have to suggest things to your new maintainers to package Please suggest them to package this stuff instead of the gazillion Editor or male reader or whatever crap you want to work, please Just later to That's a good question. I don't know. I don't know but that's that there is something While was preparing this slide there was something that I I need to report back to the developers because there is some information missing on the website so any Any other suggestions should go to the mailing lists or the developers to Yeah, sorry for stealing the microphone, I think this is something we are I'm not aware of any project inside Debian to work around this all this stuff. We have a lot of things to deal with Battery life processor. I checked. I have tons of stuff installed on my laptop. I don't really know which one is useful Which one is useless? Do we have no group working on that and again if there is an idea of a team or whatever to work on this in Debian That would be definitely a good idea. I don't want to take the lead of that To extend this a bit further a lot of people don't realize Exactly how important this is to lots of people around the world. For example in Iraq the Iraqi people Can only have about three hours of electricity per day before the generators are turned off If you were able to charge a car battery and then use that car battery to keep your computer system alive You could actually have your computer working 24 hours a day if it managed its power properly There's a lot of people who live off the grid That means they don't get electricity for a very small amount of money because it's produced by a hydroelectric plant They pay a lot of money for their electricity because it's generated by Generators where you have to run the my gasoline or people who actually pedal a bicycle to generate the electricity Every time you cut the electricity usage down. It's less peddling. They have to do I Forgot to mention this is just to start some Flamor and I don't know if you guys saw like two months ago Zendros reported that they applied To modeling and they save like 25% of the body to life It's huge like if you get if you get just four hours on those small netbooks you get an extra hour just for applying the software patches and What that means that means that they applied modeling on their base and they saved but actually is the same thing running on modeling that is the same patches that went to modeling for better power consumption are based on the last watch project, so it's So let's see how much Debian can can do well Anything else I think someone Want to comment on? No So I also brought a lot of t-shirts And I hope that was just a highlight and I'm aware that I could I'm not able to the to deliver much deeper Technical details about the kernel development everything, but I hope you to see you guys around the project I hope to see the packages around Debian and to have you guys on the project. Thank you