1
1

opal/progress: improve performance when there are no LP callbacks

This commit adds another check to the low-priority callback
conditional that short-circuits the atomic-add if there are no
low-priority callbacks. This should improve performance in the common
case.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2016-06-22 09:50:46 -06:00
родитель 143a93f379
Коммит e4f920f6f9

Просмотреть файл

@ -221,7 +221,7 @@ opal_progress(void)
events += (callbacks[i])();
}
if ((OPAL_THREAD_ADD32((volatile int32_t *) &num_calls, 1) & 0x7) == 0) {
if (callbacks_lp_len > 0 && (OPAL_THREAD_ADD32((volatile int32_t *) &num_calls, 1) & 0x7) == 0) {
/* run low priority callbacks once every 8 calls to opal_progress() */
for (i = 0 ; i < callbacks_lp_len ; ++i) {
events += (callbacks_lp[i])();