Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1198858rwb; Wed, 26 Jul 2023 08:57:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGCbnAPqV0JQJQYROdDLMgKKXIN4j/VcengFBvxsVFjNJsh9NBxa/uPJ2fxjOUxTV0AHds+ X-Received: by 2002:aa7:dd09:0:b0:51d:9db8:8257 with SMTP id i9-20020aa7dd09000000b0051d9db88257mr2014598edv.30.1690387073716; Wed, 26 Jul 2023 08:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690387073; cv=none; d=google.com; s=arc-20160816; b=u8ckXrToxhd0OXOM8XpzPXqMyqmJFIA5oI/eiQczNmXwShfI+8VznCMj6YTEyYbO7k SF3kAJSkkDDdRZkq7ZJgF5IZmXPF1Hd764/NcGz0mEW+MU4W2hgvCigxIyUTn5mM4+HQ d/sOpkF5GpMpVEol7cI64aqgvXcJhJKP5VRREeIuwd/kg1wzxQz+y3Bt0wQjjv0IyxBo bLNgQmVFvaNG+zYTnab3IMw8jffccw2xHinltwLc/mYIPefRMLqhkJvGHx7pc0dkrgKI z3wIYpvehBimdHtL6h2fRH5CcVJG5cmdlTcvNMA90uUpQTQMzyjJRd0X3epjBuq9b1E6 m7Pg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=26XpZZgg1KpCnNJLebOoxS5v5QDnlJHCfEh7OcgRgmI=; fh=rcmTS8NFhD9z7sYpC4P162xajpm3/eNBJpbiRRNxUg0=; b=Y4NNicDCwojmWSC5NjyazEQ5PX/hyQ/r1/TcEv3mPp4yjAqVv5ukLO1x6FEAEwgCDJ css0NuGRSCryqnlXBX84gGyf1blvKc8W4uGM361943U7+Pt/RS9tHnKLV75uPp4EiImI 8zmrCM20F9aQiEGmObOUBgzopBqATwPSu+MWML7wqpsQEeH3nGjE9j7NQFOtKXDPDqwB w1xo5ExtzQAwJQ52P9EKhECjh258EUopZtxhNhOy3oVf4xhSFe7EG4lFAloAQ3mHykPP WnR2Zc8IkxVoB5nIGtfgrCh09sp+QdEyol3NvxnLI9NM1IDLANpUx8pKU+DuI/5aWfNF LjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=phNkqt5z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020a056402055800b00522394947c9si4223872edx.632.2023.07.26.08.57.28; Wed, 26 Jul 2023 08:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=phNkqt5z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232490AbjGZPX4 (ORCPT + 99 others); Wed, 26 Jul 2023 11:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233176AbjGZPXz (ORCPT ); Wed, 26 Jul 2023 11:23:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A5D911B; Wed, 26 Jul 2023 08:23:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA3AE61B77; Wed, 26 Jul 2023 15:23:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2209CC433C7; Wed, 26 Jul 2023 15:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690385033; bh=BuT3BCRx45ezZIHZUz21rlRd7r+tjVifEZyeIukhjjA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=phNkqt5zDpbdk6cQj58Vy0mI9l20M/5CaM6kb5KnhaxhAJGnDMumSiFH8BOGIUU5P ekZRv/D1Gu/FjCeAdmD8JDfwYX/Qf7cfuPtkyoYL3EL5/3R/nsHaVN/OfrMHW15+Ia qS81cJpoSzGMWlRpV3mRAW9Nt2oXrEXo/u1Og7NiWrq4k0eYoKu9e2BtJ7ymmULG8i P1C4/hXCUIwTZy8AyeN5q970fyJHPTdWkI4yGViY6QQcABkwZ9ruo6XsSjCsuPxCkI c1WugV/MH6xYRx6a1mWpo7x9gfCCyDwRgL8cgCieCU8FoIVG3ytqegUiA+x/rjKXPw NOaTvSJj65I9Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0E14B40516; Wed, 26 Jul 2023 12:23:50 -0300 (-03) Date: Wed, 26 Jul 2023 12:23:49 -0300 From: Arnaldo Carvalho de Melo To: Mike Galbraith Cc: Marco Elver , Peter Zijlstra , linux-rt-users@vger.kernel.org, Linux Kernel Mailing List , Juri Lelli , Clark Williams , ThomasGleixner , Sebastian Andrzej Siewior , Oleg Nesterov Subject: Re: 'perf test sigtrap' failing on PREEMPT_RT_FULL Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Em Wed, Jul 26, 2023 at 08:10:45AM +0200, Mike Galbraith escreveu: > On Tue, 2023-07-25 at 17:15 -0300, Arnaldo Carvalho de Melo wrote: > > Hi Marco, Peter, > > ????????I got a report that 'perf test sigtrap' test failed on a > > PREEMPT_RT_FULL kernel, one that had up to: > > commit 97ba62b278674293762c3d91f724f1bb922f04e0 > > Author: Marco Elver > > Date:?? Thu Apr 8 12:36:01 2021 +0200 > > ??? perf: Add support for SIGTRAP on perf events > > ... > > [?? 52.848925] BUG: scheduling while atomic: perf/6549/0x00000002 > Had bf9ad37dc8a not been reverted due to insufficient beauty, you could > trivially make the sigtrap test a happy camper (wart tested in tip-rt). Yeah, I cherry-picked bf9ad37dc8a: Author: Oleg Nesterov Date: Tue Jul 14 14:26:34 2015 +0200 signal, x86: Delay calling signals in atomic on RT enabled kernels Applied your force_sig_delayed() call to send_sig_perf() and got: [root@nine ~]# perf test sigtrap 73: Sigtrap : Ok [root@nine ~]# Happy camper indeed. [acme@nine linux]$ git log --oneline -5 24f75a478a32 (HEAD) signal, x86: Delay calling signals in atomic on RT enabled kernels d37d728e9a66 (tag: v6.4-rt6, linux-rt-devel/linux-6.4.y-rt) v6.4-rt6 4d1139baae8b mm/page_alloc: Use write_seqlock_irqsave() instead write_seqlock() + local_irq_save(). dc93c1f07d48 seqlock: Do the lockdep annotation before locking in do_write_seqcount_begin_nested() a3f6be6e5353 printk: Check only for migration in printk_deferred_*(). [acme@nine linux]$ git diff diff --git a/kernel/signal.c b/kernel/signal.c index 464e68a8a273..f186e0d85381 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1868,6 +1868,9 @@ int send_sig_perf(void __user *addr, u32 type, u64 sig_data) TRAP_PERF_FLAG_ASYNC : 0; + if (force_sig_delayed(&info, current)) + return 0; + return send_sig_info(info.si_signo, &info, current); } [acme@nine linux]$ uname -a Linux nine 6.4.0-rt6+ #3 SMP PREEMPT_RT Wed Jul 26 11:46:12 -03 2023 x86_64 x86_64 x86_64 GNU/Linux [acme@nine linux]$ perf test sigtrap 71: Sigtrap : Ok [acme@nine linux]$ - Arnaldo > @@ -1829,6 +1869,9 @@ int send_sig_perf(void __user *addr, u32 > TRAP_PERF_FLAG_ASYNC : > 0; > > + if (force_sig_delayed(&info, current)) > + return 0; > + > return send_sig_info(info.si_signo, &info, current); > }