# Best kernel/kernel sources for a laptop?

## Budoka

Can anyone recommend the best kernel or kernel sources optimized for a laptop?

To date I have been using the Gentoo-sources but always have battery life and overheating issues.

I see there is Pappy's Kernel Seeds. Also the option of using the latest stable kernel from kernel.org or one of the many sources available in portage but I can't get a handle on if any are already tweaked for a laptop.

----------

## khayyam

Budoka ...

It depends mostly on what features you want/need (ie, Con Kolivas' BFS, TuxOnIce, etc) sometimes these are not included in the same sources so the choice may be limited to what you're prepared to accept from the package and/or patch yourself. Then there is the issue of what is enabled/disabled in that kernel (which is where kernel-seeds comes in).

For a laptop I'd recommend ck-sources, but again its somewhat dependent on what your needs are.

best ... khay

----------

## cwr

I'd be inclined to use a gentoo-sources kernel and configure it carefully.  I doubt you'll get better (or even different) results from other kernel sources.

Will

----------

## khayyam

 *cwr wrote:*   

> I'd be inclined to use a gentoo-sources kernel and configure it carefully.  I doubt you'll get better (or even different) results from other kernel sources.

 

Will ... I wouldn't say that is the case, the use of BFS (ck-sources) in place of the default scheduler will IME improve interactive use for the desktop.

best ... khay

----------

## Nicias

I've actually wondered this as well. I've been using tuxonice-sources, but I find it frustrating to have to manually pick which version to use. It seems like tuxonice kernels never move out of ~amd64. 

How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?

----------

## szatox

 *Quote:*   

> How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?

  Suspend works fine on my box, never tried hibernation since I don't have swap there. On laptop it worked, then didn't work, then worked again....  

With current kernel suspend works fine (wake-up hotkey is a bit weird though, Fn+power rater than either of those)

hibernation seems broken (it does not resume). I find it funny, as with debian it used to be the other way (hibernation was working fine, but I couldn't resume from suspend)

Also, MAYBE I could make it work if I tried. I haven't tried in gentoo.

I guess you should just get that kernel and try it yourself.

----------

## khayyam

 *Nicias wrote:*   

> I've actually wondered this as well. I've been using tuxonice-sources, but I find it frustrating to have to manually pick which version to use. It seems like tuxonice kernels never move out of ~amd64. 

 

Nicias ... you can use any kernel and apply the upstream patch.

 *Nicias wrote:*   

> How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?

 

Well, you wouldn't be using TuxOnIce ... which imo is better than the in kernel implimentation.

best ... khay

----------

## Tractor Girl

 *Budoka wrote:*   

> 
> 
> To date I have been using the Gentoo-sources but always have battery life and overheating issues.
> 
> 

 

What laptop is it? Does it have hybrid graphic? Please show:

```
lspci | grep -i vga
```

Also what is your default cpu scaling governor?

```
zgrep -i cpu_freq_default /proc/config.gz
```

----------

## Budoka

 *Tractor Girl wrote:*   

>  *Budoka wrote:*   
> 
> To date I have been using the Gentoo-sources but always have battery life and overheating issues.
> 
>  
> ...

 

 *Quote:*   

> # lspci | grep -i vga
> 
> 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
> 
> 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series]
> ...

 

 *Quote:*   

> # zgrep -i cpu_freq_default /proc/config.gz
> 
> # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
> 
> CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
> ...

 

 *Quote:*   

> # lspci -v |wgetpaste
> 
> Your paste can be seen here: http://bpaste.net/show/412154/
> 
> 

 

----------

## Tractor Girl

So it is hybrid graphic laptop. 

Please show:

```
uname -a
```

```
cat /sys/kernel/debug/vgaswitcheroo/switch
```

----------

## jimmij

 *szatox wrote:*   

>  *Quote:*   How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?  Suspend works fine on my box, never tried hibernation since I don't have swap there. On laptop it worked, then didn't work, then worked again....  
> 
> With current kernel suspend works fine (wake-up hotkey is a bit weird though, Fn+power rater than either of those)
> 
> hibernation seems broken (it does not resume)

 

Both suspend and hibernation works fine in my case with gentoo-sources or vanilla-sources.

Please note however that in kernel .config you need to set swap partition from which resume should take place:

```
-> Power management and ACPI options

        (/dev/sda8) Default resume partition
```

----------

## Nicias

 *jimmij wrote:*   

>  *szatox wrote:*    *Quote:*   How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?  Suspend works fine on my box, never tried hibernation since I don't have swap there. On laptop it worked, then didn't work, then worked again....  
> 
> With current kernel suspend works fine (wake-up hotkey is a bit weird though, Fn+power rater than either of those)
> 
> hibernation seems broken (it does not resume) 
> ...

 

Can you resume from a swapfile?

----------

## jimmij

 *Nicias wrote:*   

>  *jimmij wrote:*    *szatox wrote:*    *Quote:*   How much of suspend-to-{ram/disk} functionality would I lose if I switched to gentoo-sources?  Suspend works fine on my box, never tried hibernation since I don't have swap there. On laptop it worked, then didn't work, then worked again....  
> 
> With current kernel suspend works fine (wake-up hotkey is a bit weird though, Fn+power rater than either of those)
> 
> hibernation seems broken (it does not resume) 
> ...

 

I have never tried, but don't see a reason why this shouldn't work.

In /usr/src/linux/Documentation/power/swsusp-and-swap-files.txt we read:

```
The Linux kernel handles swap files almost in the same way as it handles swap

partitions...
```

----------

## Budoka

 *Tractor Girl wrote:*   

> So it is hybrid graphic laptop. 
> 
> Please show:
> 
> ```
> ...

 

 *Quote:*   

> $ uname -a
> 
> Linux TL_Samsung 3.12.21-gentoo-r1 #1 SMP Thu Jun 19 15:12:46 JST 2014 x86_64 Intel(R) Core(TM) i7-2675QM CPU @ 2.20GHz GenuineIntel GNU/Linux
> 
> 

 

I don't seem to have  *Quote:*   

> sys/kernel/debug/vgaswitcheroo/

  on my system.

Thanks

----------

## Tractor Girl

 *Budoka wrote:*   

> 
> 
> I don't seem to have  *Quote:*   sys/kernel/debug/vgaswitcheroo/  on my system.

 

Please post:

```
zgrep -i switcheroo /proc/config.gz
```

```
lsmod
```

```
mount | grep debug
```

----------

## Budoka

 *Tractor Girl wrote:*   

>  *Budoka wrote:*   
> 
> I don't seem to have  *Quote:*   sys/kernel/debug/vgaswitcheroo/  on my system. 
> 
> Please post:
> ...

 

Hi. Sorry for the delay. I actually replied when you initially responded but just noticed it didn't save. Not sure why. Anyway...

 *Quote:*   

> $ zgrep -i switcheroo /proc/config.gz
> 
> # CONFIG_VGA_SWITCHEROO is not set
> 
> 

 

I guess this means I should go back and recompile my kernel with this option?

 *Quote:*   

> $ lsmod |wgetpaste
> 
> Your paste can be seen here:[url] http://bpaste.net/show/461006/[/url]
> 
> 

 

$ mount | grep debug

debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)

----------

## lordalbert

vgaswitcheroo is for switch between discrete and integrated video card.  Poweroff ati card, will increase battery life.

You need to compile the kernel with that option, install opensource ati driver (radeon) and install linux-firmware in order to have /sys/kernel/debug/vgaswitcheroo/switch file

----------

## Budoka

 *lordalbert wrote:*   

> vgaswitcheroo is for switch between discrete and integrated video card.  Poweroff ati card, will increase battery life.
> 
> You need to compile the kernel with that option, install opensource ati driver (radeon) and install linux-firmware in order to have /sys/kernel/debug/vgaswitcheroo/switch file

 

I'll give it a shot and report back. Thanks.

But can you tell me how to poweroff ATI Card? And What do I lose if i do so?

----------

## lordalbert

Here a description how to use vgaswitcheroo: https://help.ubuntu.com/community/HybridGraphics

In disabling discrete card, you can't play some games, and don't know other limits... In my use (internet, programming, office) i have not problems or limitations...

----------

