Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3365243imu; Mon, 7 Jan 2019 01:54:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xnbb7EfKxJM4b43kLECxCK0KpZT6KyxcQuNoph8/tjthec5RnDkDM0b+m2FIHn8m2x8RFi X-Received: by 2002:a62:f907:: with SMTP id o7mr61240529pfh.244.1546854871101; Mon, 07 Jan 2019 01:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546854871; cv=none; d=google.com; s=arc-20160816; b=pFL6Ab3T2Ow2w3A5hA+u9g90LM30tFMGzY+QW+EZlBFVRtHi/+Rjk8VH9XPh8tVotT kvQ1l0ZmmOJszL+omED083iK9UdLOs6breYAHsH1ItVDmLVGsle64tSb2oL7QhvLWA/u hum17WUSPg+O0OTk5DOZFHL3JFCPnHmJIZcueGmpUDxgGfanXDGsUj7Ix6xtCx28Fc4A G48/RhSYFDzThgK1ksbn0YSHvpVL+F4Xtt0Yaun/N9bNUC5pmd0CuJj1b6P9wl7jduH0 QePZ2ZsZ9E22Zo5T/gSrb30Fc6MDWTtiIlcnMlDpEPYbTdsLtu7r8TFPbx8s9jtwN3yM NoQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3irFOLD/RGLCA8VlcpjIfrS0z0daUKn0uxedVDzoOZc=; b=jXID2O0DGUEGaB4nE9FWFq+vgXL9iuCLcMYcEF6zzKrkwEtKVLiBI1GSEb23vrCJDQ dPWKbbAX9ljUhLHMu8iab4whRasHyY/fEyDRNKNlnF0fxXl3j55QMMDiVdQ1KoXDQB1S TTBpTV3oEwlH8dOnVcGCm2LIhx+djwYDjmsrx4CjpCkcf/sMFqVNsW9Sk4zCPEz/VJHz FnoH8l9mbHZKMTbYxZeD/Trk6yIY0jgDraCrCxnH9BBOTNr8lGDVrQ9H4VOqsVXDTuGs lhfCn9vW75M19eVyNIx8SJh4f3J2OJHpaCTRwNS9e8vs/FjfkoN0MtSyMALLcJgd0hq9 s12A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=NdwgKuRm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n34si53021089pld.381.2019.01.07.01.54.15; Mon, 07 Jan 2019 01:54:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=NdwgKuRm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbfAGJwv (ORCPT + 99 others); Mon, 7 Jan 2019 04:52:51 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35146 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfAGJwu (ORCPT ); Mon, 7 Jan 2019 04:52:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3irFOLD/RGLCA8VlcpjIfrS0z0daUKn0uxedVDzoOZc=; b=NdwgKuRmrMbs1SAYtBuTB9PtB kjeU73j1pQFxyfqCaAbqVMQwFIHjqxs8Vzo6to2zV1TKhVpmHdbCgVihyQpe4GNInhOAgi7VrhWc6 ah9/YnIy3DRTtBgDaiO0Qi8b134PtONFyXeTNGgXNh0JlU66slzRSrHGf6VB88fpdnviygdF0f6uZ ulpRsZV3CLtCGkLaK8cIDY36FGAv0rEB+lqhrEnr+fN4YwV4JeWeNylR5rP+9+7VUuZ/hsnNzg2wS cNpoYVWFUKsYCGxklIZWUuPpenJiSLvlQGaWcufBzXNaLOJcJ60q+Vlk3giHqx8VQ8+7CjBKWxBN5 OclOoUF8A==; Received: from [185.88.64.153] (helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggRZz-00031y-El; Mon, 07 Jan 2019 09:52:19 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id ACAF3983877; Mon, 7 Jan 2019 10:52:17 +0100 (CET) Date: Mon, 7 Jan 2019 10:52:17 +0100 From: Peter Zijlstra To: Vlastimil Babka Cc: syzbot , aarcange@redhat.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@dominikbrodowski.net, mhocko@suse.com, rientjes@google.com, syzkaller-bugs@googlegroups.com, xieyisheng1@huawei.com, zhongjiang@huawei.com, Mel Gorman , Ingo Molnar , hannes@cmpxchg.org Subject: Re: possible deadlock in __wake_up_common_lock Message-ID: <20190107095217.GB2861@worktop.programming.kicks-ass.net> References: <000000000000f67ca2057e75bec3@google.com> <1194004c-f176-6253-a5fd-682472dccacc@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1194004c-f176-6253-a5fd-682472dccacc@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 02, 2019 at 01:51:01PM +0100, Vlastimil Babka wrote: > > -> #3 (&base->lock){-.-.}: > > __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] > > _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152 > > lock_timer_base+0xbb/0x2b0 kernel/time/timer.c:937 > > __mod_timer kernel/time/timer.c:1009 [inline] > > mod_timer kernel/time/timer.c:1101 [inline] > > add_timer+0x895/0x1490 kernel/time/timer.c:1137 > > __queue_delayed_work+0x249/0x380 kernel/workqueue.c:1533 > > queue_delayed_work_on+0x1a2/0x1f0 kernel/workqueue.c:1558 > > queue_delayed_work include/linux/workqueue.h:527 [inline] > > schedule_delayed_work include/linux/workqueue.h:628 [inline] > > psi_group_change kernel/sched/psi.c:485 [inline] > > psi_task_change+0x3f1/0x5f0 kernel/sched/psi.c:534 > > psi_enqueue kernel/sched/stats.h:82 [inline] > > enqueue_task kernel/sched/core.c:727 [inline] > > activate_task+0x21a/0x430 kernel/sched/core.c:751 > > wake_up_new_task+0x527/0xd20 kernel/sched/core.c:2423 > > _do_fork+0x33b/0x11d0 kernel/fork.c:2247 > > kernel_thread+0x34/0x40 kernel/fork.c:2281 > > rest_init+0x28/0x372 init/main.c:409 > > arch_call_rest_init+0xe/0x1b > > start_kernel+0x873/0x8ae init/main.c:741 > > x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470 > > x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451 > > secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 That thing is fairly new; I don't think we used to have this dependency prior to PSI. Johannes, can we move that mod_timer out from under rq->lock? At worst we can use an irq_work to self-ipi.