Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp285619rdb; Thu, 30 Nov 2023 05:01:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh00fTC7HqSPJqyv0dxEuHtvtHaxCPMwrTf7nXDHsEnuhQBTA3LqoS9Akl8gHsVf1ZL9C0 X-Received: by 2002:a05:6870:8183:b0:1d0:d9e2:985f with SMTP id k3-20020a056870818300b001d0d9e2985fmr27781496oae.57.1701349309896; Thu, 30 Nov 2023 05:01:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701349309; cv=none; d=google.com; s=arc-20160816; b=tjzu3izUFtO7eZpxWzwvUDaaxLjICNuvmzbUQt4sUCIfXXTH8cjr+brGJ+11Lkt/dl 7p+lcjjbasmeFsBlXg2xt2pCpV1YEvECmK+vtOmswbiRYet6Pz0IMti+ITrSzT7/KXtA SfX93LRr0VfgT9srWMQoAe7/aMihl2/V3eSv+G3OY5hxgXDQtCNjNM3RQDAVIfbHQJXD TRagIPN34HewAjzyrHnhq2GYBk3W3fY335Imcdxltm0sbNAZl7ON55+zkZ1JyiyCA2cx VqShLBCUIkG6GGD0wGeDqSEBqxP0cSLm4BGxpM6HGir8MGSyolkAyp6ycs5469xWOElQ oJQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rnfiCCutUTk41vlOnKa15KdbMH3LqNgMqlZbKgjRjUQ=; fh=glUpL/Jbk8FBYIg3SPem4SGEK1plZFedyKMLtC1u9Xg=; b=YLCE9+h5Yh1xC9MVbTQDWogaNepkOPGOIkCYZV/W2/Y0YWn53xzVOUO1nd1qGnShMa CR1mZbjwfzhQNAfFURhOfMsw+d2l9DyopyllbzgMDRilZlvaEYOXhPSu7kzCCjDfGuyn Q9fqfWwwEH5TZk3pedfxfR/21sQzz9/YbwIa0+i83xvZlH5f311XcttWKL08AuUV3YuP hi9dgEN8aZcZYhDJUrZWTjZMqtbRkR1cCJFcHWDtDeAG3jiEZWRf9rp1+yJvv356ptdz WeU8TekdXhdfdAUo0GFPMDsSBVCDc2Qiftw9VCIB3TR3ZkNUluTFvjPTqPhxB266qAL5 r09w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HWXQ3joR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id pz25-20020a056871e49900b001fa2fd11f9fsi379746oac.211.2023.11.30.05.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 05:01:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HWXQ3joR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D7C668029ACE; Thu, 30 Nov 2023 05:01:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232075AbjK3NBO (ORCPT + 99 others); Thu, 30 Nov 2023 08:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232026AbjK3NBN (ORCPT ); Thu, 30 Nov 2023 08:01:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94C5110DB for ; Thu, 30 Nov 2023 05:01:18 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB402C433C9; Thu, 30 Nov 2023 13:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701349278; bh=Y6P2f2Sf3w01PljjdEzwHVXoK16hWzbz2lMqn3qVGR0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HWXQ3joRfXeJrQZePqk4Sy4pwHvenhlhyEYU//laRJSh9jGcSImZvKCGXH5VfJTk+ RIK8uUK00872ap5RvtTxV2fWYMB+mlRV4HcMA/2lMTtwtjH8fuUouzhPULLTt25o/f SWGTedbcMK2Q+CkMvI9PLZOY1J04gfbxsEPt+CHU9Ur6GFQBoJ6z7AzrJx4VprIJYw pB6D+VP6Te6oVffUDdmFNUJvj4BDANnztdD9VGYS4trzylmXVPHOulJFfwOEBBonP+ r5q0wxqJXXiyPnJE0I6+rDdB/XYdxc3Ovl32ZfHmhGAwM1Sfc+t7VXzef184lQwUsz 35bqh3iSq+NcQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 79EE940094; Thu, 30 Nov 2023 10:01:15 -0300 (-03) Date: Thu, 30 Nov 2023 10:01:15 -0300 From: Arnaldo Carvalho de Melo To: Marco Elver Cc: Namhyung Kim , Ingo Molnar , Thomas Gleixner , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , Kate Carcia , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Juri Lelli , Mike Galbraith , Peter Zijlstra Subject: Re: [PATCH 2/2] perf tests sigtrap: Skip if running on a kernel with sleepable spinlocks Message-ID: References: <20231129154718.326330-1-acme@kernel.org> <20231129154718.326330-3-acme@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MANY_SUBDOM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 05:01:31 -0800 (PST) Em Wed, Nov 29, 2023 at 05:42:30PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Nov 29, 2023 at 04:57:47PM +0100, Marco Elver escreveu: > > > @@ -175,7 +208,16 @@ static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrie > > > ret = run_test_threads(threads, barrier); > > > TEST_ASSERT_EQUAL("disable failed", ioctl(fd, PERF_EVENT_IOC_DISABLE, 0), 0); > > > - TEST_ASSERT_EQUAL("unexpected sigtraps", ctx.signal_count, NUM_THREADS * ctx.iterate_on); > > > + expected_sigtraps = NUM_THREADS * ctx.iterate_on; > > > + if (ctx.signal_count < expected_sigtraps && kernel_with_sleepable_spinlocks()) { > > > + pr_debug("Expected %d sigtraps, got %d, running on a kernel with sleepable spinlocks.\n", > > > + expected_sigtraps, ctx.signal_count); > > > + pr_debug("See https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/\n"); > > No changes from the RT side since? A fix exists, but apparently not > > good enough... Sigh. > Yeah, my impression, and first attempt at writing that patch wast that > no sigtraps were being sent, but then when I tried with a random, more > recent machine in the Red Hat labs, I got some signals, way less than > the expected ones, but some, maybe this is an interesting data point? > I'll try again to reproduce in the local machine, old i7 lenovo notebook > and at the newer machine, a Xeon(R) Silver 4216, 32 cpu and report here. So, on the i7 lenovo: [root@nine ~]# uname -a Linux nine 5.14.0-284.30.1.rt14.315.el9_2.x86_64 #1 SMP PREEMPT_RT Fri Aug 25 10:53:59 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux [root@nine ~]# grep "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz model name : Intel(R) Core(TM) i7-2920XM CPU @ 2.50GHz [root@nine ~]# grep "model name" /proc/cpuinfo | wc -l 8 [root@nine ~]# [root@nine ~]# perf test -v sigtrap 68: Sigtrap : --- start --- test child forked, pid 77679 Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. See https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ test child finished with -2 ---- end ---- Sigtrap: Skip [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# perf test -v sigtrap |& grep Expected Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# uname -a Consistently 0 sigtraps delivered: [root@nine ~]# for a in $(seq 100) ; do perf test -v sigtrap |& grep Expected ; done | sort | uniq -c 100 Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# for a in $(seq 1000) ; do perf test -v sigtrap |& grep Expected ; done | sort | uniq -c 1000 Expected 15000 sigtraps, got 0, running on a kernel with sleepable spinlocks. [root@nine ~]# While on the bigger machine: [root@perf160 ~]# uname -a Linux perf160.perf.lab.eng.bos.redhat.com 5.14.0-362.8.1.el9_3.x86_64+rt #1 SMP PREEMPT_RT Tue Oct 3 10:26:54 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux [root@perf160 ~]# [acme@perf160 ~]$ grep "model name" /proc/cpuinfo | wc -l 32 [acme@perf160 ~]$ grep "model name" /proc/cpuinfo | head -1 model name : Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz [acme@perf160 ~]$ [acme@perf160 ~]$ perf test -v sigtrap 68: Sigtrap : --- start --- test child forked, pid 72084 Expected 15000 sigtraps, got 1845, running on a kernel with sleepable spinlocks. See https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ test child finished with -2 ---- end ---- Sigtrap: Skip [acme@perf160 ~]$ perf test -v sigtrap 68: Sigtrap : --- start --- test child forked, pid 72091 Expected 15000 sigtraps, got 2060, running on a kernel with sleepable spinlocks. See https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ test child finished with -2 ---- end ---- Sigtrap: Skip [acme@perf160 ~]$ [root@perf160 ~]# for a in $(seq 100) ; do perf test -v sigtrap |& grep Expected ; done | sort | uniq -c | sort -n 1 Expected 15000 sigtraps, got 1010, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1064, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1139, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1165, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1166, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1177, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1206, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1279, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1321, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1359, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1368, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1400, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1432, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1490, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1520, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1527, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1532, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1566, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1597, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1600, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1630, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1652, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1689, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1706, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1709, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1753, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1765, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1778, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1830, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1896, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1901, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1903, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1908, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1909, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1930, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1951, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1976, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 1980, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2010, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2012, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2071, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2075, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2166, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2169, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2185, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2189, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2229, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2241, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2249, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2297, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2303, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2313, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2325, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2326, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2350, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2359, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2378, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2448, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2479, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2480, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2489, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2501, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2569, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2573, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2597, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2605, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2639, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2647, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2719, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2754, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2804, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2805, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2860, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 2882, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3152, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3177, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3179, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3249, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3261, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3332, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3388, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3395, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3465, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3487, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3622, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3677, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3782, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 3901, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 4087, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 4235, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 4372, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 4570, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 571, running on a kernel with sleepable spinlocks. 1 Expected 15000 sigtraps, got 622, running on a kernel with sleepable spinlocks. 2 Expected 15000 sigtraps, got 1929, running on a kernel with sleepable spinlocks. 2 Expected 15000 sigtraps, got 1967, running on a kernel with sleepable spinlocks. 2 Expected 15000 sigtraps, got 2072, running on a kernel with sleepable spinlocks. [root@perf160 ~]# I guess I'll try to get hold of the older kernel with 0 sigtraps to see if I get the same behaviour (consistent 0 sigtraps) on that kernel on the bigger machine :-\ - Arnaldo