2006-05-12 06:44:14

by Keith Owens

[permalink] [raw]
Subject: 2.6.17-rc4 md lock held at task exit

Doing poweroff on 2.6.17-rc4 i386, SMP

BUG halt/4781, lock held at task exit time!
[f7001b34] {mddev_find}
.. held by: halt: 4781 [f7cd4030, 118]
... acquired at: md_notify_reboot+0x3a/0xa9 [md_mod}

Config:

X86_32=y
SEMAPHORE_SLEEPERS=y
X86=y
MMU=y
GENERIC_ISA_DMA=y
GENERIC_IOMAP=y
GENERIC_HWEIGHT=y
ARCH_MAY_HAVE_PC_FDC=y
DMI=y
EXPERIMENTAL=y
LOCK_KERNEL=y
INIT_ENV_ARG_LIMIT=32
LOCALVERSION="-kaos"
SWAP=y
SYSVIPC=y
SYSCTL=y
RELAY=y
INITRAMFS_SOURCE=""
UID16=y
VM86=y
CC_OPTIMIZE_FOR_SIZE=y
KALLSYMS=y
KALLSYMS_ALL=y
HOTPLUG=y
PRINTK=y
BUG=y
ELF_CORE=y
BASE_FULL=y
FUTEX=y
EPOLL=y
SHMEM=y
SLAB=y
BASE_SMALL=0
MODULES=y
MODULE_UNLOAD=y
KMOD=y
STOP_MACHINE=y
LBD=y
IOSCHED_NOOP=y
DEFAULT_NOOP=y
DEFAULT_IOSCHED="noop"
SMP=y
X86_PC=y
M686=y
X86_CMPXCHG=y
X86_XADD=y
X86_L1_CACHE_SHIFT=5
RWSEM_XCHGADD_ALGORITHM=y
GENERIC_CALIBRATE_DELAY=y
X86_PPRO_FENCE=y
X86_WP_WORKS_OK=y
X86_INVLPG=y
X86_BSWAP=y
X86_POPAD_OK=y
X86_CMPXCHG64=y
X86_GOOD_APIC=y
X86_USE_PPRO_CHECKSUM=y
X86_TSC=y
HPET_TIMER=y
HPET_EMULATE_RTC=y
NR_CPUS=8
SCHED_SMT=y
SCHED_MC=y
PREEMPT=y
PREEMPT_BKL=y
X86_LOCAL_APIC=y
X86_IO_APIC=y
X86_MCE=y
X86_MCE_NONFATAL=y
X86_MCE_P4THERMAL=y
MICROCODE=m
X86_MSR=m
X86_CPUID=m
NOHIGHMEM=y
PAGE_OFFSET=0xC0000000
ARCH_FLATMEM_ENABLE=y
ARCH_SPARSEMEM_ENABLE=y
ARCH_SELECT_MEMORY_MODEL=y
SELECT_MEMORY_MODEL=y
FLATMEM_MANUAL=y
FLATMEM=y
FLAT_NODE_MEM_MAP=y
SPARSEMEM_STATIC=y
SPLIT_PTLOCK_CPUS=4
MTRR=y
IRQBALANCE=y
REGPARM=y
SECCOMP=y
HZ_250=y
HZ=250
PHYSICAL_START=0x100000
PCI=y
PCI_GOANY=y
PCI_BIOS=y
PCI_DIRECT=y
ISA_DMA_API=y
BINFMT_ELF=y
BINFMT_MISC=m
NET=y
PACKET=m
PACKET_MMAP=y
UNIX=y
INET=y
IP_FIB_HASH=y
SYN_COOKIES=y
INET_DIAG=y
INET_TCP_DIAG=y
TCP_CONG_BIC=y
NETFILTER=y
NETFILTER_NETLINK=m
NETFILTER_XTABLES=m
NETFILTER_XT_TARGET_CLASSIFY=m
NETFILTER_XT_TARGET_MARK=m
NETFILTER_XT_TARGET_NFQUEUE=m
NETFILTER_XT_TARGET_NOTRACK=m
NETFILTER_XT_MATCH_COMMENT=m
NETFILTER_XT_MATCH_CONNTRACK=m
NETFILTER_XT_MATCH_DCCP=m
NETFILTER_XT_MATCH_ESP=m
NETFILTER_XT_MATCH_HELPER=m
NETFILTER_XT_MATCH_LENGTH=m
NETFILTER_XT_MATCH_LIMIT=m
NETFILTER_XT_MATCH_MAC=m
NETFILTER_XT_MATCH_MARK=m
NETFILTER_XT_MATCH_MULTIPORT=m
NETFILTER_XT_MATCH_PKTTYPE=m
NETFILTER_XT_MATCH_REALM=m
NETFILTER_XT_MATCH_SCTP=m
NETFILTER_XT_MATCH_STATE=m
NETFILTER_XT_MATCH_STRING=m
NETFILTER_XT_MATCH_TCPMSS=m
IP_NF_CONNTRACK=m
IP_NF_CONNTRACK_NETLINK=m
IP_NF_FTP=m
IP_NF_IRC=m
IP_NF_H323=m
IP_NF_QUEUE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
BLK_DEV_SR=m
BLK_DEV_SR_VENDOR=y
CHR_DEV_SG=m
SCSI_CONSTANTS=y
SCSI_LOGGING=y
SCSI_SATA=y
SCSI_ATA_PIIX=y
SCSI_SATA_INTEL_COMBINED=y
MD=y
BLK_DEV_MD=m
MD_LINEAR=m
MD_RAID0=m
MD_RAID1=m
MD_RAID10=m
MD_RAID5=m
MD_RAID6=m
MD_MULTIPATH=m
BLK_DEV_DM=m
DM_CRYPT=m
DM_SNAPSHOT=m
DM_MIRROR=m
DM_ZERO=m
NETDEVICES=y
DUMMY=m
TUN=m
NET_ETHERNET=y
MII=m
NET_PCI=y
E100=m
E1000=m
TIGON3=m
PPP=m
PPP_ASYNC=m
PPP_DEFLATE=m
PPP_BSDCOMP=m
INPUT=y
INPUT_MOUSEDEV=y
INPUT_MOUSEDEV_PSAUX=y
INPUT_MOUSEDEV_SCREEN_X=1024
INPUT_MOUSEDEV_SCREEN_Y=768
INPUT_KEYBOARD=y
KEYBOARD_ATKBD=y
INPUT_MOUSE=y
MOUSE_PS2=m
MOUSE_SERIAL=m
SERIO=y
SERIO_I8042=y
SERIO_PCIPS2=m
SERIO_LIBPS2=y
VT=y
VT_CONSOLE=y
HW_CONSOLE=y
SERIAL_8250=y
SERIAL_8250_CONSOLE=y
SERIAL_8250_PCI=y
SERIAL_8250_NR_UARTS=4
SERIAL_8250_RUNTIME_UARTS=4
SERIAL_CORE=y
SERIAL_CORE_CONSOLE=y
UNIX98_PTYS=y
LEGACY_PTYS=y
LEGACY_PTY_COUNT=256
PRINTER=m
RTC=y
HWMON=y
VGA_CONSOLE=y
DUMMY_CONSOLE=y
USB_ARCH_HAS_HCD=y
USB_ARCH_HAS_OHCI=y
USB_ARCH_HAS_EHCI=y
EDAC=y
EDAC_DEBUG=y
EDAC_MM_EDAC=y
EDAC_E7XXX=m
EDAC_E752X=y
EDAC_I82875P=m
EDAC_I82860=m
EDAC_POLL=y
EXT2_FS=y
FS_POSIX_ACL=y
XFS_FS=y
XFS_E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SMP=y
X86_HT=y
X86_BIOS_REBOOT=y
X86_TRAMPOLINE=y
KTIME_SCALAR=y


2006-05-12 07:11:39

by NeilBrown

[permalink] [raw]
Subject: Re: 2.6.17-rc4 md lock held at task exit

On Friday May 12, [email protected] wrote:
> Doing poweroff on 2.6.17-rc4 i386, SMP
>
> BUG halt/4781, lock held at task exit time!
> [f7001b34] {mddev_find}
> .. held by: halt: 4781 [f7cd4030, 118]
> ... acquired at: md_notify_reboot+0x3a/0xa9 [md_mod}
>

I suspect this will fix it.
Is it repeatable? Can you test?

Thanks,
NeilBrown


Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./drivers/md/md.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2006-05-12 16:00:03.000000000 +1000
+++ ./drivers/md/md.c 2006-05-12 17:10:16.000000000 +1000
@@ -5171,8 +5171,10 @@ static int md_notify_reboot(struct notif
printk(KERN_INFO "md: stopping all md devices.\n");

ITERATE_MDDEV(mddev,tmp)
- if (mddev_trylock(mddev))
+ if (mddev_trylock(mddev)) {
do_md_stop (mddev, 1);
+ mddev_unlock(mddev);
+ }
/*
* certain more exotic SCSI devices are known to be
* volatile wrt too early system reboots. While the

2006-05-23 05:58:52

by Keith Owens

[permalink] [raw]
Subject: Re: 2.6.17-rc4 md lock held at task exit

Neil Brown (on Fri, 12 May 2006 17:11:11 +1000) wrote:
>On Friday May 12, [email protected] wrote:
>> Doing poweroff on 2.6.17-rc4 i386, SMP
>>
>> BUG halt/4781, lock held at task exit time!
>> [f7001b34] {mddev_find}
>> .. held by: halt: 4781 [f7cd4030, 118]
>> ... acquired at: md_notify_reboot+0x3a/0xa9 [md_mod}
>>
>
>I suspect this will fix it.
>Is it repeatable? Can you test?
>
>Thanks,
>NeilBrown
>
>
>Signed-off-by: Neil Brown <[email protected]>
>
>### Diffstat output
> ./drivers/md/md.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff ./drivers/md/md.c~current~ ./drivers/md/md.c
>--- ./drivers/md/md.c~current~ 2006-05-12 16:00:03.000000000 +1000
>+++ ./drivers/md/md.c 2006-05-12 17:10:16.000000000 +1000
>@@ -5171,8 +5171,10 @@ static int md_notify_reboot(struct notif
> printk(KERN_INFO "md: stopping all md devices.\n");
>
> ITERATE_MDDEV(mddev,tmp)
>- if (mddev_trylock(mddev))
>+ if (mddev_trylock(mddev)) {
> do_md_stop (mddev, 1);
>+ mddev_unlock(mddev);
>+ }
> /*
> * certain more exotic SCSI devices are known to be
> * volatile wrt too early system reboots. While the

Finally got some time to test this. The problem was reproducable and
the patch fixed it.

Acked-by: Keith Owens <[email protected]>

2006-05-23 06:06:11

by NeilBrown

[permalink] [raw]
Subject: Re: 2.6.17-rc4 md lock held at task exit

On Tuesday May 23, [email protected] wrote:
>
> Finally got some time to test this. The problem was reproducable and
> the patch fixed it.
>
> Acked-by: Keith Owens <[email protected]>

Thanks. I'll make sure it goes in.

NeilBrown