Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2233691ybd; Thu, 27 Jun 2019 08:57:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXevcygsC7q0oiYQK4YCNEo+dGNrdxbzJedOiaV1uOX5f9fdiBC04EDtC7doIN8alpgRqH X-Received: by 2002:a17:90b:8d2:: with SMTP id ds18mr7053417pjb.132.1561651078189; Thu, 27 Jun 2019 08:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561651078; cv=none; d=google.com; s=arc-20160816; b=JW1oKKpNcqsUi+wLEhJ/ka2owimpqR9PUxZrup13JNzukzPBCev1sTiVyt9fuK32Ar P2xHWnCXqjmKg6XaovFgrs2amlOxr8das7k5fPzZfYcEiE3drcJlK3yJBKcDLt2zp6Po iDt+5wqGH4YELJ1KjZNgb4L15mT+YmtQIc7fosUBg49ODwIotCn3Ok/lsj/d1nhx2wMG EFAoK2nqPtuZzir8tO1hAF9cpwXUOInk+7KwBDEAe87CGHa1KhhDIEvp9n5K1LtI6P4G zQnSZi2/Jclq3Y2a9G2dOspuNknzNbbkw1q746EqFX9ucITMXZAWMtxkybVV85JI549M jxnA== 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:reply-to:message-id :subject:cc:to:from:date; bh=vndLK9MtkU/Vhf0yQK1QqwpbYytPBjl5m6DWHKLTXRo=; b=goTKer7cNEywUhR3qJ2FW+lZx87+jqjqH74Wa2ube3SQ80IlwpUa8f8n+J8jDHnkt4 V586tvwebXML1vEBdYkXvQEPeqQa0CJfCdA/PIzEDRaPbDKTs09kKI847+18VDx2wAX4 Z0IOC3vNh6eIy/ce1OAApGGKXKrdvelo/LuDNdg+SIB962EoKz3fEUmMrBfTQ3DoLN6g KmmwxDQyfcNCR3c8erQk0gTpldiNtyxOb0z91vRiHnRzOeR4ML4a6dc6/uJ+5LUppSrr 4Bo+271cqQT8cNRJ3mTZVvC2oXQhw1+srZjicpBvgAHV5SP7FfyS+S7a0cg51YY5ax52 dtcg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si2396420pga.411.2019.06.27.08.57.41; Thu, 27 Jun 2019 08:57:58 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbfF0P4A (ORCPT + 99 others); Thu, 27 Jun 2019 11:56:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:14020 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726405AbfF0Pz7 (ORCPT ); Thu, 27 Jun 2019 11:55:59 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5RFpbSY106098; Thu, 27 Jun 2019 11:55:08 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tcy4redr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 11:55:07 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x5RFruBQ112277; Thu, 27 Jun 2019 11:55:07 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tcy4redpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 11:55:06 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x5RFneD7027772; Thu, 27 Jun 2019 15:55:05 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01wdc.us.ibm.com with ESMTP id 2t9by77bub-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 15:55:05 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5RFt4x749414456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 15:55:04 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EB08B2065; Thu, 27 Jun 2019 15:55:04 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80B42B2064; Thu, 27 Jun 2019 15:55:04 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.26]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 27 Jun 2019 15:55:04 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 6515716C2F90; Thu, 27 Jun 2019 08:55:06 -0700 (PDT) Date: Thu, 27 Jun 2019 08:55:06 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , Sebastian Andrzej Siewior , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan Subject: Re: [RFC] Deadlock via recursive wakeup via RCU with threadirqs Message-ID: <20190627155506.GU26519@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <20190626135447.y24mvfuid5fifwjc@linutronix.de> <20190626162558.GY26519@linux.ibm.com> <20190627142436.GD215968@google.com> <20190627103455.01014276@gandalf.local.home> <20190627153031.GA249127@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190627153031.GA249127@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-27_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906270181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 27, 2019 at 11:30:31AM -0400, Joel Fernandes wrote: > On Thu, Jun 27, 2019 at 10:34:55AM -0400, Steven Rostedt wrote: > > On Thu, 27 Jun 2019 10:24:36 -0400 > > Joel Fernandes wrote: > > > > > > What am I missing here? > > > > > > This issue I think is > > > > > > (in normal process context) > > > spin_lock_irqsave(rq_lock); // which disables both preemption and interrupt > > > // but this was done in normal process context, > > > // not from IRQ handler > > > rcu_read_lock(); > > > <---------- IPI comes in and sets exp_hint > > > > How would an IPI come in here with interrupts disabled? > > > > -- Steve > > This is true, could it be rcu_read_unlock_special() got called for some > *other* reason other than the IPI then? > > Per Sebastian's stack trace of the recursive lock scenario, it is happening > during cpu_acct_charge() which is called with the rq_lock held. > > The only other reasons I know off to call rcu_read_unlock_special() are if > 1. the tick indicated that the CPU has to report a QS > 2. an IPI in the middle of the reader section for expedited GPs > 3. preemption in the middle of a preemptible RCU reader section 4. Some previous reader section was IPIed or preempted, but either interrupts, softirqs, or preemption was disabled across the rcu_read_unlock() of that previous reader section. I -think- that this is what Sebastian is seeing. Thanx, Paul > 1. and 2. are not possible because interrupts are disabled, that's why the > wakeup_softirq even happened. > 3. is not possible because we are holding rq_lock in the RCU reader section. > > So I am at a bit of a loss how this can happen :-( > > Spurious call to rcu_read_unlock_special() may be when it should not have > been called? > > thanks, > > - Joel