lkml.org 
[lkml]   [2014]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] ipc/mqueue.c: Drag unneeded code out of locks
Hi Steven,

On 11/16/2014 08:40 PM, Steven Stewart-Gallus wrote:
> Finally, please don't ignore the rest of my message. Even if my patch
> isn't that good there are lots of ways to compromise and improve it
> such as adding tests, annotations and making it clearer.

I think you were already given ideas how to improve the patch:

a) split the patch.

b) create test cases so that you are able to check that the code still
behaves as it did before
Did you test the change to mqueue_create()?

c) Give each a good summary of what you want to achieve:
- readability
- coding style
- performance
- avoid a lock entirely, switch to RCU instead of spin_lock(), ...
- reduce the time a lock is held (usually only useful if the reduction
is significant - both relative and absolute).
- ...

Writing that down also helps you:
There were multiple patches that I've dropped myself - simply because I
have noticed that the patch doesn't achieve anything useful.

From your changes: The one to mqueue_read_file might make sense, it
avoids to hold the spinlock over the snprintf.
For the other changes, I don't see that they improve something, but
perhaps I have overlooked something.

Best regards,
Manfred




\
 
 \ /
  Last update: 2014-11-17 20:41    [W:0.093 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site