Hi Andrey and lynxis,
thank you for the quick reply and your suggestions. I followed Andrey's advice and here are the results (only with full screen brightness):
Coreboot with idle=poll: 15,8W Coreboot running "stress": 37,2W
Vendor BIOS with idle=poll: 15W Vendor BIOS with intel_pstate=disabled: 10W Vendor BIOS running "stress": 24,3W (!!)
Remember, the idle values without additional kernel parameters were: Vendor BIOS: 10W Coreboot: 13,4W
I didn't expect the power consumption in the "stress" scenario to rise up that high with coreboot, I just supposed to power consumption in idle to be affected! :-(
Unfortunately, I was not able to extract the VGA BIOS and use it instead of native gfx init, as I didn't succeed to apply bios_extract:
daniel@compilehost:~/extract_x200_vga$ dd bs=1k skip=6144 if=x200_factory.rom of=x200_biospart.img 2048+0 records in 2048+0 records out 2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.00409209 s, 512 MB/s daniel@compilehost:~/extract_x200_vga$ ../bios_extract/bios_extract x200_biospart.img Using file "x200_biospart.img" (2048kB) Error: Unable to detect BIOS Image type.
And I didn't find any documentation about how to actually extract the VGA Bios part, so any hints are welcome.
By the way: All settings in the vendor BIOS are default/unchanged. And I activated all these PCI power management and ASPM settings in coreboot (see my attached config) and even disabled all debugging to serial console etc. but this didn't help so far.
Cheers, Daniel
Hi Daniel,
On 01.05.2016 12:26, Daniel Kulesz via coreboot wrote:
Coreboot with idle=poll: 15,8W Coreboot running "stress": 37,2W
well, this is what I would expect from the specs.
Vendor BIOS with idle=poll: 15W Vendor BIOS with intel_pstate=disabled: 10W Vendor BIOS running "stress": 24,3W (!!)
This looks suspicious. Doing some calculation: You are measuring at the wall plug, efficiency could be around 83%, which would leave 20W. Chipset, backlight and other stuff needs power as well, say around 8W, leaving 12W for your 25W TDP CPU???
So, before bothering yourself with the power consumption difference under load, I would also check the performance of coreboot vs. vendor BIOS.
And I didn't find any documentation about how to actually extract the VGA Bios part, so any hints are welcome.
Um, if you find a way, please document ;)
Nico
Hi Nico,
On 01.05.2016 12:26, Daniel Kulesz via coreboot wrote:
Coreboot with idle=poll: 15,8W Coreboot running "stress": 37,2W
well, this is what I would expect from the specs.
Vendor BIOS with idle=poll: 15W Vendor BIOS with intel_pstate=disabled: 10W Vendor BIOS running "stress": 24,3W (!!)
This looks suspicious. Doing some calculation: You are measuring at the wall plug, efficiency could be around 83%, which would leave 20W. Chipset, backlight and other stuff needs power as well, say around 8W, leaving 12W for your 25W TDP CPU???
Well, I could imagine that the PSU's efficiency is better than 83%, and maybe the CPU is just rated at 25W TDP while in fact it consumes less. Please note that the whole family of CPUs is rated at this wattage and so is the P9600 which runs at 2,66GHz and not just 2,53GHz and at a slightly higher min. voltage (but slightly lower max. voltage).
So, before bothering yourself with the power consumption difference under load, I would also check the performance of coreboot vs. vendor BIOS.
That's a good point and I was also thinking about this. So I just did a few measurements using "cryptsetup benchmark" (results attached). As you can see, indeed performance with the vendor BIOS is significantly lower. But why?
As I don't really need so much performance and rather would prefer better battery lifetime, the vendor BIOS' behavior would suit me better. I will try to tweak its settings a bit and see how this impacts performance and power consumption so we can get a better idea what could be causing the impact.
And I didn't find any documentation about how to actually extract the VGA Bios part, so any hints are welcome.
Um, if you find a way, please document ;)
As I posted, it is there, but a bit hidden in the Wiki.
I also ran a test series with the microcode updates included => no difference.
Cheers, Daniel
On 01.05.2016 15:30, Daniel Kulesz wrote:
Hi Nico,
On 01.05.2016 12:26, Daniel Kulesz via coreboot wrote:
Coreboot with idle=poll: 15,8W Coreboot running "stress": 37,2W
well, this is what I would expect from the specs.
Vendor BIOS with idle=poll: 15W Vendor BIOS with intel_pstate=disabled: 10W Vendor BIOS running "stress": 24,3W (!!)
This looks suspicious. Doing some calculation: You are measuring at the wall plug, efficiency could be around 83%, which would leave 20W. Chipset, backlight and other stuff needs power as well, say around 8W, leaving 12W for your 25W TDP CPU???
Well, I could imagine that the PSU's efficiency is better than 83%, and maybe the CPU is just rated at 25W TDP while in fact it consumes less. Please note that the whole family of CPUs is rated at this wattage and so is the P9600 which runs at 2,66GHz and not just 2,53GHz and at a slightly higher min. voltage (but slightly lower max. voltage).
It's the other way around. If a sample is stable at 2.66GHz without drawing more than 25W it's a P8800, if only 2.53GHz it's a P8700 etc.
Nico
Hi again,
I did some more experiments with the vendor BIOS and made the following observations:
- disabling "cpu power management" makes the idle consumption raise to 12,8W - disabling "PCI Bus power management" and "PCI express power management" makes the idle consumption raise to 13,3W - disabling the AMT firmware had no effect - running the stress test still drains only 24,2W - performance is the same as before
I still don't understand the whole performance issue. Therefore, I took another X200 with a P8600, CCFL screen and an older vendor BIOS and re-ran the benchmark there --- with almost identical results.
So in the end I'm just confused. This would mean that running Coreboot makes the X200 *much* faster at the expense of battery life, both in idle and under stress conditions.
Any ideas which could solve this mystery?
Cheers, Daniel
On 01.05.2016 21:40, Daniel Kulesz wrote:
Hi again,
I did some more experiments with the vendor BIOS and made the following observations:
- disabling "cpu power management" makes the idle consumption raise to 12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
- disabling "PCI Bus power management" and "PCI express power management" makes the idle consumption raise to 13,3W
- disabling the AMT firmware had no effect
- running the stress test still drains only 24,2W
- performance is the same as before
I still don't understand the whole performance issue. Therefore, I took another X200 with a P8600, CCFL screen and an older vendor BIOS and re-ran the benchmark there --- with almost identical results.
So in the end I'm just confused. This would mean that running Coreboot makes the X200 *much* faster at the expense of battery life, both in idle and under stress conditions.
Maybe Lenovo limited the processor clock on purpose to get a better battery life. Maybe it's just an unexpected side effect of running Linux (not Windows, what Lenovo tested against). Anyway, I wouldn't care about the power consumption under load, it might even result in a longer battery life: Being faster means shorter periods in higher performance states. The idle power consumption is what really matters.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Nico
- disabling "cpu power management" makes the idle consumption raise to 12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
Nope, I am only comparing with highest backlight now, so it is 12.8W versus 10.0W here.
- disabling "PCI Bus power management" and "PCI express power management" makes the idle consumption raise to 13,3W
- disabling the AMT firmware had no effect
- running the stress test still drains only 24,2W
- performance is the same as before
I still don't understand the whole performance issue. Therefore, I took another X200 with a P8600, CCFL screen and an older vendor BIOS and re-ran the benchmark there --- with almost identical results.
So in the end I'm just confused. This would mean that running Coreboot makes the X200 *much* faster at the expense of battery life, both in idle and under stress conditions.
Maybe Lenovo limited the processor clock on purpose to get a better battery life. Maybe it's just an unexpected side effect of running Linux (not Windows, what Lenovo tested against). Anyway, I wouldn't care about the power consumption under load, it might even result in a longer battery life: Being faster means shorter periods in higher performance states. The idle power consumption is what really matters.
Yes I agree, I am almost never putting high load on the machine anyways, so even if it would make an impact I would not care too much. And then you can still limit the max. frequency or something and be performance-wise probably still comparable to the vendor BIOS.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
intel_idle.max_cstate=2: 10W in idle at full brightness (no effect) processor.max_cstate=2: 12.6W in idle at full brightness
So it seems plausible that this issue is related to Coreboot not (properly?) supporting C3/C4. So this is a known issue then? If yes, imho it should be *definitely* documented on the wiki page since it could be a "showstopper" for many adopters who need the maximum battery life the X200 is able to deliver only with the vendor BIOS at this point in time ...
Cheers, Daniel
On Mon, 2 May 2016 01:06:10 +0200 Daniel Kulesz daniel.ina1@googlemail.com wrote:
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
Can you do a test run with closed devices? This would ensure, you're not measurring a brightness difference.
best, lynxis
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
Can you do a test run with closed devices? This would ensure, you're not measurring a brightness difference.
Okay, you mean with the display turned off? I did this now using xrandr and here are the results:
Coreboot: 9.0W vendor BIOS: 6.9W
Cheers, Daniel
On 02.05.2016 01:06, Daniel Kulesz wrote:
- disabling "cpu power management" makes the idle consumption raise to 12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
Nope, I am only comparing with highest backlight now, so it is 12.8W versus 10.0W here.
Hmmm, 2.8W... whatever that option does it confuses me.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
intel_idle.max_cstate=2: 10W in idle at full brightness (no effect) processor.max_cstate=2: 12.6W in idle at full brightness
So it seems plausible that this issue is related to Coreboot not (properly?) supporting C3/C4. So this is a known issue then? If yes, imho it should be *definitely* documented on the wiki page since it could be a "showstopper" for many adopters who need the maximum battery life the X200 is able to deliver only with the vendor BIOS at this point in time ...
Well, let's see what we got: o 10.0W with "cpu power management" o 12.6W with "cpu power management" but max_cstate=2 o 12.8W without "cpu power management" FWIW, C2 usually saves more power. So I wonder how good your measuring at the wall plug works. Another easy option to measure the power consumption is looking at what the battery reports (usually /sys/class/power_supply/BAT0/power_now).
Regarding C3/C4 support, AFAIK, we implemented it fully but it just didn't work on the system we originally ported coreboot for (Roda/RK9). The system kept resetting whenever it should enter (or maybe exit) C3, IIRC. You could give it a try on your X200 though. Whatever the issue on the RK9 was, it might be board specific.
If you want to try it, in src/mainboard/lenovo/x200/cstates.c add: { /* acpi C3 / cpu C3 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 } }, for C3 or { /* acpi C3 / cpu C4 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 } }, for C4. You can not have all of them, as ACPI only supports three C-states.
Nico
Just to add one more detail to this... From ark.intel.com: http://ark.intel.com/products/37006/Intel-Core2-Duo-Processor-P8700-3M-Cache...
Seems that this one (P8700) is variance of Core 1 Penryn, Came to existence Q4/2008, embedded support just ran out of time. The 8Y span is too large to get fixed it from INTEL resources. Back far (Y2008) PM probably was not so versatile, and it runs up to C6 state (my best guess). And One only knows how ACPI tables are implemented in legacy BIOSes for Penryn, and if these were correctly moved/ported to Coreboot.
My two cent worth (pure rhetorical) opinion. ;-)
Would be cool (facultative/optional, when opportunity strikes) if anybody does the same (measurements) for BDW-DE and/or HSW BIOSes/FSPs (much more value to newer CORE 4/CORE 5 CPUs).
Thank you, Zoran _______
On Mon, May 2, 2016 at 1:16 PM, Nico Huber nico.huber@secunet.com wrote:
On 02.05.2016 01:06, Daniel Kulesz wrote:
- disabling "cpu power management" makes the idle consumption raise to
12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
Nope, I am only comparing with highest backlight now, so it is 12.8W
versus 10.0W here. Hmmm, 2.8W... whatever that option does it confuses me.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
intel_idle.max_cstate=2: 10W in idle at full brightness (no effect) processor.max_cstate=2: 12.6W in idle at full brightness
So it seems plausible that this issue is related to Coreboot not (properly?) supporting C3/C4. So this is a known issue then? If yes, imho it should be *definitely* documented on the wiki page since it could be a "showstopper" for many adopters who need the maximum battery life the X200 is able to deliver only with the vendor BIOS at this point in time ...
Well, let's see what we got: o 10.0W with "cpu power management" o 12.6W with "cpu power management" but max_cstate=2 o 12.8W without "cpu power management" FWIW, C2 usually saves more power. So I wonder how good your measuring at the wall plug works. Another easy option to measure the power consumption is looking at what the battery reports (usually /sys/class/power_supply/BAT0/power_now).
Regarding C3/C4 support, AFAIK, we implemented it fully but it just didn't work on the system we originally ported coreboot for (Roda/RK9). The system kept resetting whenever it should enter (or maybe exit) C3, IIRC. You could give it a try on your X200 though. Whatever the issue on the RK9 was, it might be board specific.
If you want to try it, in src/mainboard/lenovo/x200/cstates.c add: { /* acpi C3 / cpu C3 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 } }, for C3 or { /* acpi C3 / cpu C4 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 } }, for C4. You can not have all of them, as ACPI only supports three C-states.
Nico
-- M. Sc. Nico Huber Senior Berater SINA-Softwareentwicklung Netzwerk- & Client-Sicherheit / Network & Client Security Division Öffentliche Auftraggeber / Public Authorities secunet Security Networks AG
Tel.: +49-201-5454-3635, Fax: +49-201-5454-1325 E-Mail: nico.huber@secunet.com Mergenthalerallee 77, 65760 Eschborn, Deutschland www.secunet.com ______________________________________________________________________
Sitz: Kurfürstenstraße 58, 45138 Essen, Deutschland Amtsgericht Essen HRB 13615 Vorstand: Dr. Rainer Baumgart (Vors.), Thomas Pleines Aufsichtsratsvorsitzender: Dr. Peter Zattler ______________________________________________________________________
-- coreboot mailing list: coreboot@coreboot.org https://www.coreboot.org/mailman/listinfo/coreboot
Hi all,
On Mon, 2 May 2016 13:16:15 +0200 Nico Huber nico.huber@secunet.com wrote:
On 02.05.2016 01:06, Daniel Kulesz wrote:
- disabling "cpu power management" makes the idle consumption raise to 12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
Nope, I am only comparing with highest backlight now, so it is 12.8W versus 10.0W here.
Hmmm, 2.8W... whatever that option does it confuses me.
Well, I assume it disables C3 and C4.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2 it should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
intel_idle.max_cstate=2: 10W in idle at full brightness (no effect) processor.max_cstate=2: 12.6W in idle at full brightness
So it seems plausible that this issue is related to Coreboot not (properly?) supporting C3/C4. So this is a known issue then? If yes, imho it should be *definitely* documented on the wiki page since it could be a "showstopper" for many adopters who need the maximum battery life the X200 is able to deliver only with the vendor BIOS at this point in time ...
Well, let's see what we got: o 10.0W with "cpu power management" o 12.6W with "cpu power management" but max_cstate=2 o 12.8W without "cpu power management" FWIW, C2 usually saves more power. So I wonder how good your measuring at the wall plug works. Another easy option to measure the power consumption is looking at what the battery reports (usually /sys/class/power_supply/BAT0/power_now).
Well sure, the power consumption is not always 100% steady so sometimes it "flakes" around 0.1 - 0.2W, depending on e.g. whether the fan is running or not or what some background processes do. So I just took the values that were reported by my external meter most of the time, and these could be slightly off.
Of course, using "power_now" would be more accurate, but I would have to take like 100 measurements and then take the median or something like that. Imho a bit too much in this case since the difference is so big that it's visible at first sight.
Regarding C3/C4 support, AFAIK, we implemented it fully but it just didn't work on the system we originally ported coreboot for (Roda/RK9). The system kept resetting whenever it should enter (or maybe exit) C3, IIRC. You could give it a try on your X200 though. Whatever the issue on the RK9 was, it might be board specific.
If you want to try it, in src/mainboard/lenovo/x200/cstates.c add: { /* acpi C3 / cpu C3 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 } }, for C3 or { /* acpi C3 / cpu C4 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 } }, for C4. You can not have all of them, as ACPI only supports three C-states.
Indeed this was a *VERY GOOD* hint! I added the line with the C4 states and idle power consumption dropped to about 11.5W running my regular OS and with Wifi on. So I again disassembled the keyboard/palmrest, removed the wifi card and did exactly the same measurements as before. And here are the results:
Benchmark results: almost like before (not crappy like with vendor BIOS!), a little worse because it probably takes a few ms for the CPU to wake up from C4 first. Stress test: >37.2W (as before)
Idle, max brightness: 10.8W (!!) Idle, lowest brightness: 7.8W (!!)
...and after running "powertop --auto-tune": Idle, max brightness: 9.9W Idle, lowest brightness: 6.9W Screen off:6.4W
Sounds stupid, but I'm really impressed now! But... is there a reason C4 is not enabled by default then? I mean, if it makes trouble, you can always disable it (at least on Linux) with the command line parameters as discussed previously. Imho, it should be at least configurable using the regular config mechanism.
@Zoran: I also have an X220 (2nd gen Core I5) on which I did not undertake any Coreboot experiments yet. But I suppose you are rather asking for much newer CPUs from the 6th and 7th generation?
Cheers, Daniel
Hi Daniel,
On 03.05.2016 00:47, Daniel Kulesz via coreboot wrote:
Hi all,
On Mon, 2 May 2016 13:16:15 +0200 Nico Huber nico.huber@secunet.com wrote:
Regarding C3/C4 support, AFAIK, we implemented it fully but it just didn't work on the system we originally ported coreboot for (Roda/RK9). The system kept resetting whenever it should enter (or maybe exit) C3, IIRC. You could give it a try on your X200 though. Whatever the issue on the RK9 was, it might be board specific.
If you want to try it, in src/mainboard/lenovo/x200/cstates.c add: { /* acpi C3 / cpu C3 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 } }, for C3 or { /* acpi C3 / cpu C4 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 } }, for C4. You can not have all of them, as ACPI only supports three C-states.
Indeed this was a *VERY GOOD* hint! I added the line with the C4 states and idle power consumption dropped to about 11.5W running my regular OS and with Wifi on. So I again disassembled the keyboard/palmrest, removed the wifi card and did exactly the same measurements as before. And here are the results:
Benchmark results: almost like before (not crappy like with vendor BIOS!), a little worse because it probably takes a few ms for the CPU to wake up from C4 first. Stress test: >37.2W (as before)
Idle, max brightness: 10.8W (!!) Idle, lowest brightness: 7.8W (!!)
...and after running "powertop --auto-tune": Idle, max brightness: 9.9W Idle, lowest brightness: 6.9W Screen off:6.4W
Very NICE!
Sounds stupid, but I'm really impressed now! But... is there a reason C4 is not enabled by default then? I mean, if it makes trouble, you can always disable it (at least on Linux) with the command line parameters as discussed previously. Imho, it should be at least configurable using the regular config mechanism.
I guess, just nobody tried it before on a ThinkPad. The entries for C1/C2 are most probably copy-pasted from Roda/RK9. Thanks for testing this through! If you don't want to go further (https://coreboot.org/Git) somebody else will likely write a patch ;)
Nico
Sounds stupid, but I'm really impressed now! But... is there a reason C4 is not enabled by default then? I mean, if it makes trouble, you can always disable it (at least on Linux) with the command line parameters as discussed previously. Imho, it should be at least configurable using the regular config mechanism.
I guess, just nobody tried it before on a ThinkPad. The entries for C1/C2 are most probably copy-pasted from Roda/RK9. Thanks for testing this through! If you don't want to go further (https://coreboot.org/Git) somebody else will likely write a patch ;)
Okay, but that's strange, because e.g. my X60 supports C4 although it also seems to consume way too much power. Will have to investigate that as well. I also have this other X200 with P8600 and CCFL backlight, but one can assume that the patch will work there as well. But if I find the time I can test it there as well if nobody else wants to do that. I assume once it gets in git, we will automatically get more testers anyways. ;-)
And yes, I can submit the patch but not today, it's already 1:40am over here.
Cheers, Daniel
@Zoran: I also have an X220 (2nd gen Core I5) on which I did not
undertake any Coreboot experiments yet. But I
suppose you are rather asking for much newer CPUs from the 6th and 7th
generation?
Cheers, Daniel
Hello Daniel,
Second generation CORE is SNB. CPUID something like 0x20xyz. CORE 2nd gen. was released Y2011. Third generation CORE is IVB. CPUID something like 0x30xyz. Core 3rd gen. was released Y2012.
What I am talking/pointing ot about is the following: *Fourth generation CORE is HSW. CPUID something like 0x40651 (i5 4300U) - HP 840 G1 - one of my laptops. Released Y2013.* *Sixth generation CORE is SKL. CPUID something like 0x606E3 (i5 6200U) - HP 450 G3 - another of my laptops. Released Y2015.*
4th (HSW-U) and 6th (SKL-U) generations of CPUs in laptops: these are ones I am talking about/pointing to (don't think CORE 5th gen. is important).
Sorry I am late with Re:.
Thank you, Zoran _______
On Tue, May 3, 2016 at 12:47 AM, Daniel Kulesz via coreboot < coreboot@coreboot.org> wrote:
Hi all,
On Mon, 2 May 2016 13:16:15 +0200 Nico Huber nico.huber@secunet.com wrote:
On 02.05.2016 01:06, Daniel Kulesz wrote:
- disabling "cpu power management" makes the idle consumption raise
to 12,8W
Is this 12.8W compared to 7.5W (i.e. with lowest backlight)?
Nope, I am only comparing with highest backlight now, so it is 12.8W
versus 10.0W here.
Hmmm, 2.8W... whatever that option does it confuses me.
Well, I assume it disables C3 and C4.
Any ideas which could solve this mystery?
One more thing you can test, in case your Linux uses the intel_idle driver: There is a kernel parameter intel_idle.max_cstate, if you boot the vendor BIOS with defaults and Linux with intel_idle.max_cstate=2
it
should use C1/C2 but not C3/C4 and thus behave more like coreboot.
Okay. I was just aware of the generic "processor.max_cstate=2" parameter. I tried with both parameters using the vendor BIOS and here are the results:
intel_idle.max_cstate=2: 10W in idle at full brightness (no effect) processor.max_cstate=2: 12.6W in idle at full brightness
So it seems plausible that this issue is related to Coreboot not (properly?) supporting C3/C4. So this is a known issue then? If yes, imho it should be *definitely* documented on the wiki page since it could be a "showstopper" for many adopters who need the maximum battery life the X200 is able to deliver only with the vendor BIOS at this
point
in time ...
Well, let's see what we got: o 10.0W with "cpu power management" o 12.6W with "cpu power management" but max_cstate=2 o 12.8W without "cpu power management" FWIW, C2 usually saves more power. So I wonder how good your measuring at the wall plug works. Another easy option to measure the power consumption is looking at what the battery reports (usually /sys/class/power_supply/BAT0/power_now).
Well sure, the power consumption is not always 100% steady so sometimes it "flakes" around 0.1 - 0.2W, depending on e.g. whether the fan is running or not or what some background processes do. So I just took the values that were reported by my external meter most of the time, and these could be slightly off.
Of course, using "power_now" would be more accurate, but I would have to take like 100 measurements and then take the median or something like that. Imho a bit too much in this case since the difference is so big that it's visible at first sight.
Regarding C3/C4 support, AFAIK, we implemented it fully but it just didn't work on the system we originally ported coreboot for (Roda/RK9). The system kept resetting whenever it should enter (or maybe exit) C3, IIRC. You could give it a try on your X200 though. Whatever the issue on the RK9 was, it might be board specific.
If you want to try it, in src/mainboard/lenovo/x200/cstates.c add: { /* acpi C3 / cpu C3 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 } }, for C3 or { /* acpi C3 / cpu C4 */ 3, 0x02, 300, { ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x30, 0 } }, for C4. You can not have all of them, as ACPI only supports three C-states.
Indeed this was a *VERY GOOD* hint! I added the line with the C4 states and idle power consumption dropped to about 11.5W running my regular OS and with Wifi on. So I again disassembled the keyboard/palmrest, removed the wifi card and did exactly the same measurements as before. And here are the results:
Benchmark results: almost like before (not crappy like with vendor BIOS!), a little worse because it probably takes a few ms for the CPU to wake up from C4 first. Stress test: >37.2W (as before)
Idle, max brightness: 10.8W (!!) Idle, lowest brightness: 7.8W (!!)
...and after running "powertop --auto-tune": Idle, max brightness: 9.9W Idle, lowest brightness: 6.9W Screen off:6.4W
Sounds stupid, but I'm really impressed now! But... is there a reason C4 is not enabled by default then? I mean, if it makes trouble, you can always disable it (at least on Linux) with the command line parameters as discussed previously. Imho, it should be at least configurable using the regular config mechanism.
@Zoran: I also have an X220 (2nd gen Core I5) on which I did not undertake any Coreboot experiments yet. But I suppose you are rather asking for much newer CPUs from the 6th and 7th generation?
Cheers, Daniel
-- coreboot mailing list: coreboot@coreboot.org https://www.coreboot.org/mailman/listinfo/coreboot