# 2.6.35 hangs in disk-sleep mode [solved]

## mv

Since upgrading to 2.6.35, there is a strange problem:

Only booting and shutting down works nicely, but when working for a while, some proces (usually "kdm" and its direct child ":0" but also some others like "metalog") go into "D" state, and even kill -9 will not kill them.

The main problem occurs after "shutdown -h now": It hangs at "Deactivating swap devices". After "Magick-SysRQ e" there is some messages printed containing "scsi 0:0:0:0: ..." (or something similar; it vanishes too quickly to read) and then the computer is shut off.

Logs contain nothing strange.

I exclude a disk problem, since this happens on several machines; it also happens on an x86 and amd64 kernel with somewhat different configurations.

With 2.6.34 there is no such problem.

Has anybody made similar experiences? I am rather surprised that here it happens on several systems (and since several minor 2.6.35 versions) but nobody else in the web seems to have this problem...

Unfortunately, I cannot easily test something, since it takes some times until it happens and in this sense is not very reproducable: Only after some hours of working with the machine, I can make a guess whether some experiment was successful, and a failure means a very unclean shutdown...Last edited by mv on Sun Oct 17, 2010 5:33 pm; edited 1 time in total

----------

## Grimmlin

Hi,

I'm glad too that someone else is having the same problem as me.

For me it happens when swap is used. I'm running hardened tests in a VM and when recompiling gcc with less than 2gigs of ram, it will swap and emerge will hang after src_compile.

I posted the infos there: https://bugs.gentoo.org/show_bug.cgi?id=336628 but I'm not sure if it's related.

It's definitely coming from swap usage for me as running with 2gigs and no swap the host has been up and running fine under reasonable load:

15:13:19 up 15:26,  3 users,  load average: 1.98, 1.73, 1.68

What's your host hardware setup ?

----------

## mv

Since it dies on umounting the swap partition, it was also my guess that it is related with swap. However, e.g. compiling (which sometimes needs a lot of swap on my systems) did never hang so far: Except for login and logging processes, normal usage is possible. I suspected confcache/ramzswap as the culprit, but the same problem occurs with a kernel without any staging driver.

On one of my machines, I have a Pentium Dual Core with 64bit kernel with ICH7 Motherboard (same problem with 32bit kernel) and 2G RAM, on another machine an AMD-Athlon (K7, 32bit) 512MB RAM, don't remember the motherboard in the moment.

----------

## Grimmlin

I checked the changelog of linux-next and found the issue I'm having:

http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=4e31635c367a9e21a43cfbfae4c9deda2e19d1f4

however, applying it on top of 2.6.35 doesn't fix the issue for me. Hopefully one of my friend will be able to tackle it down.

I'm doing tests on low memory VM with ~384Mb so it fails quickly.

----------

## Grimmlin

btw, it seems resolved when turning off KSM:

```

Symbol: KSM [=y]

  ¦ Prompt: Enable KSM for page merging

  ¦   Defined at mm/Kconfig:226

  ¦   Depends on: MMU [=y]

  ¦   Location:

  ¦     -> Processor type and features

```

My test host is swapping like hell and I haven't had any issues so far.

----------

## mv

Thanks a lot for the informatin.

I had not much time for testing, today, but in the moment, deselecting KSM seems to do the trick. This is even more surprising, since I never activated this feature: cat /sys/kernel/mm/ksm gave the output "0"

----------

## mv

Marked thread as solved: After deselecting KSM the hangs did not occur anymore.

----------

