Description of problem: Looking at the kernel printk output on shutdown of the kernel running in one of my virtual machines, I see a consistent 1 second delay after 'md: stopping all md devices' message is printed: [ 1.393524] md: stopping all md devices. [ 2.396385] ACPI: Preparing to enter system sleep state S5 [ 2.397101] Disabling non-boot CPUs ... [ 2.397101] Power down. [ 2.397101] acpi_power_off called Looking at the code in drivers/md/md.c, confirms there is an unconditional sleep in the shutdown path: static int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x) { struct list_head *tmp; mddev_t *mddev; if ((code == SYS_DOWN) || (code == SYS_HALT) || (code == SYS_POWER_OFF)) { printk(KERN_INFO "md: stopping all md devices.\n"); for_each_mddev(mddev, tmp) if (mddev_trylock(mddev)) { /* Force a switch to readonly even array * appears to still be in use. Hence * the '100'. */ md_set_readonly(mddev, 100); mddev_unlock(mddev); } /* * certain more exotic SCSI devices are known to be * volatile wrt too early system reboots. While the * right place to handle this issue is the given * driver, we do want to have a safe RAID driver ... */ mdelay(1000*1); } return NOTIFY_DONE; } I don't know whether the comment about exotic SCSI devices is still relevant, but at the very least this delay should be made conditional on the existence of any MD devices. My virtual machine has no block devices, booting directly off a virtio 9p filesystem. From initial boot, through running the application, to shutting down, my virtual machine only runs for 1.9 seconds. In other words, this delay imposed by the MD driver is accounting for > 50% of my wallclock time, despite not having any MD devices in the guest. Version-Release number of selected component (if applicable): 2.6.40.4-5.fc15.x86_64 How reproducible: Always Steps to Reproduce: 1. Provision a (virtual) machine, which does *not* setup any MD devices. 1. Boot the (virtual) machine, ensuring the kernel log level is sufficient to show all printk lines 2. Shutdown the machine, watching the printk messages 3. Actual results: A 1 second delay occurs at the time this is printed: [ 1.393524] md: stopping all md devices. Expected results: There is no delay by the MD driver Additional info:
Created attachment 524464 [details] Simple attempt to skip the 1 second sleep if no MD devices exist
(In reply to comment #1) > Created attachment 524464 [details] > Simple attempt to skip the 1 second sleep if no MD devices exist Can you send that upstream?
Posted to LKML/linux-raid http://marc.info/?l=linux-kernel&m=131677175617733&w=2
(In reply to comment #3) > Posted to LKML/linux-raid > > http://marc.info/?l=linux-kernel&m=131677175617733&w=2 Excellent. Looks like it is queued already as well. I'll bring this in later today.
This was committed today. It will be in the next F15 build.
kernel-2.6.40.6-0.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/kernel-2.6.40.6-0.fc15
Package kernel-2.6.40.6-0.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing kernel-2.6.40.6-0.fc15' as soon as you are able to, then reboot. Please go to the following url: https://admin.fedoraproject.org/updates/kernel-2.6.40.6-0.fc15 then log in and leave karma (feedback).
kernel-2.6.40.6-0.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.