Add conditional reschedules to env_sort

Sorting can take a long time with big cache sizes and a lot of dirty
data. Make sure we reschedule frome time to time to avoid lockups.

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial 2020-04-29 11:34:40 +02:00
parent 0621ca59b3
commit d25b059e2c

View File

@ -275,6 +275,7 @@ void env_sort(void *base, size_t num, size_t size,
break;
swap_fn(base + r, base + c, size);
}
env_cond_resched();
}
/* sort */
@ -289,5 +290,6 @@ void env_sort(void *base, size_t num, size_t size,
break;
swap_fn(base + r, base + c, size);
}
env_cond_resched();
}
}