Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E86B4C05027 for ; Fri, 10 Feb 2023 03:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjBJDKR (ORCPT ); Thu, 9 Feb 2023 22:10:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjBJDKP (ORCPT ); Thu, 9 Feb 2023 22:10:15 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8CE2597A for ; Thu, 9 Feb 2023 19:10:13 -0800 (PST) Received: from kwepemm600005.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PCdvj54vVzRrqx; Fri, 10 Feb 2023 11:07:45 +0800 (CST) Received: from [10.67.109.54] (10.67.109.54) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 10 Feb 2023 11:10:11 +0800 To: CC: Christian Brauner , Juri Lelli , , Ingo Molnar , Peter Zijlstra , Vincent Guittot From: Hui Tang Subject: [bug-report] WARNING in sched_tick_remote Message-ID: <190abf10-eec6-22ce-ee23-651f8d33984a@huawei.com> Date: Fri, 10 Feb 2023 11:09:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.54] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, An warning happen in sched_tick_remote when we do syzkaller test. The syzkaller test run in a qemu with 4 cpus, and nohz_full=3. The warn triggered by WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3). static void sched_tick_remote(struct work_struct *work) { [...] if (!is_idle_task(curr)) { /* * Make sure the next tick runs within a reasonable * amount of time. */ delta = rq_clock_task(rq) - curr->se.exec_start; WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3); } [...] } I debug it and find that a syzkaller thread keep in kernel mode more than 3s. And all unbound kworkers run on the same cpu as the syzkaller thread. The kworker thread doing sched_tick_remote is scheduled more than 3s since last run. Does anyone have a good suggestion for this problem? WARN log as follows: WARNING: CPU: 2 PID: 23866 at kernel/sched/core.c:4142 queued_spin_lock arch/arm64/include/asm/paravirt.h:51 [inline] WARNING: CPU: 2 PID: 23866 at kernel/sched/core.c:4142 do_raw_spin_lock include/linux/spinlock.h:183 [inline] WARNING: CPU: 2 PID: 23866 at kernel/sched/core.c:4142 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:129 [inline] WARNING: CPU: 2 PID: 23866 at kernel/sched/core.c:4142 rq_lock_irq kernel/sched/sched.h:1373 [inline] WARNING: CPU: 2 PID: 23866 at kernel/sched/core.c:4142 sched_tick_remote+0x384/0x400 kernel/sched/core.c:4129 Modules linked in: CPU: 2 PID: 23866 Comm: kworker/u8:3 Not tainted 5.10.0-02029-gf83322d59c08-dirty #1 Hardware name: linux,dummy-virt (DT) Workqueue: events_unbound sched_tick_remote pstate: 20400085 (nzCv daIf +PAN -UAO -TCO BTYPE=--) pc : sched_tick_remote+0x384/0x400 kernel/sched/core.c:4142 lr : sched_tick_remote+0x1e4/0x400 kernel/sched/core.c:4141 sp : ffffa00019347ba0 x29: ffffa00019347ba0 x28: ffff0000e2a8c110 x27: 0000000000000000 x26: ffffa00014af6e88 x25: ffff000224cbc4f8 x24: ffffa00014b45840 x23: 000000013afb24ae x22: 1ffff40003268f80 x21: ffff000224cbfa28 x20: ffff0000c0e53e80 x19: ffff000224cbbb40 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000002 x12: ffff940003268f85 x11: 1ffff40003268f84 x10: ffff940003268f84 x9 : ffffa000101bece8 x8 : 0000000000000003 x7 : 0000000000000001 x6 : ffff940003268f84 x5 : ffff0000d63229c0 x4 : dfffa00000000000 x3 : ffffa000101c33f4 x2 : 0000000000000007 x1 : 0000026d1ef2161e x0 : 00000000b2d05e00 Call trace: queued_spin_lock arch/arm64/include/asm/paravirt.h:51 [inline] do_raw_spin_lock include/linux/spinlock.h:183 [inline] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:129 [inline] rq_lock_irq kernel/sched/sched.h:1373 [inline] sched_tick_remote+0x384/0x400 kernel/sched/core.c:4129 process_one_work+0x474/0xb20 kernel/workqueue.c:2280 worker_thread+0x120/0x92c kernel/workqueue.c:2426 kthread+0x20c/0x25c kernel/kthread.c:313 ret_from_fork+0x10/0x18 arch/arm64/kernel/entry.S:1034