lkml.org 
[lkml]   [2011]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] trace: Add a free on close control mechanism for buffer_size_kb
From
Date
On Fri, 2011-04-29 at 12:45 -0700, Vaibhav Nagarnaik wrote:

> > Why call it "atomic"? Because you do the mutex? Anyway I hate the name.
> > It sounds like it can do it without preemption, which it clearly can't
> > do.
>
> I just wanted to note that it was a locked operation. I have changed the name
> to tracing_buffer_resize_locked.
>
> If you think it can be named better, I will change it.

Actually, the normal convention that I noticed that is used around the
kernel is the "normal" name is used when locking is applied. For
functions that do the same thing but does not lock, add two underscores
in front of the name:


void __foo(void)
{
do_foo();
}

void foo(void)
{
mutex_lock(&foo_lock);
__foo();
mutex_unlock(&foo_lock);
}

But if this has no real equivalent, just remove that name altogether.

Not to lock should be the exception, not locking.

-- Steve




\
 
 \ /
  Last update: 2011-04-29 22:03    [W:0.051 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site