Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp631313ybl; Fri, 9 Aug 2019 11:10:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeoufAoZI3SV9Y61D8q+b56JOFyerJ01Z81xv0f7WiUQvmLUI8pCqSrrZIH+/kILrPfzno X-Received: by 2002:a17:90a:9903:: with SMTP id b3mr10573735pjp.80.1565374211831; Fri, 09 Aug 2019 11:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565374211; cv=none; d=google.com; s=arc-20160816; b=pfF3B0aLkWt/yp0+SgoH3rDhNu/F+8BheCDvYMow3spK8MkXIXwLGbBVyfvCFKClp/ ovQu/qudePaxzw6D8iodN2FjBI4hxHeUkbKnaNcA2soqCg9mIFYPoEd9zYnfeNJ8nJwS NZWAmycCuxtbnLAXPODL+x05j77LjbFwaqH+iSsS0WMxQPM/sVZzdTWB1nA+RFa0sqd0 LAXMETZEGfqggyRWDmn2cYYOdyM8l7kTyiIiLwEse+bsVVQX6TPSLID7IEcYUpTVFkN6 gMV0eeyAP9ubCac6p9O+unjbANcaNTeF0aRZg1tjQKcqArkLhhu1lvJpWIgNwNRJffXU lwrg== 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=A8u6xz/dyTLZLo8WFi4XrNKF86SJ1n86/Q6ZMmMptYg=; b=mGKl5MDa2rMoWLTcPXLdk5BHVWx2LnTuCK9g3VF/vZz/lAE4q11dInJrwT3KIsDgZI nD1ewcfeHyDng20cXiQCw1lio3JB+4YIV6yoLmRjCWiRavStPFhzAH3tOC9J03Ra2isk DQc5TqxoHOCyo6+x4XGApgJIDrJyG4Mls1PmtCc0D5IfWT7Xlj1z79rtUO6DBUwFXI8E 0cMqxQldflfkB2sIE1D9u5GgITm6OAQRU/GYyLyObCN/sUlWrhY6Z+y6ENTZ+hTellAb fABiD/wpSUq9orJK/5ZS+xPqmCoqzJZEo3cH9Ou4s15g2KHWN0b1CI/oV0rsFAgRscV8 FjDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=kx6+mVWS; 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 w12si18341427pgt.397.2019.08.09.11.09.55; Fri, 09 Aug 2019 11:10:11 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=kx6+mVWS; 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 S2437371AbfHISHZ (ORCPT + 99 others); Fri, 9 Aug 2019 14:07:25 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34750 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbfHISHY (ORCPT ); Fri, 9 Aug 2019 14:07:24 -0400 Received: by mail-pl1-f196.google.com with SMTP id i2so45292527plt.1 for ; Fri, 09 Aug 2019 11:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=A8u6xz/dyTLZLo8WFi4XrNKF86SJ1n86/Q6ZMmMptYg=; b=kx6+mVWSGuvNvigzmgMGMPha4xfouHeFaHvkOz5Dvpelc/XzhpByC2ohmY105RhaUD ogW2EsEmwHgW/EjYP3Th0/dAKd38FuBtl40pfyIWcTR4P8OVHl1b8Q4LqEX82ttM+ao8 WdjLBGeXZx7iiBb66qNDPFVvOAuyZMMozh7mQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A8u6xz/dyTLZLo8WFi4XrNKF86SJ1n86/Q6ZMmMptYg=; b=e4ZkcHGIytKh3XPtmfbfL1U5sjjIr8wBcf0zE011LRBULc1BACbsoEiD4jGWQe3rox oStDFvs1aY6MnMs3bXDB9FI+QQKQqIaZHUxiWYI3xla3BslphItEOECBBw8YCptHMyvk n0zBrUxF5tVYDjASQyFiRxwPtvZxnALG1eZSh9IQZbVD2oMZYDS+1Ezywz0uTcUIJkMP YFLuARGgSMozX663bLeiZEDPirrgCmkPhjyTmQa1iAe+42WIJ4F5wS35nLzUKsGaZCsu +0odpZEZE0N5O+ikkeB44ivX9eWuls74elvaWK+womhF8BVtrlxnmRps69KiUwdegTwM EdUQ== X-Gm-Message-State: APjAAAUkrh9/trR6JtkngOBlL1WtuAVOcn8kkS52TJVtWUp7NUtkcugE 3oL6FXpiW2z8JiFuM2rydly1cw== X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr20203663plb.283.1565374043636; Fri, 09 Aug 2019 11:07:23 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id y11sm107017072pfb.119.2019.08.09.11.07.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 09 Aug 2019 11:07:22 -0700 (PDT) Date: Fri, 9 Aug 2019 14:07:21 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: Peter Zijlstra , 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 Subject: Re: [PATCH RFC tip/core/rcu 14/14] rcu/nohz: Make multi_cpu_stop() enable tick on all online CPUs Message-ID: <20190809180721.GA255533@google.com> References: <20190804184159.GC28441@linux.ibm.com> <20190805080531.GH2349@hirez.programming.kicks-ass.net> <20190805145448.GI28441@linux.ibm.com> <20190805155024.GK2332@hirez.programming.kicks-ass.net> <20190805174800.GK28441@linux.ibm.com> <20190806180824.GA28448@linux.ibm.com> <20190807214131.GA15124@linux.ibm.com> <20190808203541.GA8160@linux.ibm.com> <20190808213012.GA28773@linux.ibm.com> <20190809165120.GA5668@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190809165120.GA5668@linux.ibm.com> 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 Fri, Aug 09, 2019 at 09:51:20AM -0700, Paul E. McKenney wrote: > > > > And of course I forgot to dump out the online CPUs, so I really had no > > > > idea whether or not all the CPUs were accounted for. I added tracing > > > > to dump out the online CPUs at the beginning of __stop_cpus() and then > > > > reworked it a few times to get the problem to happen in reasonable time. > > > > Please see below for the resulting annotated trace. > > > > > > > > I was primed to expect a lost IPI, perhaps due to yet another qemu bug, > > > > but all the migration threads are running within about 2 milliseconds. > > > > It is then almost two minutes(!) until the next trace message. > > > > > > > > Looks like time to (very carefully!) instrument multi_cpu_stop(). > > > > > > > > Of course, if you have any ideas, please do not keep them a secret! > > > > > > Functionally, multi_cpu_stop() is working fine, according to the trace > > > below (search for a line beginning with TAB). But somehow CPU 2 took > > > almost three -minutes- to do one iteration of the loop. The prime suspect > > > in that loop is cpu_relax() due to the hypervisor having an opportunity > > > to do something at that point. The commentary below (again, search for > > > a line beginning with TAB) gives my analysis. > > > > > > Of course, if I am correct, it should be possible to catch cpu_relax() > > > in the act. That is the next step, give or take the Heisenbuggy nature > > > of this beast. > > > > > > Another thing for me to try is to run longer with !NO_HZ_FULL, just in > > > case the earlier runs just got lucky. > > > > > > Thoughts? > > > > And it really can happen: > > > > [ 1881.467922] migratio-33 4...1 1879530317us : stop_machine_yield: cpu_relax() took 756140 ms > > > > The previous timestamp was 1123391100us, so the cpu_relax() is almost > > exactly the full delay. > > > > But another instance stalled for many minutes without a ten-second > > cpu_relax(). So it is not just cpu_relax() causing trouble. I could > > rationalize that vCPU preemption being at fault... > > > > And my diagnostic patch is below, just in case I am doing something > > stupid with that. > > I did a 12-hour run with the same configuration except for leaving out the > "nohz_full=1-7" kernel parameter without problems (aside from the RCU CPU > stall warnings due to the ftrace_dump() at the end of the run -- isn't > there some way to clear the ftrace buffer without actually printing it?). I think if tracing_reset_all_online_cpus() is exposed, then calling that with the appropriate locks held can reset the ftrace ring buffer and clear the trace. Steve, is there a better way? thanks, - Joel