Bug 235

Summary: enable more kernel options to make PowerTop work better
Product: [Yocto Project Subprojects] Kernel Reporter: Dexuan Cui <dexuan.cui>
Component: kernel-toolingAssignee: Joshua Lock - Disabled <josh>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bruce.ashfield, jessica.zhang, kevin.tian, richard.purdie, sgw, yp.watcher
Version: 0.9   
Target Milestone: 0.9 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---
Attachments:
Description Flags
Add profiling KConfig options, particularly for Powertop
none
Increase connector size for use with v86d
none
Enable extra options for x86_64 (uvesafb and input devices) none

Description Dexuan Cui 2010-08-26 00:44:36 UTC
We'd better enable the following kernel options to make powertop work better.

(According to http://www.lesswatts.org/projects/powertop/faq.php)
CONFIG_NO_HZ
CONFIG_HIGH_RES_TIMERS
CONFIG_HPET_TIMER
CONFIG_CPU_FREQ_GOV_ONDEMAND
CONFIG_USB_SUSPEND
CONFIG_SND_AC97_POWER_SAVE
CONFIG_TIMER_STATS

Actually, after checking my tmp/work/qemux86-poky-linux/linux-wrs-2.6.34+git0+a7fd16db16aa37296d5cef8db9707cacc084131d_0+21047e447cf0f5ce6ae1a32ba8128ddbbd1c2c1e-r6/linux-common_pc-standard-build/.config, some have been enabled, like CONFIG_HIGH_RES_TIMERS, but we'd better make sure all the options are enabled.

I suppose the bug should be assigned to Bruce? :-)
Comment 1 Bruce Ashfield 2010-08-26 06:06:58 UTC
I need to implement kernel 'features' before I can 
enable these options.

I explained this in several other bugs, that the configurations
that are on by default are the embedded versions. Which means
that all non-essential configs are disabled on purpose. The ones
below are an example of being disabled on purpose.

I'm creating some debug/profiling kernel features that will
enable these options on demand.
Comment 2 Richard Purdie 2010-08-26 08:31:57 UTC
We need to see how much of this is related to http://bugzilla.pokylinux.org/show_bug.cgi?id=233 and for the options that are not covered, add some appends to the kernel defconfigs as you've done previously which we ultimately pass back to Bruce for integration upstream once we have the complete list.
Comment 3 Joshua Lock - Disabled 2010-09-01 09:39:53 UTC
For x86 and x86_64 kernel defconfigs only CONFIG_SND_AC97_POWER_SAVE is unset but considering we don't have any SND_AC97 options that seems OK.

For Arm, Mips and PPC I've created config fragments to enable the required options.

The change isn't in master but you can view it here:
http://git.pokylinux.org/?p=poky-contrib.git;a=commitdiff;h=6c510b178751dd321fe635b1659926d640f986fe
Comment 4 Bruce Ashfield 2010-09-01 09:47:00 UTC
The changes themselves look ok. I'll review them in more detail
later. 

But they definitely can't merge as is. The default kernel options
need to be pulled into the tree and not left as external fragments
with updates to the Linux recipe.

We have 80 or 90 of these pending, and it doesn't scale to list
them in the recipe, they get reviewed and merged into wrs_meta
for deployment. This allows me to make them optional, move,
re-categorize and group them for reuse as appropriate.

I can help with the creation of that pull request, since we don't 
have widespread familiarity with it.

So in summary, can we get these as a pull request against wrs_meta ?
That's the easiest way for the merge and for review.
Comment 5 Joshua Lock - Disabled 2010-09-02 10:40:12 UTC
Created attachment 35 [details]
Add profiling KConfig options, particularly for Powertop
Comment 6 Joshua Lock - Disabled 2010-09-02 10:40:43 UTC
Created attachment 36 [details]
Increase connector size for use with v86d
Comment 7 Joshua Lock - Disabled 2010-09-02 10:41:14 UTC
Created attachment 37 [details]
Enable extra options for x86_64 (uvesafb and input devices)
Comment 8 Joshua Lock - Disabled 2010-09-02 10:42:03 UTC
Bruce, I've added some patches against the wr_meta branch as I wasn't sure how you wanted the pull request and couldn't raise you on Jabber.
Comment 9 Bruce Ashfield 2010-09-02 23:04:03 UTC
Argh. Sorry about missing you on jabber. I was around, but must have missed
the notification.

