FYI, we noticed the following commit (built with gcc-7):
commit: f4dfad99bfe39733564e94ee520f902ae209705d ("sched/core: Prevent race condition
between cpuset and __sched_setscheduler()")
https://github.com/jlelli/linux.git fixes/deadline/root-domain-account-v7
in testcase: trinity
with following parameters:
runtime: 300s
test-description: Trinity is a linux system call fuzz tester.
test-url:
http://codemonkey.org.uk/projects/trinity/
on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 2G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
+-------------------------------------------------+------------+------------+
| | c61fc953c4 | f4dfad99bf |
+-------------------------------------------------+------------+------------+
| boot_successes | 5 | 0 |
| boot_failures | 1 | 4 |
| BUG:soft_lockup-CPU##stuck_for#s | 1 | 1 |
| EIP:drm_mm_insert_node_in_range | 1 | 1 |
| Kernel_panic-not_syncing:softlockup:hung_tasks | 1 | 1 |
| WARNING:inconsistent_lock_state | 0 | 4 |
| inconsistent{IN-HARDIRQ-W}->{HARDIRQ-ON-W}usage | 0 | 4 |
+-------------------------------------------------+------------+------------+
[ 19.549992] WARNING: inconsistent lock state
[ 19.549992] 5.1.0-rc1-00005-gf4dfad9 #113 Not tainted
[ 19.549992] --------------------------------
[ 19.549992] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[ 19.549992] swapper/1 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 19.549992] (ptrval) (&rq->lock){?.-.}, at: __task_rq_lock+0x30/0x72
[ 19.549992] {IN-HARDIRQ-W} state was registered at:
[ 19.549992] lock_acquire+0xe9/0x107
[ 19.549992] _raw_spin_lock+0x21/0x30
[ 19.549992] scheduler_tick+0x1d/0x95
[ 19.549992] update_process_times+0x34/0x37
[ 19.549992] tick_periodic+0x98/0xa4
[ 19.549992] tick_handle_periodic+0x13/0x4f
[ 19.549992] timer_interrupt+0xf/0x16
[ 19.549992] __handle_irq_event_percpu+0xb5/0x1c2
[ 19.549992] handle_irq_event_percpu+0x19/0x3f
[ 19.549992] handle_irq_event+0x29/0x42
[ 19.549992] handle_level_irq+0x88/0xb4
[ 19.549992] handle_irq+0x6b/0xb6
[ 19.549992] irq event stamp: 23
[ 19.549992] hardirqs last enabled at (23): [<41d69539>]
_raw_spin_unlock_irq+0x22/0x2c
[ 19.549992] hardirqs last disabled at (22): [<41d69384>]
_raw_spin_lock_irq+0xc/0x36
[ 19.549992] softirqs last enabled at (18): [<41d6aeac>]
__do_softirq+0x28c/0x2ba
[ 19.549992] softirqs last disabled at (13): [<41005d27>] call_on_stack+0x40/0x46
[ 19.549992]
[ 19.549992] other info that might help us debug this:
[ 19.549992] Possible unsafe locking scenario:
[ 19.549992]
[ 19.549992] CPU0
[ 19.549992] ----
[ 19.549992] lock(&rq->lock);
[ 19.549992] <Interrupt>
[ 19.549992] lock(&rq->lock);
[ 19.549992]
[ 19.549992] *** DEADLOCK ***
[ 19.549992]
[ 19.549992] 1 lock held by swapper/1:
[ 19.549992] #0: (ptrval) (&p->pi_lock){+.+.}, at:
__sched_setscheduler+0xe8/0x52b
[ 19.549992]
[ 19.549992] stack backtrace:
[ 19.549992] CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-rc1-00005-gf4dfad9 #113
[ 19.549992] Call Trace:
[ 19.549992] dump_stack+0x16/0x18
[ 19.549992] print_usage_bug+0x1f0/0x1fa
[ 19.549992] mark_lock+0x32f/0x472
[ 19.549992] __lock_acquire+0x2f0/0xe2e
[ 19.549992] ? __lock_acquire+0x20e/0xe2e
[ 19.549992] lock_acquire+0xe9/0x107
[ 19.549992] ? __task_rq_lock+0x30/0x72
[ 19.549992] _raw_spin_lock+0x21/0x30
[ 19.549992] ? __task_rq_lock+0x30/0x72
[ 19.549992] __task_rq_lock+0x30/0x72
[ 19.549992] __sched_setscheduler+0xf2/0x52b
[ 19.549992] _sched_setscheduler+0x68/0x70
[ 19.549992] sched_setscheduler_nocheck+0x1f/0x21
[ 19.549992] __kthread_create_on_node+0xfd/0x11e
[ 19.549992] kthread_create_on_node+0x18/0x1a
[ 19.549992] create_worker+0xa2/0x11e
[ 19.549992] ? process_scheduled_works+0x22/0x22
[ 19.549992] workqueue_init+0x9d/0x102
[ 19.549992] ? rest_init+0x108/0x108
[ 19.549992] kernel_init_freeable+0x30/0x261
[ 19.549992] ? rest_init+0x108/0x108
[ 19.549992] kernel_init+0x8/0xd0
[ 19.549992] ret_from_fork+0x33/0x40
[ 19.582773] Performance Events: no PMU driver, software events only.
[ 19.657957] NMI watchdog: Perf NMI watchdog permanently disabled
[ 19.747678] devtmpfs: initialized
[ 20.441420] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns:
19112604462750000 ns
[ 20.463487] futex hash table entries: 16 (order: -3, 704 bytes)
[ 20.513740] xor: automatically using best checksumming function avx
[ 20.531164] pinctrl core: initialized pinctrl subsystem
[ 20.585967] regulator-dummy: no parameters
[ 20.643658] NET: Registered protocol family 16
[ 20.856939] cpuidle: using governor ladder
[ 21.135177] ACPI: bus type PCI registered
[ 21.234115] PCI: PCI BIOS area is rw and x. Use pci=nobios if you want it NX.
[ 21.252069] PCI: PCI BIOS revision 2.10 entry at 0xfd501, last bus=0
[ 21.281678] PCI: Using configuration type 1 for base access
[ 21.670940] random: fast init done
[ 22.118956] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 22.183623] cryptd: max_cpu_qlen set to 1000
[ 22.410884] raid6: sse2x2 gen() 88 MB/s
[ 22.601685] raid6: sse2x2 xor() 271 MB/s
[ 22.792282] raid6: sse2x1 gen() 12 MB/s
[ 22.981381] raid6: sse2x1 xor() 381 MB/s
[ 23.172166] raid6: sse1x2 gen() 32 MB/s
[ 23.362778] raid6: sse1x1 gen() 8 MB/s
[ 23.370357] raid6: using algorithm sse2x2 gen() 88 MB/s
[ 23.381153] raid6: .... xor() 271 MB/s, rmw enabled
[ 23.390425] raid6: using ssse3x1 recovery algorithm
[ 23.415221] gpio-f7188x: Not a Fintek device at 0x0000002e
[ 23.434667] gpio-f7188x: Not a Fintek device at 0x0000004e
[ 23.504128] ACPI: Added _OSI(Module Device)
[ 23.521917] ACPI: Added _OSI(Processor Device)
[ 23.541403] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 23.551537] ACPI: Added _OSI(Processor Aggregator Device)
[ 23.583167] ACPI: Added _OSI(Linux-Dell-Video)
[ 23.612856] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 23.637000] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[ 23.833938] ACPI: 1 ACPI AML tables successfully acquired and loaded
To reproduce:
# build kernel
cd linux
cp config-5.1.0-rc1-00005-gf4dfad9 .config
make HOSTCC=gcc-7 CC=gcc-7 ARCH=i386 olddefconfig
make HOSTCC=gcc-7 CC=gcc-7 ARCH=i386 prepare
make HOSTCC=gcc-7 CC=gcc-7 ARCH=i386 modules_prepare
make HOSTCC=gcc-7 CC=gcc-7 ARCH=i386 SHELL=/bin/bash
make HOSTCC=gcc-7 CC=gcc-7 ARCH=i386 bzImage
git clone
https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
Thanks,
Rong Chen