linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Mike Galbraith <efault@gmx.de>
Cc: Marco Elver <elver@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-rt-users@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Clark Williams <williams@redhat.com>,
	ThomasGleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: 'perf test sigtrap' failing on PREEMPT_RT_FULL
Date: Wed, 26 Jul 2023 12:23:49 -0300	[thread overview]
Message-ID: <ZME6hYXlti3FLZSM@kernel.org> (raw)
In-Reply-To: <e368f2c848d77fbc8d259f44e2055fe469c219cf.camel@gmx.de>

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 <elver@google.com>
> > 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 <oleg@redhat.com>
  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);
>  }

  reply	other threads:[~2023-07-26 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 20:15 'perf test sigtrap' failing on PREEMPT_RT_FULL Arnaldo Carvalho de Melo
2023-07-26  6:10 ` Mike Galbraith
2023-07-26 15:23   ` Arnaldo Carvalho de Melo [this message]
2023-07-28 15:07   ` Sebastian Andrzej Siewior
2024-01-04 22:35     ` Arnaldo Carvalho de Melo
2024-02-21 19:26       ` Arnaldo Carvalho de Melo
2024-03-06 13:06         ` Arnaldo Carvalho de Melo
2024-03-06 16:27         ` Arnaldo Carvalho de Melo
2024-03-06 16:54           ` Sebastian Andrzej Siewior
2024-03-08 17:59             ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZME6hYXlti3FLZSM@kernel.org \
    --to=acme@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=efault@gmx.de \
    --cc=elver@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).