Re: staging: lustre: One function call less in class_register_type() after error detection

2016-07-27 Thread SF Markus Elfring
> This function is called several times during lustre module insert.
> Namely it's called 5 times for 5 types:
> osc, mdc, lov, lmv, mgc.

Will any extra memory accesses matter for the successful execution
in this use case?


> It's not called any more than that, so it's not exactly a super hot-path 
> function
> to overoptimize it, and the failure is presumed to never happen too
> (or the module would be non-functional).

Did the assignment for the local variable "rc" with a well-known error code
influence the run-time characteristics in unwanted ways?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/staging/lustre/lustre/obdclass/genops.c?id=6a5b99a46bedc2cfbba96dec6d255c4b90af9ff8#n140

Regards,
Markus


Re: staging: lustre: One function call less in class_register_type() after error detection

2016-07-26 Thread Oleg Drokin

On Jul 26, 2016, at 3:56 PM, SF Markus Elfring wrote:

>> But kobject_put() already checks for NULL, right?
> 
> Yes. - Such an input parameter validation is performed by the
> function implementation.
> 
> 
>> you just submitted another batch about that in other area.
> 
> I sent update suggestions because of this function property for two
> Linux software modules in the year 2015.
> 
> 
>>> Adjust jump targets according to the Linux coding style convention.
>> 
>> Not that I am totally against this patch,
> 
> Thanks for your feedback.
> 
> 
>> but when we do not need the extra checks, a single jump target is ok too in 
>> my mind
> 
> A single goto label will look convenient for a while. It will often work
> for several use cases.
> 
> 
>> (extra benefit - there's not going to be any chance of a mistake to where to 
>> jump to).
> 
> I have got an other opinion when you would like to care for a bit
> more software efficiency.
> 
> 
>> And when we have a single jump target, there's no supersmart naming
>> like free_this_and_that_and_that_other_thing_too.
> 
> How often do you care for efficient exception handling in the shown
> function implementations?

This function is called several times during lustre module insert.
Namely it's called 5 times for 5 types:
osc, mdc, lov, lmv, mgc.

It's not called any more than that, so it's not exactly a super hot-path 
function
to overoptimize it, and the failure is presumed to never happen too
(or the module would be non-functional).

I guess you have already did all the work so I don't have any principal 
objections
here, it's just like I said, in a non-super contended path, a single
"fail" label is probably easier on the developer when they need to add another
check there, as opposed to figuring and possibly adding a correct another
label that would do something sensible.

Thank you for your contributions.



Re: staging: lustre: One function call less in class_register_type() after error detection

2016-07-26 Thread SF Markus Elfring
> But kobject_put() already checks for NULL, right?

Yes. - Such an input parameter validation is performed by the
function implementation.


> you just submitted another batch about that in other area.

I sent update suggestions because of this function property for two
Linux software modules in the year 2015.


>> Adjust jump targets according to the Linux coding style convention.
> 
> Not that I am totally against this patch,

Thanks for your feedback.


> but when we do not need the extra checks, a single jump target is ok too in 
> my mind

A single goto label will look convenient for a while. It will often work
for several use cases.


> (extra benefit - there's not going to be any chance of a mistake to where to 
> jump to).

I have got an other opinion when you would like to care for a bit
more software efficiency.


> And when we have a single jump target, there's no supersmart naming
> like free_this_and_that_and_that_other_thing_too.

How often do you care for efficient exception handling in the shown
function implementations?

Regards,
Markus