mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tracing: Disable interrupt or preemption before acquiring arch_spinlock_t
Date: Thu, 22 Sep 2022 10:48:59 -0400	[thread overview]
Message-ID: <03d87746-8454-c7eb-6698-af2d02abdc42@redhat.com> (raw)
In-Reply-To: <Yyxx0jhmN6ZTRYhd@hirez.programming.kicks-ass.net>


On 9/22/22 10:31, Peter Zijlstra wrote:
> On Thu, Sep 22, 2022 at 09:31:58AM -0400, Waiman Long wrote:
>> It was found that some tracing functions in kernel/trace/trace.c acquire
>> an arch_spinlock_t with preemption and irqs enabled. An example is the
>> tracing_saved_cmdlines_size_read() function which intermittently causes
>> a "BUG: using smp_processor_id() in preemptible" warning when the LTP
>> read_all_proc test is run.
>>
>> That can be problematic in case preemption happens after acquiring the
>> lock. Add the necessary preemption or interrupt disabling code in the
>> appropriate places before acquiring an arch_spinlock_t.
>>
>> The convention here is to disable preemption for trace_cmdline_lock and
>> interupt for max_lock.
>>
>> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
>> Signed-off-by: Waiman Long <longman@redhat.com>
> This seems to be missing a Fixes: tag :-)

Sorry for the omission. The patch should have the following fixes tags.

Fixes: a35873a0993b ("tracing: Add conditional snapshot")
Fixes: 939c7a4f04fc ("tracing: Introduce saved_cmdlines_size file")

Cheers,
Longman


  reply	other threads:[~2022-09-22 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 13:31 Waiman Long
2022-09-22 14:31 ` Peter Zijlstra
2022-09-22 14:48   ` Waiman Long [this message]
2022-09-22 14:56 ` [Resend PATCH " Waiman Long
2022-09-27 15:28   ` Waiman Long
2022-09-27 17:12     ` Steven Rostedt
2022-09-27 17:52       ` Waiman Long

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=03d87746-8454-c7eb-6698-af2d02abdc42@redhat.com \
    --to=longman@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=will@kernel.org \
    /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

all inboxes | Powered by JetHome®