[LTP] [PATCH 3/3] realtime/matrix_mult: Fix test optimization

Joerg Vehlow lkml@jv-coder.de
Mon Nov 15 16:28:18 CET 2021


Hi Cyril,
> Ideally the comment changes should be in a separate patch...
>
>
>   
> These static function conversions should ideally be in a separate patch
> as well. At least the patch description does not mention either of these
> changes.
I just did some cleanup here. Would it be ok, to do all cleanup in one 
commit and the fix in a second one?

>>   
>> -int set_affinity(void)
>> +static int set_affinity(void)
>>   {
>> +	static pthread_mutex_t mutex_cpu = PTHREAD_MUTEX_INITIALIZER;
> As well as this change, it looks okay, but it's not listed in the patch
> description.
Right, that is also just cleanup. The mutex is only used inside of this 
function, and I figured
using the static initializer is  better, than 0-initialization.
>> +	for (i = 0; i < iterations; i++) {
>> +		matrix_mult_record(matrices[0], i);
>> +	}
> And here LMKL coding style prefers to avoid the curly braces, but that
> is very minor.
Yes sorry, I had this without curly braces, than added some debug code 
and forgot to remove them again.
This btw. is the reason, why I don't like this rule (but I will not try 
to argue about it here)


Joerg


More information about the ltp mailing list