[ltp] Re: Periodic freeze

John Magolske linux-thinkpad@linux-thinkpad.org
Wed, 25 Jul 2012 23:16:13 -0700


* Rolf Kutz <rk@vzsze.de> [120723 22:51]:
> On 19/07/12 14:46 -0700, John Magolske wrote:
> > After installing the liquorix kernel (optimized for the desktop and
> > touted as providing snappier performance) I'm still experiencing
> > these multi-second freezes. Even tried launching vim & mpd like so:
> >
> >   schedtool -R -p1 -n -19 -e vim
> 
> Does this also happen with vim -n? 

I'm now experimenting with vim -n to turn off Vim's swap file -- it
does seem to cut down on some of the smaller ~250ms hangups...hard
to tell for sure. But the large multi-second freezes appear to be
attributable to the hard drive spinning down:

> Does you HDD spin down from time to time? (Do you use Laptop Mode or
> similar?)

I use laptop-mode, and recently edited laptop-mode.conf changing this:

  BATT_HD_POWERMGMT=1

to this:

  BATT_HD_POWERMGMT=254

which improved things. But since then, I set CONTROL_HD_POWERMGMT="0",
thinking that would stop laptop-mode from messing with the hard-drive
altogether. Per /etc/laptop-mode/laptop-mode.conf :

  # Should laptop mode tools control the hard drive power management settings?
  # Set to 0 to disable
  #CONTROL_HD_POWERMGMT="auto"
  CONTROL_HD_POWERMGMT="0"

But after setting that to "0" I found something else was spinning down
the hard-drive on a regular basis while running on battery (but not
while plugged into AC)... not sure what could be doing that. I didn't
notice this right away as I'm typically on a noisy train listening to
headphones when running on battery power. Sitting quietly one evening
I heard the disk regularly spinning down. And quite often when it spun
up, the whole system would freeze for a few seconds. So I found that
to have a useably responsive machine while running on battery power
the disk *must* remain spinning at all times, and these settings in
laptop-mode.conf are required:

  CONTROL_HD_POWERMGMT="1"
  # Power management for HD (hdparm -B values)
  BATT_HD_POWERMGMT=254
  LM_AC_HD_POWERMGMT=254
  NOLM_AC_HD_POWERMGMT=254

Now it seems as though now things are equally responsive while running
on battery and AC mains. There are a few ~250ms hiccups now & then,
but I *think* that's been alleviated (but not entirely eliminated) by
using vim -n ... will have to see how well that works over time. Oh,
and I haven't noticed any dropouts in the audio for a couple days now.

One other aside... something I've always noticed about this X200s
is that when it's running on battery and I then plug in the AC-DC
converter, the whole machine freezes for a full 10 seconds while it
digests the reality that it's shifted from battery to AC. My older
X40 had no need to ponder the change of power state to that extent.
Anyhow, not sure if that's relevant to the issues discussed here, just
wondering if there's something about this laptop that makes it want
to stop whatever it's doing for a while when there's a change in it's
physical state. Like when the hard drive spins up. Or maybe the hard
drive spin-up pause has entirely to do with disk access and something
needing to be written to disk before anything else can happen. Just
thought I'd pass that along.

> Does your system swap a lot?

Since I'm rarely using more than 500MB of memory (maybe ~1GB max) and
this machine has 3GB of RAM installed, I didn't bother setting up a
swap partition & turning on swap. I had vm.swappiness=5, just now set
it to 0. Could any of this be interacting with the freezing behavior?

John

-- 
John Magolske
http://B79.net/contact