Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1868854ybh; Sun, 4 Aug 2019 11:42:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlxqLgGj+cTJ7m6emR2oywKitGcRhSeD35eLamUZXtQdtQOHu2KtovrZeYZtyKUbtEyg5r X-Received: by 2002:a17:902:4681:: with SMTP id p1mr17031624pld.256.1564944178148; Sun, 04 Aug 2019 11:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564944178; cv=none; d=google.com; s=arc-20160816; b=inatixSwX4NXwC5cqXvlgviJxUjTW+C/JxUluxPd1Jv/r3NJ2wam/pMeTmYIKLU06t atUKNY1A+lIzGnRQlDJUGVhiaT8yq5ITrlu34a5tYHfTDe/dNssSJ2o3huGQWK4Wrd/I GawAFCLvCCDU2Q0A4es/9N4wHcbwruP/tQ86nVx5kLYJdG5YiPuXhxFAJIdG+tZDYZLq AmN2//W1rn/um/JKXB9gDLw55DsHcx/+16PfGJNDwP3YrntioyCWD/eNU7yyROsqb98j 2iVboi2CS0dpt9V2NecT5TqxJxYR9TZIZZUPAKn4n2qsX1oJaNdinJT1J5RPTUSCaimf xR3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=ZNOtnQsr/jDD/A5JV3GCIs8g2eakKm0Fu43SAHPKwZg=; b=Ml1I2ykcExp8vD4mvAYf3yH2M5nczvXObc7TlCLDbh4hDHyvB1x5kg0MVtp8QgLds5 VLTomMePffk2vUfVamYHThok/RC5So6FcGJNkGzyjvwliH8V1QlFqnEXLVedeNlDGrks +XA2HUqrt76bs+SHY4mmwrgjGv33gHH1G+G5mJi2nOxfFTuyEP+grRl3vxZpY7+oIfvH OhW/uf3UMY4vWqJ+Fgc3emZpOtDY5cDaDMas3Syo6yqrU0AiADE9e8D5QhCJdxySxauP x7KwmqraAii3fVzzxx7NxJi1kolQcRlDkmF01PPc/91RFlFDhSmYDu8rZNlULoS9/eJk qoZg== 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 i189si45665154pge.253.2019.08.04.11.42.40; Sun, 04 Aug 2019 11:42: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 S1726620AbfHDSmG (ORCPT + 99 others); Sun, 4 Aug 2019 14:42:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:20732 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726392AbfHDSmG (ORCPT ); Sun, 4 Aug 2019 14:42:06 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x74IfiCW095000 for ; Sun, 4 Aug 2019 14:42:04 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u5qbsdu40-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 04 Aug 2019 14:42:04 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 4 Aug 2019 19:42:03 +0100 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 4 Aug 2019 19:41:58 +0100 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 x74Ifvc09765776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Aug 2019 18:41:57 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1201B2064; Sun, 4 Aug 2019 18:41:56 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE13EB205F; Sun, 4 Aug 2019 18:41:56 +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 18:41:56 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 28A8F16C9A4A; Sun, 4 Aug 2019 11:41:59 -0700 (PDT) Date: Sun, 4 Aug 2019 11:41:59 -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 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190804144835.GB2386@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19080418-0072-0000-0000-000004505415 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011551; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01242078; UDB=6.00655111; IPR=6.01023520; MB=3.00028039; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-04 18:42:02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19080418-0073-0000-0000-00004CC156E9 Message-Id: <20190804184159.GC28441@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-04_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-1906280000 definitions=main-1908040217 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 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. Thanx, Paul