lkml.org 
[lkml]   [2008]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] ftrace: do not update max buffer with no users

On Thu, 13 Nov 2008, Ingo Molnar wrote:
>
> the obvious solution is to add this to ring_buffer_resize():
>
> if (!buffer)
> return size;

Having a NULL buffer return a successful resize is a bit worrisome to me.

And looking at the code I was trying to make sure could never be called
if there are no max_tr users:

in update_max_tr

buf = tr->buffer;
tr->buffer = max_tr.buffer;
max_tr.buffer = buf;

Should all the ring buffer API return success on NULL pointers?

>
> resizing a non-existent buffer should succeed. A two-liner patch. Not
> 160 lines of flux.
>
> Really, you need to think _hard_ how to avoid invasive-looking changes
> in late -rc's, because every extra line to review uses up precious
> review resources.

I appreciate the goal of minimal change, but I also want to keep things
robust.

Right now I'm thinking my other suggestion is the best. Just allocate the
max_tr.buffer and get rid of the CONFIG. This solution is very small, and
covers all corner cases.

-- Steve



\
 
 \ /
  Last update: 2008-11-13 14:57    [W:0.048 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site