Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10131780imu; Wed, 5 Dec 2018 17:01:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/VAo45H05EsaeCDFihoSpk4g9LW2rhK4fFbYi33mEpUuo/QqvSbQ15+9IY570NGtJsEciwR X-Received: by 2002:a62:848d:: with SMTP id k135mr26303447pfd.47.1544058065396; Wed, 05 Dec 2018 17:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544058065; cv=none; d=google.com; s=arc-20160816; b=ZbivUaxJh8L/wvV2w/j667BNpTb1T9Ct+L8ohKp86kcPjxFxXzFh/x24tTFqT8eU+n Q/Kwl3NUa3OfAosbuxlPGAZnFC8pRcV5sF4AFKNRRjH6IjMMEoOHBJBx50alqfzoj6CM IuZnyWrBR1YZ+DuwsA2W6DsGMsfhSHbRPRzbKngpkn2IFlnveh0moxkf8iLTz6H8KUCv MVh2Iu2pXvH12t2Vc1tiglvjhylKHZWHWItNX/O/T7CAzpzJ+FRJYu5sKnpKpXqPBnI0 nM26VKUXFTRlfbr+ZnYSOTXSlL1y+IGkz1J8xUtEIlFA4m7Bc2mbFGc3Lj+F5COGBqL3 N8Vw== 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; bh=d3NnZHxRWEsPmIT9kF2gEI3DVnS7FP9wqGM0HUTSylA=; b=mzH+rASRqXEq24ClmcVZTru7nRsv/ZcNLVKlqlCMqS4gXl642NuZbjS8MHdM2fwQAW fNTAXvNx8oSOcHxZHWPhFbo1mClWDEfuj6V9GxVcc94AQ4dMazlU/soIsY7dgR0qS3RT CoHqkMInUk7NzSELf8PxWzmC8ZjWCkINylJWgQkF+72pzxQWXoV2Wl/yY9yD05rVpTq2 WU6RB1tDsZvTaJQ7susdSEEsoRx65hwUy18X/EfTls663BMBLOTEhoAeskedL40rLQ0C vqoH68mZNh2j0d1WcROL3QjZyyEFu7aMFhHmJgQ74emUq3Tw9A5HXy02bB+gNhi+nbyL pMUg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si17512848pfm.100.2018.12.05.17.00.49; Wed, 05 Dec 2018 17:01:05 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728716AbeLFA6f (ORCPT + 99 others); Wed, 5 Dec 2018 19:58:35 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:50855 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbeLFA6e (ORCPT ); Wed, 5 Dec 2018 19:58:34 -0500 X-Originating-IP: 134.134.139.73 Received: from localhost (jfdmzpr04-ext.jf.intel.com [134.134.139.73]) (Authenticated sender: josh@joshtriplett.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 873FDC0005; Thu, 6 Dec 2018 00:58:30 +0000 (UTC) Date: Wed, 5 Dec 2018 16:58:27 -0800 From: Josh Triplett To: Andrea Parri Cc: "Paul E. McKenney" , tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org Subject: Re: [tip:core/rcu] rcutorture: Make initrd/init execute in userspace Message-ID: <20181206005827.GA24891@localhost> References: <20181204222412.GA6874@localhost> <20181204230423.GP4170@linux.ibm.com> <20181205222523.GA14609@localhost> <20181206000809.GX4170@linux.ibm.com> <20181206005147.GA3300@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181206005147.GA3300@andrea> 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 Thu, Dec 06, 2018 at 01:51:47AM +0100, Andrea Parri wrote: > > commit 4f8f751961b536f77c8f82394963e8e2d26efd84 > > Author: Paul E. McKenney > > Date: Tue Dec 4 14:59:12 2018 -0800 > > > > torture: Explain and simplify odd "for" loop in mkinitrd.sh > > > > Why a Bourne-shell "for" loop? And why 192 instances of "a"? This commit > > adds a shell comment to present the answer to these mysteries. It also > > uses a series of factor-of-four Bourne-shell assignments to make it > > easy to see how many instances there are, replacing the earlier wall of > > 'a' characters. > > > > Reported-by: Josh Triplett > > Signed-off-by: Paul E. McKenney > > > > diff --git a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh > > index da298394daa2..ff69190604ea 100755 > > --- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh > > +++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh > > @@ -40,17 +40,24 @@ mkdir $T > > cat > $T/init << '__EOF___' > > #!/bin/sh > > # Run in userspace a few milliseconds every second. This helps to > > -# exercise the NO_HZ_FULL portions of RCU. > > +# exercise the NO_HZ_FULL portions of RCU. The 192 instances of "a" was > > +# empirically shown to give a nice multi-millisecond burst of user-mode > > +# execution on a 2GHz CPU, as desired. Modern CPUs will vary from a > > +# couple of milliseconds up to perhaps 100 milliseconds, which is an > > +# acceptable range. > > +# > > +# Why not calibrate an exact delay? Because within this initrd, we > > +# are restricted to Bourne-shell builtins, which as far as I know do not > > +# provide any means of obtaining a fine-grained timestamp. > > + > > +a4="a a a a" > > +a16="$a4 $a4 $a4 $a4" > > +a64="$a8 $a8 $a8 $a8" > > Mmh, are you sure you don't want s/a8/a16/ here? ;-) ... *facepalm* Good catch.