public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leonid Ravich <lravich@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Leonid Ravich <leonid.ravich@toganetworks.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yigal Korman <yigal.korman@toganetworks.com>,
	"linux-trace-kernel@vger.kernel.org" 
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: BUG:  ib_mad ftrace event unsupported migration
Date: Thu, 3 Nov 2022 14:22:01 +0200	[thread overview]
Message-ID: <Y2OyaSe7CrhJ9COo@leonid-Inspiron-3421> (raw)
In-Reply-To: <20221102181900.5bc9812f@rorschach.local.home>

On Wed, Nov 02, 2022 at 06:19:00PM -0400, Steven Rostedt wrote:
> On Wed, 2 Nov 2022 22:01:17 +0200
> Leonid Ravich <lravich@gmail.com> wrote:
> 
> > disagree, without CONFIG_PREEMPTION (which is the default case in some
> > destros) we will not get any warning, because there will not be
> > preamption disable.
> 
> I test all for my code (NON_PREEMPT, VOLUNTEER_PREEMPT, PREEMPT) and
> with and without lockdep enabled.
> 
> This would be a bug if you called kmalloc(X, GFP_KERNEL) in *any* non
> preempt section.
yes, but for NON_PREEMPT trace is not non preempt section,
actualy the problem is with CONFIG_PREEMPT_COUNT not set. 

ftrace uses preemot_enable/disable_notrace macro to "mark" it as non preempt section
which do it only for CONFIG_PREEMPT_COUNT. 

from include/linux/preempt.h
if !CONFIG_PREEMPT_COUNT
#define preempt_enable_notrace()                barrier()

this is why there is no any warning on my system.
> 
> > 
> > second issue I see and maybe it is only me, is that the assuption of
> > atomicity in trace is not a common knowledge for trace users.     
> 
> Well, I suppose we could add more documentation. Would that help? Where
> would you see it? In the sample code?
> 
I think if we fix the first issue and make kernel cry for any miss
behave it we do the job. 
> I advise not even grabbing locks in trace events, because in most cases
> lockdep will not catch any issues with them (it will be hidden unless
> the trace event is enabled).
> 

-- Leonid 


  reply	other threads:[~2022-11-03 12:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 10:49 BUG: ib_mad ftrace event unsupported migration Leonid Ravich
2022-11-02 11:44 ` Steven Rostedt
2022-11-02 13:02   ` Jason Gunthorpe
2022-11-02 14:02     ` Leonid Ravich
2022-11-02 14:04       ` Jason Gunthorpe
2022-11-02 14:17         ` Steven Rostedt
2022-11-02 14:24           ` Jason Gunthorpe
2022-11-02 15:59             ` Steven Rostedt
2022-11-02 16:01               ` Jason Gunthorpe
2022-11-02 20:01               ` Leonid Ravich
2022-11-02 22:19                 ` Steven Rostedt
2022-11-03 12:22                   ` Leonid Ravich [this message]
2022-11-03 16:32                     ` Steven Rostedt
2022-11-02 14:20       ` Steven Rostedt

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=Y2OyaSe7CrhJ9COo@leonid-Inspiron-3421 \
    --to=lravich@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=leonid.ravich@toganetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=yigal.korman@toganetworks.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