[SOLVED] Unable to suspend or hibernate with a 4.4.0 kernel.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Unable to suspend or hibernate with a 4.4.0 kernel.
I compiled a 4.4.0 kernel using the oldconfig from the generic 4.1.5 kernel using largely default options and then removing some hardware specific stuff I don't need. However now I can't use pm-suspend or pm-hibernate, it tries to suspend/hibernate and then resumes when its not able to. Any pointers on how to debug this? I have attached my kernel config at a .txt file in case this is my own doing.
This was not present on the 4.3.3 kernel release.
syslog
Code:
Jan 12 05:01:36 Linux kernel: [ 646.351808] Freezing of tasks failed after 20.008
seconds (3 tasks refusing to freeze, wq_busy=0):
Jan 12 05:01:36 Linux kernel: [ 646.351837] ffff8800ce53be08 ffffffff819af4c0 ff
ff8800ca490c40 0000000000000000
Jan 12 05:01:36 Linux kernel: [ 646.351842] ffff8800ca490c40 ffff8800ce53c000 ff
ff8800ca490c40 ffffffff81350990
Jan 12 05:01:36 Linux kernel: [ 646.351847] ffff8802224d5c80 0000000000000000 ff
ff8800ce53be20 ffffffff8174752c
Jan 12 05:01:36 Linux kernel: [ 646.351852] Call Trace:
Jan 12 05:01:36 Linux kernel: [ 646.351863] [<ffffffff81350990>] ? xfs_trans_ail
_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351869] [<ffffffff8174752c>] schedule+0x3c/0
x90
Jan 12 05:01:36 Linux kernel: [ 646.351873] [<ffffffff81350fe0>] xfsaild+0x650/0
x680
Jan 12 05:01:36 Linux kernel: [ 646.351878] [<ffffffff81746d17>] ? __schedule+0x
327/0xb00
Jan 12 05:01:36 Linux kernel: [ 646.351882] [<ffffffff81350990>] ? xfs_trans_ail
_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351886] [<ffffffff81350990>] ? xfs_trans_ail
_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351892] [<ffffffff810a3a39>] kthread+0xc9/0x
e0
Jan 12 05:01:36 Linux kernel: [ 646.351896] [<ffffffff810a3970>] ? kthread_worke
r_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.351901] [<ffffffff8174b76f>] ret_from_fork+0x3f/0x70
Jan 12 05:01:36 Linux kernel: [ 646.351905] [<ffffffff810a3970>] ? kthread_worker_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.351915] ffff8800c8c13e08 ffff8802259f9880 ffff8802241b3100 ffff8800cd988990
Jan 12 05:01:36 Linux kernel: [ 646.351920] 0000000000000000 ffff8800c8c14000 ffff8802241b3100 ffffffff81350990
Jan 12 05:01:36 Linux kernel: [ 646.351931] ffff8800cd988980 0000000000000000 ffff8800c8c13e20 ffffffff8174752c
Jan 12 05:01:36 Linux kernel: [ 646.351936] Call Trace:
Jan 12 05:01:36 Linux kernel: [ 646.351940] [<ffffffff81350990>] ? xfs_trans_ail_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351944] [<ffffffff8174752c>] schedule+0x3c/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351948] [<ffffffff81350fe0>] xfsaild+0x650/0x680
Jan 12 05:01:36 Linux kernel: [ 646.351952] [<ffffffff81746d17>] ? __schedule+0x327/0xb00
Jan 12 05:01:36 Linux kernel: [ 646.351956] [<ffffffff81350990>] ? xfs_trans_ail_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351960] [<ffffffff81350990>] ? xfs_trans_ail_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.351964] [<ffffffff810a3a39>] kthread+0xc9/0xe0
Jan 12 05:01:36 Linux kernel: [ 646.351968] [<ffffffff810a3970>] ? kthread_worker_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.351973] [<ffffffff8174b76f>] ret_from_fork+0x3f/0x70
Jan 12 05:01:36 Linux kernel: [ 646.351977] [<ffffffff810a3970>] ? kthread_worker_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.351986] ffff8800c8c37e08 ffff8802259f8000 ffff8802241b4980 ffff8800c8c34000
Jan 12 05:01:36 Linux kernel: [ 646.351990] ffff8802241b4980 ffff8800c8c38000 ffff8802241b4980 0000000000000000
Jan 12 05:01:36 Linux kernel: [ 646.351995] ffff8802224d5880 ffff8800ca5d6800 ffff8800c8c37e20 ffffffff8174752c
Jan 12 05:01:36 Linux kernel: [ 646.351999] Call Trace:
Jan 12 05:01:36 Linux kernel: [ 646.352003] [<ffffffff8174752c>] schedule+0x3c/0x90
Jan 12 05:01:36 Linux kernel: [ 646.352007] [<ffffffff81350fe0>] xfsaild+0x650/0x680
Jan 12 05:01:36 Linux kernel: [ 646.352011] [<ffffffff81350990>] ? xfs_trans_ail_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.352015] [<ffffffff81350990>] ? xfs_trans_ail_cursor_first+0x90/0x90
Jan 12 05:01:36 Linux kernel: [ 646.352025] [<ffffffff810a3a39>] kthread+0xc9/0xe0
Jan 12 05:01:36 Linux kernel: [ 646.352027] [<ffffffff810a3970>] ? kthread_worker_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.352028] [<ffffffff8174b76f>] ret_from_fork+0x3f/0x70
Jan 12 05:01:36 Linux kernel: [ 646.352030] [<ffffffff810a3970>] ? kthread_worker_fn+0x170/0x170
Jan 12 05:01:36 Linux kernel: [ 646.352041]
Code:
$ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B) (rev 02)
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B)
00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port H)
00:0a.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx1 port A)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)
00:15.2 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB900 PCI to PCI bridge (PCIE port 2)
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
01:00.0 VGA compatible controller: NVIDIA Corporation GK110B [GeForce GTX 780 Ti] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK110 HDMI Audio (rev a1)
02:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)
03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 12)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
06:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 12)
check_suspend() { [ -n "$SUSPEND_MODULE" ]; }
check_hibernate() { [ -n "$HIBERNATE_MODULE" ]; }
check_suspend_hybrid() { [ -n "$SUSPEND_HYBRID_MODULE" ]; }
# allow autodetection of sleep methods
if [ "$SLEEP_MODULE" = "auto" ]; then
SLEEP_MODULE="tuxonice uswsusp"
fi
for mod in $SLEEP_MODULE; do
mod="${PM_UTILS_LIBDIR}/module.d/${mod}"
[ -f "$mod" ] || continue
. "$mod"
done
# always fall back to kernel methods if nothing else was declared
if [ -z "$SUSPEND_MODULE" ]; then
if grep -q mem /sys/power/state; then
SUSPEND_MODULE="kernel"
do_suspend() { echo -n "mem" >/sys/power/state; } ####### Line 301
elif [ -c /dev/pmu ] && pm-pmu --check; then
SUSPEND_MODULE="kernel"
do_suspend() { pm-pmu --suspend; }
elif grep -q standby /sys/power/state; then
SUSPEND_MODULE="kernel"
do_suspend() { echo -n "standby" >/sys/power/state; }
fi
fi
if [ -z "$HIBERNATE_MODULE" ] && \n [ -f /sys/power/disk ] && \n grep -q disk /sys/power/state; then
HIBERNATE_MODULE="kernel"
do_hibernate()
{
[ -n "${HIBERNATE_MODE}" ] && \n grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \n HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \n HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \n HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \n echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
RET=$?
echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
return "$RET"
}
fi
# for kernels that support suspend to both (i.e. hybrid suspend)
# since kernel 3.6
if [ -z "$SUSPEND_HYBRID_MODULE" ] && \n [ -f /sys/power/disk ] && \n grep -q disk /sys/power/state && \n grep -q suspend /sys/power/disk; then
SUSPEND_HYBRID_MODULE="kernel"
do_suspend_hybrid()
{
HIBERNATE_MODE="suspend"
do_hibernate
}
fi
# since the kernel does not directly support hybrid sleep, we do
# something else -- suspend and schedule an alarm to go into
# hibernate if we have slept long enough.
# Only do this if we do not need to do any special video hackery on resume
# from hibernate, though.
if [ -z "$SUSPEND_HYBRID_MODULE" -a -w "$PM_RTC/wakealarm" ] && \n check_suspend && check_hibernate && ! is_set $HIBERNATE_RESUME_POST_VIDEO; \n then
SUSPEND_HYBRID_MODULE="kernel"
do_suspend_hybrid() {
WAKETIME=$(( $(cat "$PM_RTC/since_epoch") + PM_HIBERNATE_DELAY))
echo >"$PM_RTC/wakealarm"
echo $WAKETIME > "$PM_RTC/wakealarm"
if do_suspend; then
NOW=$(cat "$PM_RTC/since_epoch")
if [ "$NOW" -ge "$WAKETIME" -a "$NOW" -lt $((WAKETIME + 30)) ]; then
log "Woken by RTC alarm, hibernating."
# if hibernate fails for any reason, go back to suspend.
do_hibernate || do_suspend
else
echo > "$PM_RTC/wakealarm"
fi
else
# if we cannot suspend, just try to hibernate.
do_hibernate
fi
}
fi
Well here are those three partitions. I'll see if I can find someone with xfs experience to ask since I'm not really sure either. I haven't had much luck with a search engine.
I found the patch associated with the commit (24ba16b) that seems responsible according to the xfs list, reversed it and then rebuilt the kernel. Suspend now works again so I will mark this thread as solved.
Code:
patch -p1 -R < path/xfs_trans_ail.c.diff
Code:
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 1098cf4..06d1a29 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -497,6 +497,7 @@ xfsaild(
long tout = 0; /* milliseconds */
current->flags |= PF_MEMALLOC;
+ set_freezable();
while (!kthread_should_stop()) {
if (tout && tout <= 20)
Better link to the xfs mail list thread (with links to navigate the thread instead of gmane's terrible interface): http://oss.sgi.com/pipermail/xfs/201...ry/045864.html
I'll try to keep an eye on it, and we'll just hope that 4.4.1 will have a fix.
According to the xfs devs that patch should not work and I wouldn't trust any code from Jiri at all at this point given how he is entirely non-responsive for issues he introduced himself.
Does reversing the initial broken patch still fix it?
Edit:
Code:
> Well, clearly the thread is sleeping in schedule() during the freezing
> operation and it's supposed to be doing so; therefore it doesn't need
> explicit freezing point, right?
No.
It's sleeping in schedule because it's got nothing more to do - it's
issued all it's IO and is idle. It is not going to run again until
filesystem modification activity is restarted.
But if the AIL still has objects in it (like it will after a sync),
then it will continue to run and issue IO until it returns to the
empty, idle state. In this active state, we need to freeze the
thread on suspend so that it doesn't keep issuing IO all through the
suspend process...
> So the proper fix would rather be something like
>
>
>
> From: Jiri Kosina <jkosina at suse.cz>
> Subject: [PATCH] xfs: xfsaild doesn't need to be freezable
No, that just means we guarantee that there will be suspend image
coherency problems when suspend is run on a busy filesystem...
This process is not going to enter a runable state, so is never
going to enter the freezer. But we can't be certain of that,
because we haven't frozen the filesystem and hence it can still be
modified and this thread could be woken and do stuff when it
shouldn't.
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
I asked in #xfs @ freenode and reverting the patch is in xfs tree for-next so it should be fixed in the kernel. It should have the same effect as manually reversing the patch as explained above.
Code:
cc: <stable@vger.kernel.org> # 4.4
Signed-off-by: Dave Chinner <david@fromorbit.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/xfs_trans_ail.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index aa67339..4f18fd9 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -497,7 +497,6 @@ xfsaild(
long tout = 0; /* milliseconds */
current->flags |= PF_MEMALLOC;
- set_freezable();
while (!kthread_should_stop()) {
if (tout && tout <= 20)
--
cgit v0.12
There is also supposedly a proper fix from a different suse dev, however its not in the xfs tree and I'm not sure why yet, I have not personally tested it.
Code:
Reported-by: Hendrik Woltersdorf <hendrikw@xxxxxxxx>
Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
---
fs/xfs/xfs_trans_ail.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index aa67339b9537..d6c9c3e9e02b 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -520,14 +520,14 @@ xfsaild(
if (!xfs_ail_min(ailp) &&
ailp->xa_target == ailp->xa_target_prev) {
spin_unlock(&ailp->xa_lock);
- schedule();
+ freezable_schedule();
tout = 0;
continue;
}
spin_unlock(&ailp->xa_lock);
if (tout)
- schedule_timeout(msecs_to_jiffies(tout));
+ freezable_schedule_timeout(msecs_to_jiffies(tout));
__set_current_state(TASK_RUNNING);
--
2.7.0.rc3
--
Michal Hocko
SUSE Labs
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.