Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3681245img; Mon, 25 Mar 2019 15:41:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC8uvnrSm8lFcahZW30igBvcxWkObF9dANFIMIoEDPTn2Rg/bu74imLvponQ0p1EHR9zhO X-Received: by 2002:a17:902:8d97:: with SMTP id v23mr20063525plo.298.1553553687558; Mon, 25 Mar 2019 15:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553553687; cv=none; d=google.com; s=arc-20160816; b=OhwCx4RrFRa+jZkj80+HUx0MCXD1n1/rlGjxp8RE6x0PTjzNg8WFmr2/t5skwysuVg w+iUAaox+2oc0B/Ms8S9AavtY82xgn7/Lf8EkJuvpjzg16PDySKJ8tCYz8rrMJOeKI9g aLJqylMgo3GODLVfyBe/REgVYUnITaPRyAo2jK3Jn7rUa3IQoY5Nz/yqjBfO18t7HB7K PQOrLcQxY8dKQwWKJjqXj6Tmmn3GWsE2iTeCBuoowZHWWa33Gr6vbbRS9JtiqpebAfrM 7vi9IHIMzEUeSfZZaVXb4RqDjZCgJskjYfyjSV6P87UHoyT1Q36fg4zg0WNQv8nwXnV+ Pi4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xPJVtYHTXvM2orrKqfEZlo9B30GWJZdiCtAzgwEpUz0=; b=IrXUKBQkLPF/RWBDcxAi6l8jKrKprk04+LWyi2WyPjKNqFuKEPIP96WKz9MO/RTvVB wH0VcVqsKnZ3sQjqFKqZaqZ1kLCjccBsvsnhXGe2J32l9EQxt/S4dCb1FnhFmWF5Egjh /oSYKlgY1ezCM3rcaT1IEuP8BP7n3hITnFI3PwNeMeJ0WJQTlZOWefSU15UCrRsr9Uan IJs/KEyWnEKVSNW3Y69oyrup6ZweG3Z0CgzKjbvSpytbjn5JFlORAmCQOe+0iv9ekU52 eyMM/GJ25bhmdPKl0zBr2EpeyoF3tc+/yJXwbP+3gAXf9ozLJIK2XafZ1A43hs+/iTjQ 0YFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="ic/YKzXz"; 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 h21si14556579pgl.346.2019.03.25.15.41.12; Mon, 25 Mar 2019 15:41:27 -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="ic/YKzXz"; 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 S1730500AbfCYWkc (ORCPT + 99 others); Mon, 25 Mar 2019 18:40:32 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37829 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfCYWkc (ORCPT ); Mon, 25 Mar 2019 18:40:32 -0400 Received: by mail-lf1-f68.google.com with SMTP id u2so7183390lfd.4 for ; Mon, 25 Mar 2019 15:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xPJVtYHTXvM2orrKqfEZlo9B30GWJZdiCtAzgwEpUz0=; b=ic/YKzXzFCdDKWbSifHEyTRsOTY5fUbQZ272MbPEmcdKrGXAEhfYiZKsqFvKv8Jefj z3F6tlKvcWdOJmNkeqNP0SAR7OwIp8YX5BNcm+YG6xtwZ/JMPQCbJYfFQGxD7keUbU2j ebQTAF7uelNv1wV+0MuprRNnnBNWaPQAvwj4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xPJVtYHTXvM2orrKqfEZlo9B30GWJZdiCtAzgwEpUz0=; b=aeD9yMp75NsJzmgD51UPeA+lFVUgKiVSBN+tqIg9rACuCund0Ux+eQH44Rd/6Ei62B GAi1Fkle9MbJMsTNi3GfNG+iQSqAxnxfwGO8qgW+C5DLSY0RWodYtjPv04WlH1diwecw j0guaoiO8AgQljBYwPAfVRQrkCc8k/n/L2H0xM1ioM43Yuq5qtMevSJAA01sM86jiYnA lynF3MbAhasH7T644HkhMmy677N9WCOzOVIVc+3MxcHC5aajOsHJwSgnaHBqjJ6VX6FN dPwqwTtl3iw6Kni3gFxl9tp45SGnX1OZmp4k2NGmMVzUIoF5yuiYbA5zAM+3dBX8bvz1 eShA== X-Gm-Message-State: APjAAAXJjQF/iAlV+f0rylqkcp6hYSlDGIg6Z6gmGgmTXNd4iKko7rUO ecUGBbhnjd3XlDCtAjwOpWoA37wp1/UpuljgUGlJTpxA X-Received: by 2002:a19:ee18:: with SMTP id g24mr14225773lfb.158.1553553628911; Mon, 25 Mar 2019 15:40:28 -0700 (PDT) MIME-Version: 1.0 References: <20190323034619.15792-1-joel@joelfernandes.org> <20190325150133.GA4102@linux.ibm.com> <20190325164253.GE4102@linux.ibm.com> In-Reply-To: <20190325164253.GE4102@linux.ibm.com> From: Joel Fernandes Date: Mon, 25 Mar 2019 18:40:17 -0400 Message-ID: Subject: Re: [PATCH] rcutorture: Select from only online CPUs To: "Paul E. McKenney" Cc: LKML , Josh Triplett , Lai Jiangshan , linux-kselftest , Mathieu Desnoyers , Shuah Khan , Steven Rostedt Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.