Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp349966ybh; Fri, 6 Mar 2020 23:38:29 -0800 (PST) X-Google-Smtp-Source: ADFU+vtGy0XZ7cd0AO0IRF2NC1cIAJUv28HmZPjigPlzY1nhBbc5q8Il2dofWCVnNiMsjPC1GTzj X-Received: by 2002:a9d:6c8e:: with SMTP id c14mr5208463otr.331.1583566709194; Fri, 06 Mar 2020 23:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583566709; cv=none; d=google.com; s=arc-20160816; b=S2vFqjcwHNPwdRD88zAUdrPOn0CSDPVDeJCpP106MKFUbIp7em36wwmLSOZ1a3w302 fwnaQYBb7ibYXZPzC6QcF6Tf+8giwWDwZaaxL4LyI+J+cnCU2qyqY/L0mm6rc/aA5JF8 WF+C6EKDDWFrGe2T01QpMfylgXrRh/PhF1+n5o+Ms8vHUyrOqTi9lkL8Z6peiZLpBIB7 PH9JQnqDjqZa+e3TwLEAcYa/Qanmw9AwyRiNU5IFyiWedI6Gmc1tFRaG6b4eezo4nPqS 12y5MJ4/psNylld1bx00BxPwclvPsiWdFmXlhPRFjLIo64uYGDkx8x8GJJx4rgySwbrm pHrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=gLiBXlIDvpwxp7wqN7Bqu/5NryfYZQA54NL1Q8/8L+o=; b=iiG/JE32fAjYR//mG0i9xQWim/z9frAE0h7k9SYMg+bI5guR9bqkEl0LFbYfsnwHSk F5krETEcGHHR1b2U3T1i2gsgjDto9BkjpBUQYXIiNQhpzvtGxUXdN9VfxeRWKRh7BmfP OqnTBHqJUbR6oybDvyTQTTePx/WnRGCSd2ZeLYYmv+cXtror56FYVDx93ko6KF67klLi PxEdwiNJ0m4KxJpzPT4Suo1YzgPmkKHmzNO1GE3ReEOIS02GdxlsABpgTl9SaYRmSUId 868HXdB97Q8AvGPSS8rZtBoKxG+r8I3dS1n+ZE/+HzLpUA6TM7KfG6OySxBi398bRH/3 cdug== 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 w128si631919oib.247.2020.03.06.23.38.17; Fri, 06 Mar 2020 23:38: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; 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 S1726154AbgCGHhF (ORCPT + 99 others); Sat, 7 Mar 2020 02:37:05 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:55237 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgCGHhF (ORCPT ); Sat, 7 Mar 2020 02:37:05 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jAU0u-0004Hg-HB; Sat, 07 Mar 2020 08:36:48 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 313BF1C21A5; Sat, 7 Mar 2020 08:36:48 +0100 (CET) Date: Sat, 07 Mar 2020 07:36:47 -0000 From: "tip-bot2 for Tommi Rantala" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf bench futex-wake: Restore thread count default to online CPU count Cc: Tommi Rantala , Arnaldo Carvalho de Melo , Alexander Shishkin , Darren Hart , Davidlohr Bueso , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Thomas Gleixner , x86 , LKML In-Reply-To: <20200305083714.9381-3-tommi.t.rantala@nokia.com> References: <20200305083714.9381-3-tommi.t.rantala@nokia.com> MIME-Version: 1.0 Message-ID: <158356660791.28353.2323821212643953114.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: f649bd9dd5d5004543bbc3c50b829577b49f5d75 Gitweb: https://git.kernel.org/tip/f649bd9dd5d5004543bbc3c50b829577b49f5d75 Author: Tommi Rantala AuthorDate: Thu, 05 Mar 2020 10:37:13 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Fri, 06 Mar 2020 08:30:47 -03:00 perf bench futex-wake: Restore thread count default to online CPU count 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") Signed-off-by: Tommi Rantala Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Darren Hart Cc: Davidlohr Bueso Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lore.kernel.org/lkml/20200305083714.9381-3-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 df81009..58906e9 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)