Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp877583pxb; Thu, 5 Nov 2020 15:50:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf2inxAhjT86Bxk7hMk+U7gTz6QtQ/DnFXrmDgLk3aNgXVkeuNMI0ufcJeNKDtz04SyIzS X-Received: by 2002:a17:906:512:: with SMTP id j18mr4992430eja.370.1604620212831; Thu, 05 Nov 2020 15:50:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604620212; cv=none; d=google.com; s=arc-20160816; b=zMXLPVzxmeim046bhuB2VlLr//ltnLuMCzsrIm1K+6Lo7kmvTL+IgJ+n8cPk7i/m9Z ZUPnUQZMhB0+Qn+AmGiyD2DDDf6+pHXVdoPshWLxsOSqdQmMT2Arra18H4jSCFR4gZXL QRtFVUZplbmDkt2v7R/uMkYhRNxsANnbnBZoKDLE5NoFdRGSs99DSNvi9qcb9xv/6Ymn iNH+du4vEjjcOb1IsFosyTHh+Hyp1gQFdLEJNWHTO/QpGI0+aSq6gm1hU+1a7i3UPqXF AHlZaR0BhUakmpszkhdfOQLMUCt/DMKRgCkoFGQf9Ozy+jWVK0b4NVPDV+iuLg71LFz6 JQmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=MBvM6gvh8FS5Fx3Rne+WkYh59xG29OcXsIPtgm5EET8=; b=A0dJPzfFQSDkR6Ve9uTw2L2i4LFqUhi4NRG8RMwfTBaPnX30av5Q+eIRjMGhWgZE5e ArtUuuSbCjHLCr46j4T2P4NCstbOqItUdBkEkbrXchuWcaF3+W2gPBElbzFiz1JpF+sJ WQFWvgskudliLSYi/YiaIyOH9c61L8N7NWxOq6SfWYlDtDxiuw6ZiQPtChZj2c6Nc03U A0GrcbIkLNVbN61UKAq3iOJIxLCPJDdV1hspT8ypA62CaF4u7z9ivr/KWNIFCFH2Lwq9 uqUEEB5BoVOEpJ1bNx+zr2SKyznWwqfF6/7nX42LFXtpXk/Hsz4Q2JhVr5X6MH1rnU/4 nw4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bqbi7hzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz19si2685408ejb.738.2020.11.05.15.49.50; Thu, 05 Nov 2020 15:50:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bqbi7hzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732905AbgKEXrj (ORCPT + 99 others); Thu, 5 Nov 2020 18:47:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:45930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732723AbgKEXr1 (ORCPT ); Thu, 5 Nov 2020 18:47:27 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 461A422210; Thu, 5 Nov 2020 23:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604620047; bh=EUfmz7vlnAcV4PmVQNw94o5UzBa+JkcC4cHH7Yx8oLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bqbi7hzO5DOwKdOKuerDJ5JqjnfeZND4DjRvrDkpHZyc5QBLA0fXq0dpCEnA5Wku1 eXLl1EIYach9i3OdVkRehcchJ/u1lVKARqzBQoEFxxO5xmt8QIg5zV0HcLyw7NKgBU AyL3/VOb51ut1ijvW6IfpMjzbQmU8baA3pGfszOI= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 15/28] torture: Prevent jitter processes from delaying failed run Date: Thu, 5 Nov 2020 15:47:06 -0800 Message-Id: <20201105234719.23307-15-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201105234658.GA23142@paulmck-ThinkPad-P72> References: <20201105234658.GA23142@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" Even when the kernel panics and qemu dies, runs with jitter enabled will continue uselessly until the jitter.sh processes terminate. This can be annoying if a planned one-hour run instead dies during boot. This commit therefore kills the jitter.sh processes when the run ends more than one minute prior to the termination time specified by the kvm.sh --duration argument or its default. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 14 ++++++++++++++ tools/testing/selftests/rcutorture/bin/kvm.sh | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh index d04966a..3cd03d0 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh @@ -226,6 +226,20 @@ do echo "ps -fp $killpid" >> $resdir/Warnings 2>&1 ps -fp $killpid >> $resdir/Warnings 2>&1 fi + # Reduce probability of PID reuse by allowing a one-minute buffer + if test $((kruntime + 60)) -lt $seconds && test -s "$resdir/../jitter_pids" + then + awk < "$resdir/../jitter_pids" ' + NF > 0 { + pidlist = pidlist " " $1; + n++; + } + END { + if (n > 0) { + print "kill " pidlist; + } + }' | sh + fi else echo ' ---' `date`: "Kernel done" fi diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index 6eb1d3f..5ad3882 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh @@ -459,8 +459,11 @@ function dump(first, pastlast, batchnum) print "if test -n \"$needqemurun\"" print "then" print "\techo ---- Starting kernels. `date` | tee -a " rd "log"; - for (j = 0; j < njitter; j++) + print "\techo > " rd "jitter_pids" + for (j = 0; j < njitter; j++) { print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&" + print "\techo $! >> " rd "jitter_pids" + } print "\twait" print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log"; print "else" -- 2.9.5