lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 29 Apr 2011 16:15:28 -0700
From:	Vaibhav Nagarnaik <vnagarnaik@...gle.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
	Michael Rubin <mrubin@...gle.com>,
	David Sharp <dhsharp@...gle.com>
Subject: Re: [PATCH] trace: Add a free on close control mechanism for buffer_size_kb

On Fri, Apr 29, 2011 at 1:01 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> 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.

Ok. It makes sense. I now use __tracing_resize_ring_buffer to call the
unlocked version and tracing_resize_ring_buffer as a wrapper around it with
mutex locking.

I am sending the patch in a moment.

>
> -- Steve
>
>
>

Thanks

Vaibhav Nagarnaik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