[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211108231710.GA1521@kbox>
Date:   Mon, 8 Nov 2021 15:17:10 -0800
From:   Beau Belgrave <beaub@...ux.microsoft.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     mhiramat@...nel.org, linux-trace-devel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 09/10] user_events: Optimize writing events by only
 copying data once
On Mon, Nov 08, 2021 at 06:04:52PM -0500, Steven Rostedt wrote:
> On Mon, 8 Nov 2021 15:00:34 -0800
> Beau Belgrave <beaub@...ux.microsoft.com> wrote:
> 
> > > > -	memcpy(entry + 1, data, datalen);
> > > > +	if (unlikely(!copy_nofault(entry + 1, i->count, i)))  
> > > 
> > > Need:
> > > 		__trace_event_discard_commit(event_buffer.buffer, event_buffer.event);
> > > 
> > > Because the trace_event_buffer_reserve() will not only allocate space on
> > > the ring buffer, but may also disable preemption.
> > > 
> > > -- Steve
> > >   
> > 
> > Ah, thank you!
> 
> Which reminds me that trace_event_buffer_reserve() expects to be called
> with preemption disabled. And I'm guessing that may not be the case for you.
> 
Thanks, should be good there:
I have rcu_read_lock_sched() held, which will have preemption disabled
during the various probe calls.
> I'll change this so that it always disables preemption even if it uses the
> filter buffer, and *always* disables preemption on return.
> 
> -- Steve
Thanks,
-Beau
Powered by blists - more mailing lists