XFS appears to cause strange hang with md raid1 on reboot
Dear XFS folks,
I have been using XFS for many years, starting on IRIX and then on RedHat 7.2, and now on CentOS/RHEL and Ubuntu. Last time I posted to this mailing list was 12 years ago. :-) I've been a happy customer!
I understand that RedHat does not formally support XFS as a root filesystem on RHEL. However, up until now, I've been using it very successfully for years on both CentOS and Ubuntu. On CentOS, I've successfully patched Anaconda since CentOS 5.6 to allow XFS root file system support directly from Anaconda (on both bare metal and Xen VMs). Prior to that, I had code in %post that would simply migrate an ext3 fs to XFS. And I always run md raid1 (except with Xen, since I use mirroring on the dom0). I never use hardware RAID since I want to keep my provisioning as generic as possible.
I've deployed many servers using XFS this way and it has always been superior for my workloads.... and superior to ext3, and ext4.
....until CentOS 5.9 came out. Now any systems that are running the stock CentOS 5.9 kernel (including 5.X systems upgraded to this kernel) hang on reboot. If I downgrade to the 5.8 kernel, the problem is resolved.
I have taken an engineering approach to testing this problem in efforts to help resolve it. I filed a bug with CentOS, but it's probably not going to go anywhere upstream since RedHat probably won't support XFS on the root filesystem (why I still don't understand, since I fixed the issues with Anaconda for myself and can Kickstart systems with XFS all day long).
Therefore I hope anyone here can help. In fact, I was specifically hoping to catch Eric Sandeen's attention since this seems like a pretty serious regression. It's further aggravated by the fact that RedHat stays behind with kernel version and backports modern fixes. I scanned over the 2.6.18-348.el5 (stock 5.9 kernel) changelog, and I see a few suspicious things, but I'm not sure.
Much more detail is available here (CentOS bug id 0006217) including steps to reproduce the problem. Also testing with and without md raid.
http://bugs.centos.org/view.php?id=6217
The one thing I haven't provided is a traceback. I can provide that if it would be helpful.
I am not in a big hurry for help, on the contrary I just want to open up a dialog since perhaps others might be suffering from this. And I want to help resolve it if I can.
Any insight is appreciated.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Tom
Dear XFS folks,
I have been using XFS for many years, starting on IRIX and then on RedHat 7.2, and now on CentOS/RHEL and Ubuntu. Last time I posted to this mailing list was 12 years ago. :-) I've been a happy customer!
I understand that RedHat does not formally support XFS as a root filesystem on RHEL.
That's correct. However, I have run xfs root on Centos5, and am currently running xfs root on RHEL6. On md raid1 in both instances. ;)
Quoted 8 lines
However, up until now, I've been using it very successfully for years on both CentOS and Ubuntu. On CentOS, I've successfully patched Anaconda since CentOS 5.6 to allow XFS root file system support directly from Anaconda (on both bare metal and Xen VMs). Prior to that, I had code in %post that would simply migrate an ext3 fs to XFS. And I always run md raid1 (except with Xen, since I use mirroring on the dom0). I never use hardware RAID since I want to keep my provisioning as generic as possible.
Quoted 6 lines
I've deployed many servers using XFS this way and it has always been superior for my workloads.... and superior to ext3, and ext4.
....until CentOS 5.9 came out. Now any systems that are running the stock CentOS 5.9 kernel (including 5.X systems upgraded to this kernel) hang on reboot. If I downgrade to the 5.8 kernel, the problem is resolved.
Just to be absolutely sure, do you have any xfs-kmod or kmod-xfs installed? If so, remove it.
Quoted 6 lines
I have taken an engineering approach to testing this problem in efforts to help resolve it. I filed a bug with CentOS, but it's probably not going to go anywhere upstream since RedHat probably won't support XFS on the root filesystem (why I still don't understand, since I fixed the issues with Anaconda for myself and can Kickstart systems with XFS all day long).
It's for non-technical reasons.
Quoted 10 lines
Therefore I hope anyone here can help. In fact, I was specifically hoping to catch Eric Sandeen's attention since this seems like a pretty serious regression. It's further aggravated by the fact that RedHat stays behind with kernel version and backports modern fixes. I scanned over the 2.6.18-348.el5 (stock 5.9 kernel) changelog, and I see a few suspicious things, but I'm not sure.
Much more detail is available here (CentOS bug id 0006217) including steps to reproduce the problem. Also testing with and without md raid.
http://bugs.centos.org/view.php?id=6217
so it's hanging on the way down I guess?
I see: "md: md1 switched to read-only mode"
Was that there before?
Quoted 2 lines
The one thing I haven't provided is a traceback. I can provide that if it would be helpful.
of course it would be . . .
I don't see anything obvious between the two kernels you mention, and I can't spend a ton of time digging into this, since most of my day is taken up supporting the RHEL customers who pay my salary, nudge nudge. ;)
I'd look at the kernel changelogs for xfs & md, and see if anything seems plausible. Maybe diff the sources & see what changed, etc.
-Eric
Quoted 6 lines
I am not in a big hurry for help, on the contrary I just want to open up a dialog since perhaps others might be suffering from this. And I want to help resolve it if I can.
Any insight is appreciated.
Quoted 8 lines
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 4 lines · Eric Sandeen
That's correct. However, I have run xfs root on Centos5, and am currently running xfs root on RHEL6. On md raid1 in both instances. ;)
Eric,
Try it with 5.9 and md raid1. I bet you won't be running it very much longer. ;-)
Unless of course you can't reproduce it.
Quoted 4 lines
Just to be absolutely sure, do you have any xfs-kmod or kmod-xfs installed? If so, remove it.
No kmod. I only use the kmod on 32-bit platforms. As you know, it is not needed on 64-bit.
This system is a freshly kickstarted system with only about 200 packages installed (minimal base system just for stability testing):
[root@test9][/root]# rpm -qa | fgrep xfs xfsprogs-2.9.4-1.el5.centos xfsdump-2.2.46-1.el5.centos [root@test9][/root]# rpm -qa | fgrep kmod [root@test9][/root]# uname -a Linux test9.xxxx.xxx 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_6 4 x86_64 x86_64 GNU/Linux
Quoted 6 lines
Quoted 3 lines
(why I still don't understand,
since I fixed the issues with Anaconda for myself and can Kickstart systems with XFS all day long).It's for non-technical reasons.
Hmmm, yeah, well I do understand. ;-) Just drives me nuts.
Quoted 6 lines
so it's hanging on the way down I guess?
I see: "md: md1 switched to read-only mode"
Was that there before?
Yes. It's the very last thing printed when using any newer 5.X system. Then it's supposed to physically reboot or shutdown. But this is where it hangs. I will reply back to the xfs list (to a message from Ben) later tonight with some more output from the serial console including a traceback.
I'll also add these details in the open CentOS bug.
Quoted 5 lines
I don't see anything obvious between the two kernels you mention, and I can't spend a ton of time digging into this, since most of my day is taken up supporting the RHEL customers who pay my salary, nudge nudge. ;)
Any help is appreciated. Finding this bug may possibly help ferret out another more possibly nefarious bug, which is why I don't need instant gratification here. I'm only looking to assist with the solution, not cause more stress.
The "company" that I work for from 9-5 has an extensive RHEL 5.X and 6.X deployment with Satellite, channels, full support, the whole nine yards. They don't color outside the lines as I do -- they use ext3 for the root filesystem instead. Their loss. :-)
So don't worry, said "company" "gives" plenty to the "cause". ;-)
However, after 5pm, I do unrelated personal work and projects unrelated to said "company", and one of those things is working with CentOS and Ubuntu. Using XFS quite extensively.
Quoted 4 lines
I'd look at the kernel changelogs for xfs & md, and see if anything seems plausible. Maybe diff the sources & see what changed, etc.
Yeah, I took a half-hearted look already. But didn't diff any source code yet. I saw a freeze/thaw change and a few other md changes that were suspect. But haven't had a chance to dig deeper.
Thanks again.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 1 line · Tom
In a previous message, Eric Sandeen wrote:
...
Quoted 15 lines
Quoted 4 lines
I don't see anything obvious between the two kernels you mention, and I can't spend a ton of time digging into this, since most of my day is taken up supporting the RHEL customers who pay my salary, nudge nudge. ;)
Any help is appreciated. Finding this bug may possibly help ferret out another more possibly nefarious bug, which is why I don't need instant gratification here. I'm only looking to assist with the solution, not cause more stress.
The "company" that I work for from 9-5 has an extensive RHEL 5.X and 6.X deployment with Satellite, channels, full support, the whole nine yards. They don't color outside the lines as I do -- they use ext3 for the root filesystem instead. Their loss. :-)
Quoted 5 lines
So don't worry, said "company" "gives" plenty to the "cause". ;-)
However, after 5pm, I do unrelated personal work and projects unrelated to said "company", and one of those things is working with CentOS and Ubuntu. Using XFS quite extensively.
Sorry for hassling you ;)
Quoted 8 lines
Quoted 4 lines
I'd look at the kernel changelogs for xfs & md, and see if anything seems plausible. Maybe diff the sources & see what changed, etc.
Yeah, I took a half-hearted look already. But didn't diff any source code yet. I saw a freeze/thaw change and a few other md changes that were suspect. But haven't had a chance to dig deeper.
I'd suspect the md changes were the trigger, though maybe it reveals an xfs problem. I don't see anything in xfs that changed which should be causing this.
The backtrace will help, I think.
Thanks,
-Eric
Quoted 10 lines
Thanks again.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Eric Sandeen
Sorry for hassling you ;)
Nah, no problem, I think we all know what it's like in corporate America........ Besides, when hassled, I hassle right on back -- just to ensure that I'm taking a full participating role in the love. :-D
Again, your help is appreciated and I'll be happy to give back as much as I can. I've been committed to XFS for 15 years, and RedHat for even longer (way before CentOS existed). And Linux longer yet! For the SGI engineers on this list, I do miss IRIX though... it will always have a special place in my heart -- if only that OS and its tools could have been open sourced...
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Tom
For the SGI engineers on this list, I do miss IRIX though... it will always have a special place in my heart -- if only that OS and its tools could have been open sourced...
I'm getting all choked up...
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Tom
For the SGI engineers on this list, I do miss IRIX though... it will always have a special place in my heart -- if only that OS and its tools could have been open sourced...
Much of the differentiating/unique technology has been. XFS and its user space tools obviously. Lesser known is that Paul Jackson and others at SGI contributed the basic NUMA scalability code to Linux during the Linux Scalability Effort in the early 2000s, based heavily on IRIX concepts. This included cpumemsets, directly taken from IRIX IIRC, which evolved into Linux mainline cpusets.
This effort was necessary to get Linux to scale on Altix NUMALink systems with up to 512 sockets, as well as IBM's Xeon based x440 NUMA box with up to 16 sockets, HP's cell based Itanium systems w/32 sockets, and clones of HP's cell design used by the likes of Bull, Unisys, NEC, and others. This work later turned out to be of great benefit to the market at large, as the underpinnings were already in place when AMD launched Opteron, whose 2/4/8 socket platforms use HT NUMA interconnects. Same for Intel when it finally went NUMA with QuickPath.
This infrastructure also allowed for a relatively easy implementation
of multi-core support on single and multi-socket systems.
AIUI, from articles, not first hand experience, is that what did not make it into Linux was the tendency of some SGI engineers to write bloated inefficient code with unnecessarily large data structures. This occurred because IRIX developers were working on 8-32 CPU systems (or larger) with 8-32GB (or more) of RAM, and weren't concerned with single processor performance or memory efficiency, as they had massive resources available. When the scalability concepts were brought over to Linux, they were bolted onto the mantra of maximum single processor performance and small memory footprint, and we got the best of both worlds, without the previous IRIX overhead.
I recall reading an article from that period which described an early Linux porting effort to Origin/MIPS. This was a 16-way machine used as a development mule to get Linux working on NUMALink, ready for Altix/Itanium. It was described that even before any NUMA scalability work began, with a large number of operations the stock SMP Linux kernel was much faster than IRIX on this 16 CPU origin box. "Amazing" is a description I recall. It had been assumed Linux would be a dog since it was optimized for small systems. It turns out it worked just as well on the big ones, due to said small system optimizations.
So in some respects it's probably better that IRIX simply was abandoned, with some of the best parts making it into Linux.
Signature · 6 lines
Stan _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Hey Tom,
Quoted 3 lines · Tom
I have been using XFS for many years, starting on IRIX and then on RedHat 7.2, and now on CentOS/RHEL and Ubuntu. Last time I posted to this mailing list was 12 years ago. :-) I've been a happy customer!
I'm glad to hear it! ;)
Quoted 6 lines
Much more detail is available here (CentOS bug id 0006217) including steps to reproduce the problem. Also testing with and without md raid.
http://bugs.centos.org/view.php?id=6217The one thing I haven't provided is a traceback. I can provide that if it would be helpful.
I took a brief look at your report. I think a traceback would be helpful.
echo t > /proc/sysrq-trigger should do the trick. You're in the middle of unmount so you might need to go serial console to capture the output. Your report metions freeze/thaw. This is an area where we've had deadlocks in the past, so I wouldn't be surprised if that is what you're hitting. We'll have to see.
Thanks,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Ben Myers
I took a brief look at your report. I think a traceback would be helpful.
echo t >
/proc/sysrq-triggershould do the trick. You're in the middle of unmount so you might need to go serial console to capture the output.
Your report metions freeze/thaw. This is an area where we've had
deadlocks in the past, so I wouldn't be surprised if that is what you're hitting. We'll have to see.
Hi Ben,
Sure. If I do a reboot, and let it go through the motions, then I let it hang for more than 120 seconds, sometimes it displays a traceback on it's own. If not, I can trigger it from the serial console (though probably with break-t instead since this happens at the very end of the shutdown sequence, so no access to the shell).
I'll have access to the test systems tonight and will get a traceback. I'll also post what is displayed during the shutdown process right before the hang.
Thanks again for your help.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hi all,
I've update the CentOS bug (http://bugs.centos.org/view.php?id=6217) with the following information:
-- More detail about the hang including traceback --
Using 5.9 kernel (348) without md raid:
Please stand by while rebooting the system...
md: stopping all md devices.
Synchronizing SCSI cache for disk sda:
Restarting system.
..
machine restart
(reboots normally)
With md raid1:
Unmounting pipe file systems:
Unmounting file systems:
Please stand by while rebooting the system...
md: stopping all md devices.
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
(hang)
Traceback:
INFO: task reboot:2063 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
reboot D ffff810037df37e0 0 2063 1 19
(NOTLB)
ffff81005890ba08 0000000000000082 ffff81005890ba58 ffff81005beb1ea0 0000000000000001 0000000000000007 ffff810058d67040 ffff810037df37e0 000000596dd8a1e6 0000000000003df4 ffff810058d67228 000000008008d76f
Call Trace: [<ffffffff8002e4bc>] __wake_up+0x38/0x4f [<ffffffff80223bce>] md_write_start+0xf2/0x108 [<ffffffff800a3bc2>] autoremove_wake_function+0x0/0x2e [<ffffffff8000ab62>] get_page_from_freelist+0x380/0x442 [<ffffffff880b102c>] :raid1:make_request+0x38/0x5d8 [<ffffffff8001c839>] generic_make_request+0x211/0x228 [<ffffffff8002389f>] mempool_alloc+0x31/0xe7 [<ffffffff8001a98f>] vsnprintf+0x5d7/0xb54 [<ffffffff80033695>] submit_bio+0xe6/0xed [<ffffffff8807f801>] :xfs:_xfs_buf_ioapply+0x1f2/0x254 [<ffffffff8807f89c>] :xfs:xfs_buf_iorequest+0x39/0x64 [<ffffffff8808386c>] :xfs:xfs_bdstrat_cb+0x36/0x3a [<ffffffff8807c0a8>] :xfs:xfs_bwrite+0x5e/0xba [<ffffffff88077669>] :xfs:xfs_syncsub+0x119/0x226 [<ffffffff88084ce2>] :xfs:xfs_fs_sync_super+0x33/0xdd [<ffffffff8010aa44>] quota_sync_sb+0x2e/0xf0 [<ffffffff800e55bd>] __fsync_super+0x1b/0x9e [<ffffffff800e578a>] fsync_super+0x9/0x16 [<ffffffff800e57c1>] fsync_bdev+0x2a/0x3b [<ffffffff8014ea59>] invalidate_partition+0x28/0x40 [<ffffffff802225a8>] do_md_stop+0xa0/0x2ec [<ffffffff80224d41>] md_notify_reboot+0x5f/0x120 [<ffffffff80067565>] notifier_call_chain+0x20/0x32 [<ffffffff8009de98>] blocking_notifier_call_chain+0x22/0x36 [<ffffffff8009e220>] kernel_restart_prepare+0x18/0x29 [<ffffffff8009e280>] kernel_restart+0x9/0x46 [<ffffffff8009e40a>] sys_reboot+0x146/0x1c7 [<ffffffff8003b291>] hrtimer_try_to_cancel+0x4a/0x53 [<ffffffff8005a753>] hrtimer_cancel+0xc/0x16 [<ffffffff80063cf9>] do_nanosleep+0x47/0x70 [<ffffffff8005a640>] hrtimer_nanosleep+0x58/0x118 [<ffffffff800a5b84>] hrtimer_wakeup+0x0/0x22 [<ffffffff8001e2f2>] sigprocmask+0xb7/0xdb [<ffffffff80054fe6>] sys_nanosleep+0x4c/0x62 [<ffffffff8005d116>] system_call+0x7e/0x83
Filesystem Size Used Avail Use% Mounted on /dev/md3 4.9G 784M 4.2G 16% / /dev/md2 108M 11M 97M 11% /boot tmpfs 689M 0 689M 0% /dev/shm
[root@test9][/root]# swapon -s Filename Type Size Used Priority /dev/md1 partition 2947832 0 -1
[root@test9][/root]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb1[1] sda1[0]
128384 blocks [2/2] [UU]md1 : active raid1 sdb2[1] sda2[0]
2947840 blocks [2/2] [UU]
md3 : active raid1 sdb3[1] sda3[0]
5116608 blocks [2/2] [UU]
unused devices: <none>
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hi Tom,
Quoted 33 lines · Tom
I've update the CentOS bug (http://bugs.centos.org/view.php?id=6217) with the following information:
-- More detail about the hang including traceback --
Using 5.9 kernel (348) without md raid:
Please stand by while rebooting the system...
md: stopping all md devices.
Synchronizing SCSI cache for disk sda:
Restarting system.
..
machine restart
(reboots normally)With md raid1:
Unmounting pipe file systems:
Unmounting file systems:
Please stand by while rebooting the system...
md: stopping all md devices.
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
(hang)Traceback:
INFO: task reboot:2063 blocked for more than 120 seconds."echo 0 >
/proc/sys/kernel/hung_task_timeout_secs" disables this message.
reboot Dffff810037df37e00 2063 1 19
(NOTLB)
ffff81005890ba080000000000000082ffff81005890ba58ffff81005beb1ea00000000000000001 0000000000000007ffff810058d67040ffff810037df37e0000000596dd8a1e60000000000003df4ffff810058d67228000000008008d76f
Quoted 10 lines
Call Trace: [<ffffffff8002e4bc>] __wake_up+0x38/0x4f [<ffffffff80223bce>] md_write_start+0xf2/0x108 [<ffffffff800a3bc2>] autoremove_wake_function+0x0/0x2e [<ffffffff8000ab62>] get_page_from_freelist+0x380/0x442 [<ffffffff880b102c>] :raid1:make_request+0x38/0x5d8 [<ffffffff8001c839>] generic_make_request+0x211/0x228 [<ffffffff8002389f>] mempool_alloc+0x31/0xe7 [<ffffffff8001a98f>] vsnprintf+0x5d7/0xb54 [<ffffffff80033695>] submit_bio+0xe6/0xed
I think you should consider copying [email protected].
Did you have a chance to get the sysrq output? It would be helpful to see the other tasks on your machine.
Regards,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Tom
With md raid1:
Unmounting pipe file systems:
Unmounting file systems:
So the filesystems are unmounted....
Quoted 28 lines
Please stand by while rebooting the system...
md: stopping all md devices.
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
(hang)Traceback:
INFO: task reboot:2063 blocked for more than 120 seconds."echo 0 >
/proc/sys/kernel/hung_task_timeout_secs" disables this message.
reboot Dffff810037df37e00 2063 1 19
(NOTLB)
ffff81005890ba080000000000000082ffff81005890ba58ffff81005beb1ea00000000000000001 0000000000000007ffff810058d67040ffff810037df37e0000000596dd8a1e60000000000003df4ffff810058d67228000000008008d76fCall Trace: [<ffffffff8002e4bc>] __wake_up+0x38/0x4f [<ffffffff80223bce>] md_write_start+0xf2/0x108 [<ffffffff800a3bc2>] autoremove_wake_function+0x0/0x2e [<ffffffff8000ab62>] get_page_from_freelist+0x380/0x442 [<ffffffff880b102c>] :raid1:make_request+0x38/0x5d8 [<ffffffff8001c839>] generic_make_request+0x211/0x228 [<ffffffff8002389f>] mempool_alloc+0x31/0xe7 [<ffffffff8001a98f>] vsnprintf+0x5d7/0xb54 [<ffffffff80033695>] submit_bio+0xe6/0xed [<ffffffff8807f801>] :xfs:_xfs_buf_ioapply+0x1f2/0x254 [<ffffffff8807f89c>] :xfs:xfs_buf_iorequest+0x39/0x64 [<ffffffff8808386c>] :xfs:xfs_bdstrat_cb+0x36/0x3a [<ffffffff8807c0a8>] :xfs:xfs_bwrite+0x5e/0xba
Quoted 8 lines
[<ffffffff88077669>] :xfs:xfs_syncsub+0x119/0x226 [<ffffffff88084ce2>] :xfs:xfs_fs_sync_super+0x33/0xdd [<ffffffff8010aa44>] quota_sync_sb+0x2e/0xf0 [<ffffffff800e55bd>] __fsync_super+0x1b/0x9e [<ffffffff800e578a>] fsync_super+0x9/0x16 [<ffffffff800e57c1>] fsync_bdev+0x2a/0x3b [<ffffffff8014ea59>] invalidate_partition+0x28/0x40 [<ffffffff802225a8>] do_md_stop+0xa0/0x2ec
And this says the filesystem is still mounted. Why?
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Dave Chinner
And this says the filesystem is still mounted. Why?
Good question.
As mentioned in the CentOS bug report, this is a freshly Kickstarted CentOS 5.9 system, staged with minimal packages.
I'm not running any third party daemons or anything like that. I could wipe the system and re-kickstart it again over and over, and the problem will exist with 5.9 and the 348 kernel. I can also repeat this on any x86 based platform with nothing special, no hardware RAID controllers, just generic SATA or SCSI disks. Doesn't happen with any previous CentOS kernels.
Also mentioned, if I take a 5.8 system, which is running correctly, and upgrade the kernel from 308 to 348, the problem shows up with the new kernel. If I downgrade 5.9 to 308, the problem is resolved as well. Also if I use ext3 with md raid1, there is no problem either. That's why in my mind, all roads lead to some interaction between XFS and md raid. Of course I could be off with that assessment.
My next email will contain the "sysrq t" output that Ben requested.
Thanks!
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Tom
Quoted 3 lines · Dave Chinner
And this says the filesystem is still mounted. Why?
Good question.
As mentioned in the CentOS bug report, this is a freshly Kickstarted CentOS 5.9 system, staged with minimal packages.
....
Quoted 1 line
My next email will contain the "sysrq t" output that Ben requested.
Which doesn't tell us why the filesystem was not unmounted. We need to know why/how the unmount failed to solve the problem, so you'll need to do some debugging of the unmount to try to work that out...
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Dave Chinner
Which doesn't tell us why the filesystem was not unmounted. We need to know why/how the unmount failed to solve the problem, so you'll need to do some debugging of the unmount to try to work that out...
Thanks Dave.
I can work on that tonight.
Oddly, since the problem is kernel related (308 doesn't do it, 348 does), the system shuts down the same way no matter what kernel I'm using. So what would be the difference? The umounts and running processes shouldn't change. Just seems to me that some resource isn't being released. And only with kernel 348 and XFS. Quite puzzling..........
Any suggestions on how I would debug this?
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Tom
Quoted 5 lines · Dave Chinner
Which doesn't tell us why the filesystem was not unmounted. We need to know why/how the unmount failed to solve the problem, so you'll need to do some debugging of the unmount to try to work that out...
Thanks Dave.
I can work on that tonight.
Quoted 7 lines
Oddly, since the problem is kernel related (308 doesn't do it, 348 does), the system shuts down the same way no matter what kernel I'm using. So what would be the difference? The umounts and running processes shouldn't change. Just seems to me that some resource isn't being released. And only with kernel 348 and XFS. Quite puzzling..........
Any suggestions on how I would debug this?
Find out if the unmount is returning an error first. If there is no error, then you need to find what is doing bind mounts on your system and make sure they are unmounted properly before the final unmount is done. If lazy unmount is being done, make it a normal unmount an see where the unmount is getting stcuk or taking time to complete by using sysrq-w if it gets delayed for any length of time.
FWIW, because this is a old, old kernel, event tracing is not available, so the single most useful tool for tracking this down is not available...
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Dave Chinner
Quoted 2 lines
Any suggestions on how I would debug this?
Find out if the unmount is returning an error first. If there is no error, then you need to find what is doing bind mounts on your system and make sure they are unmounted properly before the final unmount is done. If lazy unmount is being done, make it a normal unmount an see where the unmount is getting stcuk or taking time to complete by using sysrq-w if it gets delayed for any length of time.
I agree. However, I may be at the mercy of the upstream vendor. This is a completely stock CentOS system with minimal packages installed (save using XFS as the root fs). Oracle Enterprise Linux as well as Scientific Linux also suffers from the same problem. It's curious because the upstream vendor must be doing something at shutdown to trigger this. I will get my hands dirty tonight and see how the system performs these umounts at shutdown.
I am also prepared to blacklist the entire CentOS/RHEL 5.9 since I've been struggling with this for a few weeks now. I am getting close to giving up and moving on. I mean, I ran into this during regression testing before moving my "latest" pointer from 5.8 to 5.9. I can easily keep latest at 5.8 and not cause impact for now (which is why I use the version "pointer" mentality). But I'm also worried about no upgrade path until this is resolved. I am stubborn about using XFS exclusively. Otherwise I could just deploy on ext3 and never see this.
Quoted 3 lines
FWIW, because this is a old, old kernel, event tracing is not available, so the single most useful tool for tracking this down is not available...
Yeah, I know. Welcome to the RHEL/CentOS/OEL/SL world. That's why I use Ubuntu for the desktop (easy to play with, easy to break, easy to fix) and RHEL for servers (hard to break, but when it does break, watch out). It's been a long time since I saw RHEL break this bad...I'm usually pretty good at working around problems like this. But this one has me stumped.
Thanks again. I'll keep you posted.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Dave Chinner
Find out if the unmount is returning an error first. If there is no error, then you need to find what is doing bind mounts on your system and make sure they are unmounted properly before the final unmount is done. If lazy unmount is being done, make it a normal unmount an see where the unmount is getting stcuk or taking time to complete by using sysrq-w if it gets delayed for any length of time.
OK, here is what I did tonight. I added debug toward the end of /etc/rc.d/rc6.d/S01reboot ...where the umounts are normally handled.
Turns out that / and /proc cannot be unmounted (of course), so it gets remounted as read-only. See output below.
I also noticed that md3 (root fs) isn't showing up in this list at the very end (I believe these messages are produced by the kernel md driver):
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
So just for kicks, I added "mdadm --readonly --force /dev/md3" as well after the umounts. Of course /dev/md3 can't be forced into readonly mode because the root file system is still mounted (albeit also read-only). So no luck there.
Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Starting killall: [ OK ]
Sending all processes the TERM signal...
Sending all processes the KILL signal...
Saving random seed:
Syncing hardware clock to system time
Turning off swap:
Unmounting pipe file systems:
Unmounting file systems:
DEBUG: remounting '/' as read-only using 'mount -n -o ro,remount'
DEBUG: remounting '/proc' as read-only using 'mount -n -o ro,remount'
mdadm: failed to set readonly for /dev/md3: Device or resource busy
Please stand by while rebooting the system...
md: stopping all md devices.
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
(hang)
Just for kicks, I get the same output with the 308 kernel, with the addition of this:
md: md3 still in use.
But the same system happily reboots just fine with the 308 kernel even after producing that "still in use" message that 348 does not produce.
I did some more experiments with mdadm and I can't get any underlying md device to go into read-only mode even if the fs is mounted read-only. The only way I could get that to work is if the fs is completely unmounted. Whether it is XFS or ext3. Yet a system on ext3 reboots fine.
During reboot, I would expect /proc and / to be still mounted, albeit read-only, and I would expect that md should be able to handle this. But it can't. What I didn't expect is the mdadm behavior to be consistent between the 308 and 348 kernels. But it is. So something special happens at the moment of reboot (that's different than what mdadm allows).
Now why this only happens with XFS and not ext3 is beyond me.
Is there more specific information that I can gather that may help?
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Tom
Quoted 7 lines · Dave Chinner
Find out if the unmount is returning an error first. If there is no error, then you need to find what is doing bind mounts on your system and make sure they are unmounted properly before the final unmount is done. If lazy unmount is being done, make it a normal unmount an see where the unmount is getting stcuk or taking time to complete by using sysrq-w if it gets delayed for any length of time.
Quoted 6 lines
OK, here is what I did tonight. I added debug toward the end of
/etc/rc.d/rc6.d/S01reboot...where the umounts are normally handled.DEBUG: remounting '/' as read-only using 'mount -n -o ro,remount'
DEBUG: remounting '/proc' as read-only using 'mount -n -o ro,remount'
mdadm: failed to set readonly for/dev/md3: Device or resource busy
EBUSY means one of two possibilities:
1. there's a file still open for write. => lsof
2. there's an unlinked but still open file => lsof
But I don't think that's the problem at all.
Quoted 10 lines
Please stand by while rebooting the system...
md: stopping all md devices.
md: md2 switched to read-only mode.
md: md1 switched to read-only mode.
(hang)Just for kicks, I get the same output with the 308 kernel, with the addition of this:
md: md3 still in use.
Which implies that the problem is a change in behaviour in the md layer or below. i.e. previously md just saw that it was busy and did not try to tear down the device. Now it is trying to tear down the device with a filesystem that is still active on it.
Quoted 2 lines
But the same system happily reboots just fine with the 308 kernel even after producing that "still in use" message that 348 does not produce.
Right, because it correctly detects the filesystem is still in use and doesn't try to tear down the device.
Quoted 4 lines
I did some more experiments with mdadm and I can't get any underlying md device to go into read-only mode even if the fs is mounted read-only. The only way I could get that to work is if the fs is completely unmounted. Whether it is XFS or ext3. Yet a system on ext3 reboots fine.
And that will be because ext3 won't be issuing any IO on the sync that is triggered when tearing down the MD device. XFS is writing the superblock, and that's where the MD device is hanging on itself.
Quoted 1 line
Is there more specific information that I can gather that may help?
No need - I can tell you the exact commit in the RHEL 5.9 tree that caused this regression:
11ff4073: [md] Fix reboot stall with raid on megaraid_sas controller
The result is that the final shutdown of md devices now uses a "force readonly" method, which means it ignores the fact that a filesystem may still be active on top of it and rips the device out from under the filesystem. This really only affects root devices, and given that XFs is not supported as a root device on RHEL, it isn't in the QE test matrix and so the problem was never noticed.
Feel free to report this all to the RH bugzilla - depending the implications of the regression for supported configurations, it may need to be fixed in RHEL anyway.
But now you know the problem, you can probably fix it yourself rather than have to wait for RHEL/CentOS product cycle updates...
Cheers,
Dave.
PS: has the fact I quoted a RHEL5.9 commit id triggered a lightbulb moment for you yet? Hint: my other email address is [email protected] - this XFS community support effort was brought to you by Red Hat.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Dave Chinner
No need - I can tell you the exact commit in the RHEL 5.9 tree that caused this regression:
11ff4073: [md] Fix reboot stall with raid onmegaraid_sascontroller
Dave,
This is excellent news! At least we have some answers.
Quoted 3 lines
This really only affects root devices,
and given that XFs is not supported as a root device on RHEL, it isn't in the QE test matrix and so the problem was never noticed.
Well I noticed the problem for the sake of the community and reported it. :-)
I am happy that we have some Red Hat folks helping out here.
Thank goodness I do my own regression testing before I roll out a new release.
Quoted 4 lines
Feel free to report this all to the RH bugzilla - depending the implications of the regression for supported configurations, it may need to be fixed in RHEL anyway.
Yes, I could since I work full-time for a company that has an extensive (7-figure) RHEL deployment, including XFS use licenses. However, I'll have to go through an I.T. channel since they hold the accounts. I'll investigate whether they will let me do this since they do not use XFS on root. I would need them to back me up first.
Quoted 4 lines
But now you know the problem, you can probably fix it yourself rather than have to wait for RHEL/CentOS product cycle updates...
Yes, thank you.
Quoted 4 lines
PS: has the fact I quoted a RHEL5.9 commit id triggered a lightbulb moment for you yet? Hint: my other email address is [email protected] - this XFS community support effort was brought to you by Red Hat.
Indeed. Again, I appreciate your help. And from Red Hat, Inc. as well.
-- Tom
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines
So the filesystems are unmounted....
And this says the filesystem is still mounted. Why?
When I last had a problem with shutdown, it was because of mount namespaces. You can unmount all day long, but as long as there is a mount still open in a namespace, nothing will get unmounted. This was on Fedora though; don't know if RHEL 5.x makes use of namespaces.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs