Project

General

Profile

Actions

Bug #8149

closed

deadlock between datalink deletion and kstat read

Added by Prakash Surya about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2017-05-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Using the following stress test:

- Thread 1: In a loop, create and delete etherstub datalinks using:
dladm create-etherstub teststub0
dladm delete-etherstub teststub0
- Thread 2: In a loop, read the link kstat for teststub0.
- Thread 3: Do the same thing as Thread 2

After a while of running the above (~30 seconds), a deadlock ensues,
where Thread 1 is stuck unkillably in `dladm delete-etherstub`, and the
other threads are stuck in the kernel, in `read_kstat_data()` (called
from the `KSTAT_IOC_READ` ioctl). The two kernel threads stuck are:

ffffff03172f0b20 ffffff031d0bc028 ffffff036e341d00   1  59 ffffff038edd40c8
PC: _resume_from_idle+0xf4 CMD: dladm delete-etherstub -t teststub0
stack pointer for thread ffffff03172f0b20: ffffff000cd21810
[ ffffff000cd21810 _resume_from_idle+0xf4() ]
swtch+0x141()
cv_wait+0x70()
kstat_hold+0x4d()
kstat_hold_bykid+0x37()
kstat_delete+0x4e()
dls_devnet_stat_destroy+0x59()
dls_devnet_unset+0x1f3()
dls_devnet_destroy+0x46()
vnic_dev_delete+0x96()
vnic_ioc_delete+0x28()
drv_ioctl+0x1e4()
cdev_ioctl+0x39()
spec_ioctl+0x60()
fop_ioctl+0x55()
ioctl+0x9b()
_sys_sysenter_post_swapgs+0x149()
ffffff031733bb80 ffffff03188bb000 ffffff0315ad5380   1  59 ffffff0315b719d0
PC: _resume_from_idle+0xf4 CMD: /opt/jdk1.8.0_60/bin/java ...
stack pointer for thread ffffff031733bb80: ffffff000c3ea900
[ ffffff000c3ea900 _resume_from_idle+0xf4() ]
swtch+0x141()
turnstile_block+0x21a()
mutex_vector_enter+0x3a3()
dls_devnet_stat_update+0x3c()
read_kstat_data+0xd0()
kstat_ioctl+0x83()
cdev_ioctl+0x39()
spec_ioctl+0x60()
fop_ioctl+0x55()
ioctl+0x9b()
sys_syscall+0x17a()
Actions

Also available in: Atom PDF