Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1936868ybh; Sun, 4 Aug 2019 13:26:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVR7l7qMPKatKTBzkVYKW/vtyH/YtJIqZVcLsbmOdsLWGup8KKR6BqsSZtCVl4CXBVwIkD X-Received: by 2002:a17:902:e2:: with SMTP id a89mr142357504pla.210.1564950390683; Sun, 04 Aug 2019 13:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564950390; cv=none; d=google.com; s=arc-20160816; b=CA9OrHlqzygc6LSZZjHaE+MBIcsC3IQgq4QUoCrV38o1FUX/3B9gXaeNFOTXimUgiR w8dHNjWbIq2Cr4oKnVHW2hFciBUwXbnhJgub8ThAH30Qs9+lRbGbFw3WZS5KvmQmhyIB lseD9OqjqEyEiecrwRN7NuvdrOR8pY0HkudSNS+Hypfd33iyu4HY+nwy3k6/oNaFOdZy /U1z26QRKL81sCGtj04ELbaThaP87g1LfXwaBH1h6JdvULwyLVqANGwC2naQl9o0+C1J 1lj75RDnYnxL0k+6qxh8NDePlR1izwk+Kl64Br5E/Oaz6kGCv831vUFDw+sgTp5nXk6z ELig== 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=+RGFArX9VsCqIf/Q39j3a6eUXk+EEUSXN2jpgHNfGfw=; b=jCzjFEPqP9lz1Zw/ysHu7shA02yRjD8VhQgJbSmSfYpDwIyZjXd1uCmZC477zbV7uI ZPsi1UdmCRF3ziPf471gk1fjyHRDVdEX2IVU+n1w3Op6pyj7d29wNOcSb3RQyt2fuVHr tOnaX8/zyqljwSPPxYcq66AEfzKjh2CuhPaxfsS1w+HEj1w7Fs9ltYDeEboMgz64cu/O WiJmlHPJFAp8qifOCKIz4T7rp4ApvXD6FozZo4rsUqhnNvZHodN6qO/p06JdltFSfz+y 33ah1w7gEI20Y2+K8fQbELUPQ1kM8V/5jrXr/rtSjy16ZBEL2HnVd7YcFPF77GEE2YJ2 h+UA== 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 r1si41856119pls.69.2019.08.04.13.26.14; Sun, 04 Aug 2019 13:26:30 -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 S1726693AbfHDUZj (ORCPT + 99 others); Sun, 4 Aug 2019 16:25:39 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:63702 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726392AbfHDUZj (ORCPT ); Sun, 4 Aug 2019 16:25:39 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x74KMBpc018760; Sun, 4 Aug 2019 16:24:46 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u5qn6g5u0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 16:24:46 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x74KMcs7019432; Sun, 4 Aug 2019 16:24:46 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u5qn6g5tr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 16:24:45 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x74KOjE3004344; Sun, 4 Aug 2019 20:24:45 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02wdc.us.ibm.com with ESMTP id 2u51w612af-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 20:24:45 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x74KOi8A10945276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Aug 2019 20:24:44 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBC96B205F; Sun, 4 Aug 2019 20:24:44 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86269B2064; Sun, 4 Aug 2019 20:24:44 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.150.228]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sun, 4 Aug 2019 20:24:44 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id EEA0016C9A2E; Sun, 4 Aug 2019 13:24:46 -0700 (PDT) Date: Sun, 4 Aug 2019 13:24:46 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org Subject: Re: [PATCH RFC tip/core/rcu 14/14] rcu/nohz: Make multi_cpu_stop() enable tick on all online CPUs Message-ID: <20190804202446.GA25634@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <20190802151435.GA1081@linux.ibm.com> <20190802151501.13069-14-paulmck@linux.ibm.com> <20190804144317.GF2349@hirez.programming.kicks-ass.net> <20190804144835.GB2386@hirez.programming.kicks-ass.net> <20190804184159.GC28441@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190804184159.GC28441@linux.ibm.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-08-04_11:,, 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-1906280000 definitions=main-1908040238 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 04, 2019 at 11:41:59AM -0700, Paul E. McKenney wrote: > On Sun, Aug 04, 2019 at 04:48:35PM +0200, Peter Zijlstra wrote: > > On Sun, Aug 04, 2019 at 04:43:17PM +0200, Peter Zijlstra wrote: > > > On Fri, Aug 02, 2019 at 08:15:01AM -0700, Paul E. McKenney wrote: > > > > The multi_cpu_stop() function relies on the scheduler to gain control from > > > > whatever is running on the various online CPUs, including any nohz_full > > > > CPUs running long loops in kernel-mode code. Lack of the scheduler-clock > > > > interrupt on such CPUs can delay multi_cpu_stop() for several minutes > > > > and can also result in RCU CPU stall warnings. This commit therefore > > > > causes multi_cpu_stop() to enable the scheduler-clock interrupt on all > > > > online CPUs. > > > > > > This sounds wrong; should we be fixing sched_can_stop_tick() instead to > > > return false when the stop task is runnable? > > Agreed. However, it is proving surprisingly hard to come up with a > code sequence that has the effect of rcu_nocb without nohz_full. > And rcu_nocb works just fine. With nohz_full also in place, I am > decreasing the failure rate, but it still fails, perhaps a few times > per hour of TREE04 rcutorture on an eight-CPU system. (My 12-CPU > system stubbornly refuses to fail. Good thing I kept the eight-CPU > system around, I guess.) > > When I arrive at some sequence of actions that actually work reliably, > then by all means let's put it somewhere in the NO_HZ_FULL machinery! > > > And even without that; I don't understand how we're not instantly > > preempted the moment we enqueue the stop task. > > There is no preemption because CONFIG_PREEMPT=n for the scenarios still > having trouble. Yes, there are cond_resched() calls, but they don't do > anything unless the appropriate flags are set, which won't always happen > without the tick, apparently. Or without -something- that isn't always > happening as it should. > > > Any enqueue, should go through check_preempt_curr() which will be an > > instant resched_curr() when we just woke the stop class. > > I did try hitting all of the CPUs with resched_cpu(). Ten times on each > CPU with a ten-jiffy wait between each. This might have decreased the > probability of excessively long CPU-stopper waits by a factor of two or > three, but it did not eliminate the excessively long waits. > > What else should I try? > > For example, are there any diagnostics I could collect, say from within > the CPU stopper when things are taking too long? I see CPU-stopper > delays in excess of five -minutes-, so this is anything but subtle. For whatever it is worth, the things on my list include using 25 rounds of resched_cpu() on each CPU with ten-jiffy wait between each (instead of merely 10 rounds), using waitqueues or some such to actually force a meaningful context switch on the other CPUs, etc. Thanx, Paul