Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10013476imu; Wed, 5 Dec 2018 14:26:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XzoZeufJSIX7OXme/4uEp507xXJtN54M8TgIqqAaqTfwOcGIHO5n6fM0qmsi8+No2uCOiq X-Received: by 2002:a63:8043:: with SMTP id j64mr22505775pgd.405.1544048794513; Wed, 05 Dec 2018 14:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544048794; cv=none; d=google.com; s=arc-20160816; b=lTuuVVBmDBRa+mypK/E4h73Fe+HNhkmzJhejx4KizOSdT2yafhnJIJy4yt8dAR2FlB Yj1OqUHBShvsJfSnA/cHPaVOzyjm5jH3ZbzVX7a3qRhzRySdZZzLOenu6ztZuLCyXYbt bjXfRKL5LkFNW3manrin0J1IaeEuCu1IYiZu+DgT7/1Z0Cqy8DkHHIULJsdI8Hlt6cCj CwUmzxdAmHvMtsu1aQCV/Vf+DjRNHyL3NQSz9i3hNBPGvkKONedlTilOtFPA4JiRgnMu 1dO6Zn9AUQOZKYuGrr2hJiQX+3oEv/maexkh0z3kLnQLzo0iU6js4svnOiWhBNPb1s27 J95A== 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=BzEsu5KdotMwGlO5FQb3FXfPEfabAosDX9mz47yHYvA=; b=yT9TGkR94G/Tg+GI2Gm6zKZfqcVP4LEsJTRBgUeoNPJzLw68DjMdeTuRWRI8bbQHYt X5zfoNDbUdaA/qW+ApraBMMyMlphOWxmAOjb2Y6MtJgOHfHhMU8+q2QT6Mk/q8rEFo73 YGGgxi8EbpSE1pGseBnnVo6Fveft8KmhavXIHmEL3oto3pWcVwTlNmYMXo57TE68QPMT CfzSD4QsM6q8wukLYAyAxfEhK9n2a6wJg4nqklEpBXjGRrFoKC767SEQPSBDANhCkfNZ gfOepzyJKHsfPhfX1RwpjN8VTZsj8dMDQ1Kg6VKudY3FhtxRmSWXQ/APJ6JFv9+Gpzii qsPw== 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 k6si20198816pgr.500.2018.12.05.14.26.18; Wed, 05 Dec 2018 14:26:34 -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 S1728411AbeLEWZd (ORCPT + 99 others); Wed, 5 Dec 2018 17:25:33 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:58947 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727592AbeLEWZd (ORCPT ); Wed, 5 Dec 2018 17:25:33 -0500 X-Greylist: delayed 86471 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 Dec 2018 17:25:32 EST X-Originating-IP: 134.134.139.75 Received: from localhost (jfdmzpr06-ext.jf.intel.com [134.134.139.75]) (Authenticated sender: josh@joshtriplett.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 7327220003; Wed, 5 Dec 2018 22:25:26 +0000 (UTC) Date: Wed, 5 Dec 2018 14:25:24 -0800 From: Josh Triplett To: "Paul E. McKenney" Cc: 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: <20181205222523.GA14609@localhost> References: <20181204222412.GA6874@localhost> <20181204230423.GP4170@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204230423.GP4170@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 Tue, Dec 04, 2018 at 03:04:23PM -0800, Paul E. McKenney wrote: > On Tue, Dec 04, 2018 at 02:24:13PM -0800, Josh Triplett wrote: > > On Tue, Dec 04, 2018 at 02:09:42PM -0800, tip-bot for Paul E. McKenney wrote: > > > --- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh > > > +++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh > > > @@ -39,9 +39,22 @@ 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. > > > while : > > > do > > > - sleep 1000000 > > > + q= > > > + for i in \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a \ > > > + a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a > > > > Ow. If there's no better way to do this, please do at least comment how many 'a's > > this is. (And why 186, exactly?) > > Yeah, that is admittedly a bit strange. The reason for 186 occurrences of > "a" to one-time calibration, measuring a few millisecond's worth of delay. > > > Please also consider calibrating the delay loop as you do in the C code. > > Good point. And a quick web search finds me "date '+%s%N'", which gives > me nanoseconds since the epoch. I probably don't want to do a 2038 to > myself (after all, I might still be alive then), so I should probably try > to make something work with "date '+%N'". Or use something like this: > > $ date '+%4N'; date '+%4N';date '+%4N'; date '+%4N' > 6660 > 6685 > 6697 > 6710 > > Ah, but that means I need to add the "date" command to my initrd, doesn't > it? And calculation requires either bash or the "test" command. And it > would be quite good to restrict this to what can be done with Bourne shell > built-in commands, since a big point of this is to maintain a small-sized > initrd. :-/ Sure, and I'm not suggesting adding commands to the initrd, hence my mention of "If there's no better way". > So how about the following patch, which attempts to explain the situation? That would help, but please also consider consolidating with something like a10="a a a a a a a a a a" to make it more readable (and perhaps rounding up to 200 for simplicity). - Josh