[laptop-mode] READAHEAD setting is doubled

Bart Samwel bart at samwel.tk
Sun Jul 13 23:53:45 CEST 2008


Hi Joss,

Joss Winn wrote:
> hdparm -I /dev/sda shows power management to be set to 254, but my HDD
> is still spinning down every few seconds. I was wondering if it was
> related to the read-ahead settings.
> 
> In laptop-mode.conf, I have:
> 
> CONTROL_READAHEAD=1
> LM_READAHEAD=3072
> NOLM_READAHEAD=128
> 
> However, when I run hdparm /dev/sda I get:
> 
> readahead     = 6144 (on)
> 
> Which is exactly double the laptop-mode setting.
> 
> If I change the laptop-mode setting, then sure enough the new hdparm
> reading is double whatever the new setting is.
> 
> Why is this?

Very simple: the laptop-mode-tools config value is in kilobytes, while
hdparm configures these things in sectors of 512 bytes each. :-)

> Also, I wondered whether reducing the readahead settings might alter
> the freezing I'm getting (see earlier post) when unplugging AC, but
> this is not the case.

Nah, that's not it. It seems like your laptop is kind of unplugging and
re-plugging all its cores when going on battery, like it's doing some
kind of semi-suspend or a scheduler switch or something like that. No
clue what would cause that though -- laptop-mode-tools only controls the
CPU frequency scaling governor, but does nothing with the scheduler...

Cheers,
Bart


More information about the laptop-mode mailing list