Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4553518img; Tue, 26 Mar 2019 11:41:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqW20M+sQNQCNWMvQzlIMNCQSSwul0iUEYj3SIUN3bl70+dJkfMdlD5/v3HVjXgSXsmeR2 X-Received: by 2002:a63:e151:: with SMTP id h17mr30296105pgk.413.1553625683255; Tue, 26 Mar 2019 11:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553625683; cv=none; d=google.com; s=arc-20160816; b=Gm6Iker02dHKezGKiUbeQ9PRG2eLSAp+ODWrHSmkAA4jZtoFW/+EVp/8N3Y0sLbyCb 979BFzvAcJXCcyfAGk9ws4MYeGcyXcKmhLvOpdBYO8JVXTBYYqyo4ABhr6RhvKCTqOVs BVg+uRD3w/rFrB2X6g86yR3u0lXT295ZQllErQOc774xMF9kCl2nqTnPTBky4ji/Etzx Oj4rItads9W0Tye5jWryxMr9riVfovkBEQ+lo5xRr1DXoQYqSXTQFqFZNmBI1jIEY0Vu 9zT2qbj6bAvD4hJ7uZHnrMaVym2qNROLc4TgsIbLLrz/EMm7RtlXS98pI+6DJeg1wl4R 661g== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OebS67tbjuWqFy3t0xAyZDQg7pK9l7HQQXFcKoVXBUI=; b=pb/4vVWKf54QRH5shqYmqbQD7FA55aZ7kc8yZJzoKxvcs+AJ5pbDe4EkmovZW3EF6e p2VQ7dSBs9EKeYGdTWLeNd8bmP6TLiBbVhQOJbGls7f2rDzxrk81bEyREbiaSXC3w9xB IEyS6cvCJVcD/0tit4i6daSqZklhUTZaVoTc8IJ7R50gULKtf2ki0/1NhQVj0ZGP+t8b a87bOryEye/Y2kPJa4UdhiONSasT9PaHgwzcf3Swo9h01p6PXoFYLQXYjE/8Ku7WA5ZS uVKlwCxYfl0DQRRrczN768FnAWL/1LrVwjkBIuGZHTDBPRo/pif20oAdTUCjj7fJJ2ay Ly6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aHqQWegy; 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 m1si17360173plt.28.2019.03.26.11.41.07; Tue, 26 Mar 2019 11:41:23 -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=aHqQWegy; 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 S1732560AbfCZSkR (ORCPT + 99 others); Tue, 26 Mar 2019 14:40:17 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38612 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732387AbfCZSkQ (ORCPT ); Tue, 26 Mar 2019 14:40:16 -0400 Received: by mail-pg1-f195.google.com with SMTP id j26so6656670pgl.5 for ; Tue, 26 Mar 2019 11:40:16 -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:content-transfer-encoding:in-reply-to :user-agent; bh=OebS67tbjuWqFy3t0xAyZDQg7pK9l7HQQXFcKoVXBUI=; b=aHqQWegyBv3YF3tGsHCmvf7tz2aaW/j8NnMEprAH3TvslM9hlswSY84IQ47i0dt3mv JfylL/ggyXsteKWhOvAXR9TV/Q4Y0p63ZMDiaHhArtCNYHQANCpYoGZFJeDTmxivbbR9 svPLasom7c8zV//Bvc2QVI/8KfMFOGZ2LpDB8= 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:content-transfer-encoding :in-reply-to:user-agent; bh=OebS67tbjuWqFy3t0xAyZDQg7pK9l7HQQXFcKoVXBUI=; b=mXxbDTgtVXgtGTpONJnSigSwMTgbaXOuiEwRwkhWRu4hG6EvnLoXRTZamSchjCX/tN DesqfB80W6aaWkuJ9sIRSzGD653/i463dL2Ck8afa3efjtwlR4FUgY6dGqIjE7CzJ721 uHnc8GF+adln+47HMn8XIFc4Qaj/pdH0xmmRR8gRxKP0ug/tWDaC7VGFV+xyGdaAnd66 Td4entpab762hjdHf54vio7L2+EV1yJACb5c3csk7Uv/QlkWfdE69/lRDAylPhxI4vr4 KfA0IjJXhkGrF5kHGqIw5gh6h0xa6vRFCU+GEDfb9j1Gsbpge+wO6mbhHkE6RkE8WovM chrg== X-Gm-Message-State: APjAAAX476Iv0keTN0sZJf/017AD5yUjoZXBaTZNtQAwe8tMGNYRBpqi 4SsTTEGgM5F3lXgaB5LEJP5YwQ== X-Received: by 2002:a63:6985:: with SMTP id e127mr30769030pgc.101.1553625615665; Tue, 26 Mar 2019 11:40:15 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id s6sm26930308pfe.37.2019.03.26.11.40.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 11:40:14 -0700 (PDT) Date: Tue, 26 Mar 2019 14:40:13 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: LKML , Josh Triplett , Lai Jiangshan , linux-kselftest , Mathieu Desnoyers , Shuah Khan , Steven Rostedt Subject: Re: [PATCH] rcutorture: Select from only online CPUs Message-ID: <20190326184013.GA114492@google.com> References: <20190323034619.15792-1-joel@joelfernandes.org> <20190325150133.GA4102@linux.ibm.com> <20190325164253.GE4102@linux.ibm.com> <20190326160140.GP4102@linux.ibm.com> <20190326183549.GA162738@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190326183549.GA162738@google.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, Mar 26, 2019 at 02:35:49PM -0400, Joel Fernandes wrote: > On Tue, Mar 26, 2019 at 09:01:40AM -0700, Paul E. McKenney wrote: > > On Mon, Mar 25, 2019 at 06:40:17PM -0400, Joel Fernandes wrote: > > > On Mon, Mar 25, 2019 at 12:42 PM Paul E. McKenney wrote: > > > > > > > > On Mon, Mar 25, 2019 at 12:33:37PM -0400, Joel Fernandes wrote: > > > > > On Mon, Mar 25, 2019 at 11:02 AM Paul E. McKenney wrote: > > > > > > > > > > > > On Fri, Mar 22, 2019 at 11:46:19PM -0400, Joel Fernandes (Google) wrote: > > > > > > > The rcutorture jitter.sh script selects a random CPU but does not check > > > > > > > if it is offline or online. This leads to taskset errors many times. On > > > > > > > my machine, hyper threading is disabled so half the cores are offline > > > > > > > causing taskset errors a lot of times. Let us fix this by checking from > > > > > > > only the online CPUs on the system. > > > > > > > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > > > > > > > > > Good catch! > > > > > > > > > > > > Please see below for one suggestion for simplification. > > > > > > > > > > > > Thanx, Paul > > > > > > > > > > > > > --- > > > > > > > tools/testing/selftests/rcutorture/bin/jitter.sh | 11 ++++++++++- > > > > > > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > > > > > > > > > > > diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh > > > > > > > index 3633828375e3..53bf9d99b5cd 100755 > > > > > > > --- a/tools/testing/selftests/rcutorture/bin/jitter.sh > > > > > > > +++ b/tools/testing/selftests/rcutorture/bin/jitter.sh > > > > > > > @@ -47,10 +47,19 @@ do > > > > > > > exit 0; > > > > > > > fi > > > > > > > > > > > > > > - # Set affinity to randomly selected CPU > > > > > > > + # Set affinity to randomly selected online CPU > > > > > > > cpus=`ls /sys/devices/system/cpu/*/online | > > > > > > > > > > > > cpus=`grep 1 /sys/devices/system/cpu/*/online | > > > > > > > > > > Yes, this is better. Lets do it this way :) > > > > > > > > > > > > sed -e 's,/[^/]*$,,' -e 's/^[^0-9]*//' | > > > > > > > grep -v '^0*$'` > > > > > > > > > > > > Of course, now I have no idea why I excluded CPU 0... :-/ > > > > > > > > > > Yes, I was wondering as well about that :-) > > > > > > > > Please feel free to try including CPU 0 and running the set of single-CPU > > > > rcutorture scenarios. ;-) > > > > > > Will do and then will update the patch by adding the CPU back, if all > > > is well. Thanks. > > > > And rcutorture doesn't like the rcu_is_cpu_rrupt_from_idle() patch on > > scenarios SRCU-P, TASKS01, and TREE05, which are the Tree RCU scenarios > > that enable CONFIG_PROVE_RCU. The compiler error is: > > > > kernel/rcu/tree.c:391:2: error: implicit declaration of function ‘_this_cpu_read’ [-Werror=implicit-function-declaration] > > > > My guess is that the initial underscore needs to go. I will drop > > these two patches in favor of an update from you. ;-) > > Sorry, I fixed that up and running tests now. > > By the way, may be you decided to not run the jitter on CPU0 just because on > some systems, CPU0 does not have an 'online' file? In this case, the grep may > throw errors I guess which troubles the script. > > From the old cpu hotplug docs, I found that if CONFIG_BOOTPARAM_HOTPLUG_CPU0 > or cpu0_hotplug boot command line option is not passed, then cpu0 cannot be > offlined in which case, presumably the 'online' file will be missing, like > some systems I am testing on. Never mind, the "*" in your path search would take care of not erroring out :-) The other reason you may have done it is for making the jitter be consistent across systems that can offline CPU0, and the others that can't :-). I am just guessing. Any way, I will just add back CPU0 forcefully to the cpus list in my testing, without checking for the online file existence, and see what happens :-) If there's no smoke, then I'll roll that into a patch and send it out. thanks.