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:
parent
0621ca59b3
commit
d25b059e2c
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user