Message ID | 20231129154718.326330-3-acme@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp429246vqn; Wed, 29 Nov 2023 07:48:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHF+n50bXouIFZLqK4VPNrQEpUnJSc9hFQnXeBvh/EIZv2oApDgUSnvDAb8/5hknc0didTN X-Received: by 2002:a17:902:dac4:b0:1cf:d7e2:5e73 with SMTP id q4-20020a170902dac400b001cfd7e25e73mr10837166plx.49.1701272892538; Wed, 29 Nov 2023 07:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701272892; cv=none; d=google.com; s=arc-20160816; b=Y2AJ5iqvOm/oyKprLuP9/DL9Ydw8xAh8L+FzBv988x2YDZ8iBcIi1Ftr4nt6f6g5Mm utxTISyMruHvKfHkyvYb+W6hToWupVCVV3PzJaaPAkgEOeH7TxSRVRGCWz7Pn4bRwLuG xKSWqIpxvB7qprf7lOk0/L4mpNyDSEhTzmSJAAKh/V7mwAObp0vkXdSb2mR0LE0L1KVR 48ri7rh37UQs2t97Qgt9ww1JV27BGA7T1kh74SZ5Hjt8/ZDikYWg0PvwPwUDsuZTl5sE tS1XIG2lSlI68QoNBv7Upm9MzQjexvJM73SFF9SlorIIJjeJ6ZEn2xDEXYeXn1TGlc4A 8CeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NEZw4GlvuZDgEBy2iXwv0HKH0SUrkAeOVlouSVdCYQ4=; fh=jy3LohGc5hVyn54A5LgJUZY1dOWXq435vgH8fY8iy+s=; b=nNJRl9R7Zyo+U2GaXDRXcUBvk63Rbs03y7N+W4UPLxo8pbRg4kfRthrHd6ct+cmuHG DxIYknG1BF1cufX1WC+fZ4oHc9S+CRwWIxXnQqfVO7sPJqlMq7RNI//LXJXJhWPp8+Zf IkIvdr4r+bTRuzOI7o6UJVd9qNkTWqKFG8/5hkEDeimIOKNt/r+0a38EccAI4X6js9jP 8PXK3ytSsbe5pSBY/ZQiz4RoCs1Hl1Yv1MkkPTQe0T7nPH5pbos/zKrpBU01YNvzy0yn uRteJbQ3o+tfC9edQos7IRGLrV1FlMgaxPyP1lIHXDjwVCiIRSVb79yM+8jMwbevTL65 GB1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=srT7EPF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u13-20020a170903124d00b001b045d65aedsi14748217plh.228.2023.11.29.07.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 07:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=srT7EPF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id CE91C8035132; Wed, 29 Nov 2023 07:48:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344143AbjK2Prr (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Wed, 29 Nov 2023 10:47:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344032AbjK2Pre (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Nov 2023 10:47:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E5110DB for <linux-kernel@vger.kernel.org>; Wed, 29 Nov 2023 07:47:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DE61C433C9; Wed, 29 Nov 2023 15:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701272860; bh=45craR8fXhu4UKylqaeeXIMxfA/OQi5bmwotxf0KdVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=srT7EPF8WxYZeCnQTbCvQdasmXfcwhwnDkVorUW54rnoYLdO+f6xSPNSzDJuDPaXh h99pThfxiCqrMpZSzYW5EtBiqUx8yKl163sPOhGrRKzW0pwAR6xfVyInfl5sSK7NjV NLGWDGLap3tYDCkmDQ0iSdE94oL++/7KgH+o5wMWCjIBtk4RbEme/mox+cegknfdrH lx2N6ak7aE9L4Z+sfxFoIo5GOCMflYabhLeqgG9sla8Kb4DAerzyLajqOyaD1lDbLQ NsxYsohRhWeyTHRrJ1VbiDX/XNV2zUN3hiGSloFC4Xi2GGW2yYKWdGn85ZzfwMafg5 C0+Xo6ThVqtew== From: Arnaldo Carvalho de Melo <acme@kernel.org> To: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Clark Williams <williams@redhat.com>, Kate Carcia <kcarcia@redhat.com>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>, Juri Lelli <juri.lelli@redhat.com>, Marco Elver <elver@google.com>, Mike Galbraith <efault@gmx.de>, Peter Zijlstra <peterz@infradead.org> Subject: [PATCH 2/2] perf tests sigtrap: Skip if running on a kernel with sleepable spinlocks Date: Wed, 29 Nov 2023 12:47:18 -0300 Message-ID: <20231129154718.326330-3-acme@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231129154718.326330-1-acme@kernel.org> References: <20231129154718.326330-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 07:48:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783913924440097918 X-GMAIL-MSGID: 1783913924440097918 |
Series |
Skip the 'perf test sigtrap' on kernels with sleepable spinlocks
|
|
Commit Message
Arnaldo Carvalho de Melo
Nov. 29, 2023, 3:47 p.m. UTC
From: Arnaldo Carvalho de Melo <acme@redhat.com> There are issues as reported that need some more investigation on the RT kernel front, till that is addressed, skip this test. This test is already skipped for multiple hardware architectures where the tested kernel feature is not supported. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Clark Williams <williams@redhat.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Marco Elver <elver@google.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/sigtrap.c | 46 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-)
Comments
On Wed, 29 Nov 2023 at 16:47, Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > From: Arnaldo Carvalho de Melo <acme@redhat.com> > > There are issues as reported that need some more investigation on the > RT kernel front, till that is addressed, skip this test. > > This test is already skipped for multiple hardware architectures where > the tested kernel feature is not supported. > > Cc: Adrian Hunter <adrian.hunter@intel.com> > Cc: Clark Williams <williams@redhat.com> > Cc: Ian Rogers <irogers@google.com> > Cc: Jiri Olsa <jolsa@kernel.org> > Cc: Juri Lelli <juri.lelli@redhat.com> > Cc: Marco Elver <elver@google.com> > Cc: Mike Galbraith <efault@gmx.de> > Cc: Namhyung Kim <namhyung@kernel.org> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Thomas Gleixner <tglx@linutronix.de> > Link: https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Marco Elver <elver@google.com> > --- > tools/perf/tests/sigtrap.c | 46 ++++++++++++++++++++++++++++++++++++-- > 1 file changed, 44 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c > index a1bc7c776254ed2f..e6fd934b027a3d0c 100644 > --- a/tools/perf/tests/sigtrap.c > +++ b/tools/perf/tests/sigtrap.c > @@ -103,6 +103,34 @@ static bool attr_has_sigtrap(void) > > return __btf_type__find_member_by_name(id, "sigtrap") != NULL; > } > + > +static bool kernel_with_sleepable_spinlocks(void) > +{ > + const struct btf_member *member; > + const struct btf_type *type; > + const char *type_name; > + int id; > + > + if (!btf__available()) > + return false; > + > + id = btf__find_by_name_kind(btf, "spinlock", BTF_KIND_STRUCT); > + if (id < 0) > + return false; > + > + // Only RT has a "lock" member for "struct spinlock" > + member = __btf_type__find_member_by_name(id, "lock"); > + if (member == NULL) > + return false; > + > + // But check its type as well > + type = btf__type_by_id(btf, member->type); > + if (!type || !btf_is_struct(type)) > + return false; > + > + type_name = btf__name_by_offset(btf, type->name_off); > + return type_name && !strcmp(type_name, "rt_mutex_base"); > +} > #else /* !HAVE_BPF_SKEL */ > static bool attr_has_sigtrap(void) > { > @@ -125,6 +153,11 @@ static bool attr_has_sigtrap(void) > return ret; > } > > +static bool kernel_with_sleepable_spinlocks(void) > +{ > + return false; > +} > + > static void btf__exit(void) > { > } > @@ -166,7 +199,7 @@ static int run_test_threads(pthread_t *threads, pthread_barrier_t *barrier) > > static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrier) > { > - int ret; > + int ret, expected_sigtraps; > > ctx.iterate_on = 3000; > > @@ -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. > + return TEST_SKIP; > + } else > + TEST_ASSERT_EQUAL("unexpected sigtraps", ctx.signal_count, expected_sigtraps); > + > TEST_ASSERT_EQUAL("missing signals or incorrectly delivered", ctx.tids_want_signal, 0); > TEST_ASSERT_VAL("unexpected si_addr", ctx.first_siginfo.si_addr == &ctx.iterate_on); > #if 0 /* FIXME: enable when libc's signal.h has si_perf_{type,data} */ > -- > 2.41.0 >
Em Wed, Nov 29, 2023 at 04:57:47PM +0100, Marco Elver escreveu: > On Wed, 29 Nov 2023 at 16:47, Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > From: Arnaldo Carvalho de Melo <acme@redhat.com> > > > > There are issues as reported that need some more investigation on the > > RT kernel front, till that is addressed, skip this test. > > > > This test is already skipped for multiple hardware architectures where > > the tested kernel feature is not supported. > > > > Cc: Adrian Hunter <adrian.hunter@intel.com> > > Cc: Clark Williams <williams@redhat.com> > > Cc: Ian Rogers <irogers@google.com> > > Cc: Jiri Olsa <jolsa@kernel.org> > > Cc: Juri Lelli <juri.lelli@redhat.com> > > Cc: Marco Elver <elver@google.com> > > Cc: Mike Galbraith <efault@gmx.de> > > Cc: Namhyung Kim <namhyung@kernel.org> > > Cc: Peter Zijlstra <peterz@infradead.org> > > Cc: Thomas Gleixner <tglx@linutronix.de> > > Link: https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/ > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > Acked-by: Marco Elver <elver@google.com> > > > --- > > tools/perf/tests/sigtrap.c | 46 ++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 44 insertions(+), 2 deletions(-) > > > > diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c > > index a1bc7c776254ed2f..e6fd934b027a3d0c 100644 > > --- a/tools/perf/tests/sigtrap.c > > +++ b/tools/perf/tests/sigtrap.c > > @@ -103,6 +103,34 @@ static bool attr_has_sigtrap(void) > > > > return __btf_type__find_member_by_name(id, "sigtrap") != NULL; > > } > > + > > +static bool kernel_with_sleepable_spinlocks(void) > > +{ > > + const struct btf_member *member; > > + const struct btf_type *type; > > + const char *type_name; > > + int id; > > + > > + if (!btf__available()) > > + return false; > > + > > + id = btf__find_by_name_kind(btf, "spinlock", BTF_KIND_STRUCT); > > + if (id < 0) > > + return false; > > + > > + // Only RT has a "lock" member for "struct spinlock" > > + member = __btf_type__find_member_by_name(id, "lock"); > > + if (member == NULL) > > + return false; > > + > > + // But check its type as well > > + type = btf__type_by_id(btf, member->type); > > + if (!type || !btf_is_struct(type)) > > + return false; > > + > > + type_name = btf__name_by_offset(btf, type->name_off); > > + return type_name && !strcmp(type_name, "rt_mutex_base"); > > +} > > #else /* !HAVE_BPF_SKEL */ > > static bool attr_has_sigtrap(void) > > { > > @@ -125,6 +153,11 @@ static bool attr_has_sigtrap(void) > > return ret; > > } > > > > +static bool kernel_with_sleepable_spinlocks(void) > > +{ > > + return false; > > +} > > + > > static void btf__exit(void) > > { > > } > > @@ -166,7 +199,7 @@ static int run_test_threads(pthread_t *threads, pthread_barrier_t *barrier) > > > > static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrier) > > { > > - int ret; > > + int ret, expected_sigtraps; > > > > ctx.iterate_on = 3000; > > > > @@ -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. - Arnaldo
On Thu, 30 Nov 2023 at 14:01, Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > 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 [...] > > 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 :-\ Thanks for checking. In any case, it looks like it's still broken. If the fix (bf9ad37dc8a + small diff by Mike) from [1] still works, what's blocking it from being upstreamed? https://lore.kernel.org/all/e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de/
diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c index a1bc7c776254ed2f..e6fd934b027a3d0c 100644 --- a/tools/perf/tests/sigtrap.c +++ b/tools/perf/tests/sigtrap.c @@ -103,6 +103,34 @@ static bool attr_has_sigtrap(void) return __btf_type__find_member_by_name(id, "sigtrap") != NULL; } + +static bool kernel_with_sleepable_spinlocks(void) +{ + const struct btf_member *member; + const struct btf_type *type; + const char *type_name; + int id; + + if (!btf__available()) + return false; + + id = btf__find_by_name_kind(btf, "spinlock", BTF_KIND_STRUCT); + if (id < 0) + return false; + + // Only RT has a "lock" member for "struct spinlock" + member = __btf_type__find_member_by_name(id, "lock"); + if (member == NULL) + return false; + + // But check its type as well + type = btf__type_by_id(btf, member->type); + if (!type || !btf_is_struct(type)) + return false; + + type_name = btf__name_by_offset(btf, type->name_off); + return type_name && !strcmp(type_name, "rt_mutex_base"); +} #else /* !HAVE_BPF_SKEL */ static bool attr_has_sigtrap(void) { @@ -125,6 +153,11 @@ static bool attr_has_sigtrap(void) return ret; } +static bool kernel_with_sleepable_spinlocks(void) +{ + return false; +} + static void btf__exit(void) { } @@ -166,7 +199,7 @@ static int run_test_threads(pthread_t *threads, pthread_barrier_t *barrier) static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrier) { - int ret; + int ret, expected_sigtraps; ctx.iterate_on = 3000; @@ -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"); + return TEST_SKIP; + } else + TEST_ASSERT_EQUAL("unexpected sigtraps", ctx.signal_count, expected_sigtraps); + TEST_ASSERT_EQUAL("missing signals or incorrectly delivered", ctx.tids_want_signal, 0); TEST_ASSERT_VAL("unexpected si_addr", ctx.first_siginfo.si_addr == &ctx.iterate_on); #if 0 /* FIXME: enable when libc's signal.h has si_perf_{type,data} */