Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5776725ybf; Thu, 5 Mar 2020 06:52:29 -0800 (PST) X-Google-Smtp-Source: ADFU+vvRdhrMszZvwRXgni5dOqRvOKZB8OQFtgqLZfIZ+9oYc4/m9nb11200pvSiea0Ak6g/Sc2v X-Received: by 2002:a9d:6204:: with SMTP id g4mr7164261otj.94.1583419949031; Thu, 05 Mar 2020 06:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583419949; cv=none; d=google.com; s=arc-20160816; b=bKIGDJiboMeXTzJOLWks1o5DaCQcuKfWESR85IKYng/l3hi2ePeiBtQSZiasbvuS/a BJRHTcQ/IqFPGIGNDz9ok3B38WP2si0m/F+VxVIZTqLVi4OI6IJDCw5TBeRpb3TtiFBE eePFZTTNOjDedHMYhSZ+A+5PScHNT6V/nM2WTJOKtd00Gmv8dg9j80+QWncen2LWFYOq 4EXDIpKW2hmE40Vzgn6LEjK8TVmIX9Z8YvzOS/jACUCDkAr7MDD/jKVAwI23EzUZY3Sk iCSv5MxnGrnLBw7QcKuOCm/0QWPeUcr9EwcBatvZEH6mszi0oTLbWygN2a75A0bLoIs/ sVIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=lXr8QyHFHX5e4o5E1cYT1QWO5kxOYAViBMEnNNRzKd4=; b=fXRHvml5w4KMSU63okn7OSOOc4u4rTj2zIwVgpI6CS6QWt/6wJDB9Oqb/Evo46O9Wo v5IuV5si9G2jQ4VipS21aeoGEmYatM3fymhpdpZQpf4Srd5BWBVjaSCOXLBr6HIETuOC liJ7QZSzzzu0exQom27SufKXR1nW/xs+79ZyGqp4q4JhkOh+hfkIuPZ6wqooMiffz+WQ Q3FsLIvEF8dXhxoXhIqi47ukpp8dvBrqiFxq1vNPimWNtMHVFpMf1T6l44ti4yvPZXXA Ah6HP9X0gzikhiLr5T/F8uDprJgXhKm0oX2yMDiIk991rTOh8nyT2oMKOMs5h/RypGgp buJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uOQsfEMM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c22si3384604otr.97.2020.03.05.06.52.15; Thu, 05 Mar 2020 06:52:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uOQsfEMM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbgCEOvx (ORCPT + 99 others); Thu, 5 Mar 2020 09:51:53 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:35507 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbgCEOvw (ORCPT ); Thu, 5 Mar 2020 09:51:52 -0500 Received: by mail-qk1-f195.google.com with SMTP id 145so5528528qkl.2 for ; Thu, 05 Mar 2020 06:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lXr8QyHFHX5e4o5E1cYT1QWO5kxOYAViBMEnNNRzKd4=; b=uOQsfEMMIEnezw+yh2X6yXI/eeep//e7c5oeCb3tQGIaPg3BWiD8M4WkguEvCuzE1I VoplBTsKZWDKGMiwKBtsMJFtkvNcJ/36CsMXEjvC64jJyXLIyy6CFah3GXJLpvkdYjjY 0GfxCH88YJfmaB7aOtchS/UwHYZthXLxpw9gShGUm9sNAyuq7GJ8eAcAMqNvHrCQVFNi Q4lZZYIryoO1OqenUs5lqWxxKa8PGhmLaArMFnME2DJpabQortNJu/u8VnmSB8rsKTJ4 RR1wv44CeL7uGc0MoKbkLqpIfUuaH/ymQBB5fo4SaZASHRE0CFkJqZb55lY6Pk77cNRC IxsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lXr8QyHFHX5e4o5E1cYT1QWO5kxOYAViBMEnNNRzKd4=; b=oUQMUzaeNI6Z2F0p0nxNQdhQv6dPFcVbUB4tobBPBZVEOSfbFk/SDl5oPS9kknyNrd DsM6BqLmYUF2rtpw88/0Fcgz+2ERl+blav0PggIU9d25oyys6p+w2VViDqvLXOjVklX0 If63tDC0E4aOakXbtQZpmist/bwnz6wXHd8CunodsJhsXPuvCw7WH+HB1AKiv1yW2ppw d9Fdnf5+/YOfQX0z1q26NmMN0Mqmx7SyTFQIa4sQi0xeFnZZGXPOJi6juupgdeOpxHLo lPKRtTHnXn3aGZjEbk5GBm0X/Wso/jir9zG++P1nNyvMMueh1jvCIPXyanfuHAlVMjcD qfBw== X-Gm-Message-State: ANhLgQ3dvdz+XDPMvF78GqvvMktxn/9YAJh/0XYPhiIkwpqO6isRrwwi hZ5x+jAozXguf34QR4Lha+ELFr++5pI= X-Received: by 2002:a05:620a:148e:: with SMTP id w14mr8584216qkj.473.1583419912052; Thu, 05 Mar 2020 06:51:52 -0800 (PST) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id x7sm9738994qkx.110.2020.03.05.06.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 06:51:51 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 83DA5403AD; Thu, 5 Mar 2020 11:51:49 -0300 (-03) Date: Thu, 5 Mar 2020 11:51:49 -0300 To: Tommi Rantala Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Darren Hart , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Davidlohr Bueso , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] perf bench futex-wake: Restore thread count default to online CPU count Message-ID: <20200305145149.GB7895@kernel.org> References: <20200305083714.9381-1-tommi.t.rantala@nokia.com> <20200305083714.9381-3-tommi.t.rantala@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305083714.9381-3-tommi.t.rantala@nokia.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Mar 05, 2020 at 10:37:13AM +0200, Tommi Rantala escreveu: > Since commit 3b2323c2c1c4 ("perf bench futex: Use cpumaps") the default > number of threads the benchmark uses got changed from number of online > CPUs to zero: > > $ perf bench futex wake > # Running 'futex/wake' benchmark: > Run summary [PID 15930]: blocking on 0 threads (at [private] futex 0x558b8ee4bfac), waking up 1 at a time. > [Run 1]: Wokeup 0 of 0 threads in 0.0000 ms > [...] > [Run 10]: Wokeup 0 of 0 threads in 0.0000 ms > Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%) > > Restore the old behavior by grabbing the number of online CPUs via > cpu->nr: > > $ perf bench futex wake > # Running 'futex/wake' benchmark: > Run summary [PID 18356]: blocking on 8 threads (at [private] futex 0xb3e62c), waking up 1 at a time. > [Run 1]: Wokeup 8 of 8 threads in 0.0260 ms > [...] > [Run 10]: Wokeup 8 of 8 threads in 0.0270 ms > Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%) > > Fixes: 3b2323c2c1c4 ("perf bench futex: Use cpumaps") Thanks, tested and applied. - Arnaldo > Signed-off-by: Tommi Rantala > --- > tools/perf/bench/futex-wake.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c > index df810096abfef..58906e9499bb0 100644 > --- a/tools/perf/bench/futex-wake.c > +++ b/tools/perf/bench/futex-wake.c > @@ -43,7 +43,7 @@ static bool done = false, silent = false, fshared = false; > static pthread_mutex_t thread_lock; > static pthread_cond_t thread_parent, thread_worker; > static struct stats waketime_stats, wakeup_stats; > -static unsigned int ncpus, threads_starting, nthreads = 0; > +static unsigned int threads_starting, nthreads = 0; > static int futex_flag = 0; > > static const struct option options[] = { > @@ -141,7 +141,7 @@ int bench_futex_wake(int argc, const char **argv) > sigaction(SIGINT, &act, NULL); > > if (!nthreads) > - nthreads = ncpus; > + nthreads = cpu->nr; > > worker = calloc(nthreads, sizeof(*worker)); > if (!worker) > -- > 2.21.1 > -- - Arnaldo