The kernel config patches look good. They are against the right files, or at
least very close to, on the wrs_meta branches. The actual config file the
changes reside in, may change slightly, but that is a merge detail and not
a problem with the pull request.

The connector size patch should be against the kernel, and in particular
the common_pc_64-standard branch. Just the same way as any kernel
patch going upstream would be done. The wrs_meta is unique, but for
actual code changes, just sending them against the tip of the BSP branch
is enough. This definitely wasn't clear before, and I'll be writing this up.

So for the actual pull request. It would look just like any pull. A copy 
of the windriver-2.6 kernel repo would be pushed to a accessible 
repository and a pull issues against 2 branches (in your case), one
against wrs_meta for config changes and one against the BSP branch
for kernel code changes. The actual kernel patch may be merged down
and pushed to all BSP branches, but again, that is a property of the merge
and not something that needs to be covered in the pull request.
Comment 10 Joshua Lock - Disabled 2010-09-03 07:16:25 UTC
Great, documentation of the process would be useful.

We now have a linux-2.6-windriver-contrib tree on git.pokylinux.org to which I've posted a couple of patches and sent a merge request to you (though maybe in future we want these to a mailing list?)

Once they (or something similar) are merged I can drop the patches and cfg files from the linux-wrs recipe and we can close this bug.
Comment 11 Joshua Lock - Disabled 2010-09-06 08:19:00 UTC
Fixed in master with fea28c22f47b8e60e4e41c336950fbb4f6b1231b:

kernel/wrs: update SRCREV for v2.6.34.6 + changes

Updating the SRCREVs for the recent port of bug fixes for all boards
and the integration of qemux86-64 config and connector changes.

Now that the qemux86-64 changes are in tree, we can drop them from
the linux-wrs recipe.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Comment 12 Dexuan Cui 2010-10-20 02:04:17 UTC
Sorry for my late checking this bug.

Today I found the issue still exists on rc1 images, like
http://autobuilder.pokylinux.org/milestone/20101011/qemu/qemux86/poky-image-sdk-qemux86-20101012041801.rootfs.ext3, or http://yoctobuild01.jf.intel.com/milestone/20101018/emenlow/x86_32/poky-image-sdk-live-emenlow-20101019044452.hddimg:
after running powertop, I can see it still prints the suggestions, like

Suggestion: Enable the CONFIG_NO_HZ kernel configuration option
Suggestion: Enable the CONFIG_HPET_TIMER kernel configuration option.

We can use "cat /proc/config.gz | gunzip" to get the kernel config -- in it, e.g., I can see CONFIG_NO_HZ and CONFIG_HPET_TIMER "is not set".

So looks Joshua's fix doesn't take effect somehow? Could you please double check it?

BTW: "uname -a" shows this is a "2.6.34.7-wr-standard" kernel.
Comment 13 Bruce Ashfield 2010-10-20 06:28:29 UTC
CONFIG_NO_HZ and CONFIG_HPET_TIMER were not enabled
on purpose. NO_HZ can impact other out of the box features
in the standard kernel, and HPET_TIMER is not applicable to
many of the targets that the generic images run on, and in
embedded style, you don't enable useless options in your 
kernel.

We can probably turn on NO_HZ optionally, but it really needs
to be part of a power management addon for applicable BSPs.

Bottom line: does powertop function ? If so, these are only warnings
and this doesn't need to be addressed in 0.9.
Comment 14 Dexuan Cui 2010-10-20 17:57:14 UTC
Hi Bruce,
Thanks a lot for the clarification!
powertop does work. So I agree these messages are only trivial warnings. Let me VERIFY this bug.
Comment 15 Dexuan Cui 2010-10-20 17:58:29 UTC
powertop does work despite some trivial warnings. Let me VERIFY this bug.