Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3999842imu; Mon, 7 Jan 2019 13:31:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN7DpX2T+U1Ky46TUwXrVdD2+OX1Lfet2hIzoEwFAhAbaPykiDWcnaEt/vBXrMWXEvVr3DYU X-Received: by 2002:a62:6047:: with SMTP id u68mr10710507pfb.239.1546896677939; Mon, 07 Jan 2019 13:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546896677; cv=none; d=google.com; s=arc-20160816; b=tsIscxPLMxjO61zgwBMGLnX+CqFbNQcfDf5Fd7n1qsCK+4yso5l6KyjrkZEcpB1xWY mP65eoMbfzkqTJ69xDDEASnkeox1w+CX0U0INYBoCib3Lu0AnCQBMbUCe8yBeiR/NIkl UKzgfCMBcfZv4lS2VqIMR/D209TKEDA5CAyKfkQVRnhg8Ys4m96sYdvyqFpz7sQR+u5e b/Omr5RCOVhUVGOK/+a3CODomN0EtKbkm1kmdvefXlOU/cq8LbfRXycaXbdQzPFESuNC LRYlJ2Vrgp67phGF2IbVgoZ+Rq5K+ucYQ4RfPo7fA+98cffy8LFvw1etnHNY2ihssRFm vVzA== 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=uieQqH+rm+7/7n+3FkuRrxe4KYrhKmvhF8kl3osse5c=; b=GBg8uilBkMVdpnWVKzNM1/gLVAi1wXqb0hgdvG3iJTAliN7dFHR8MuEvhd/xeR6v7r r8mLjj1PR/0WAxU3Vyn5aeJbcbfE14BihITvTmUBqPhfFe1f2W0c1Rodz+AmZEqKVwwH HxnJee0Dn3sGrN6hw1y4xb4c3+zAWbt6sSogxOWkiiAL7WHht4le/ndzEbSGPbpX2pkb O5YyNsbmrZSrziHaynNV4ML/r99wBwxDPSNnCgHlZw03fwUKSuIz2sNNr6ZAq443NlJg Md1k++HnWnridSHOrQ592sIY6f5Y636GWLW6YAjM78kQccQIzisejHboQDS2ov8smc+r 7Bcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VGR54e64; 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 a6si1338838pfo.90.2019.01.07.13.31.02; Mon, 07 Jan 2019 13:31:17 -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=bombadil.20170209 header.b=VGR54e64; 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 S1726936AbfAGV3n (ORCPT + 99 others); Mon, 7 Jan 2019 16:29:43 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45894 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfAGV3n (ORCPT ); Mon, 7 Jan 2019 16:29:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=uieQqH+rm+7/7n+3FkuRrxe4KYrhKmvhF8kl3osse5c=; b=VGR54e64vZUYgLowu4apKAW1i +bME1+qWt2IRfxsinal6Fb9et/zazf0RzQpiP03F5Xw0ClSTMO2bkiKYMrh67nB0yfQdWiHYk3jTo z2m4FhHPkwvr/y3TKK8hYdRSLWdrTUQRviPEYhU+vpAyKaTLbrD3nD52vVEzEDwmlfKjqogwo6qjW E01LDUf7NSCJ4Z8Pq2VBziIv9j/dftU/b9se4WVuN2gtdC2i8bXJRORad5g5evSNDHeA4L8nedjwW PxO4fe4ZifeTnvvFUOC7czwOc/SmhaqhwLMbtkUocYYlFtIDhEtUU3aZ4Hf7UCRNaQvIm8lWkQso+ atVBE9guA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggcSZ-0005Fz-KS; Mon, 07 Jan 2019 21:29:23 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 00A5E20170508; Mon, 7 Jan 2019 22:29:21 +0100 (CET) Date: Mon, 7 Jan 2019 22:29:21 +0100 From: Peter Zijlstra To: Johannes Weiner Cc: Vlastimil Babka , 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 Subject: Re: possible deadlock in __wake_up_common_lock Message-ID: <20190107212921.GK14122@hirez.programming.kicks-ass.net> References: <000000000000f67ca2057e75bec3@google.com> <1194004c-f176-6253-a5fd-682472dccacc@suse.cz> <20190107095217.GB2861@worktop.programming.kicks-ass.net> <20190107204627.GA25526@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190107204627.GA25526@cmpxchg.org> 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 Mon, Jan 07, 2019 at 03:46:27PM -0500, Johannes Weiner wrote: > Hm, so the splat says this: > > wakeups take the pi lock > pi lock holders take the rq lock > rq lock holders take the timer base lock (thanks psi) > timer base lock holders take the zone lock (thanks kasan) > problem: now a zone lock holder wakes up kswapd > > right? And we can break the chain from the VM or from psi. Yep. And since PSI it the latest addition to that chain, I figured we ought maybe not do that. But I've not looked at a computer in 2 weeks, so what do I know ;-) > I cannot say one is clearly cleaner than the other, though. With kasan > allocating from inside the basic timer code, those locks leak out from > kernel/* and contaminate the VM locking anyway. > > Do you think the rq->lock -> base->lock ordering is likely to cause > issues elsewhere? Not sure; we nest the hrtimer base lock under rq->lock (at the time I fixed hrtimers to not hold it's base lock over the timer function callback, just like regular timers already did) and that has worked fine. So maybe we should look at the kasan thing.. dunno.