OCF: use rte_pause in wait loop
Add rte_pause to waiting while loop This commit also adds spdk_pause as interface for rte_pause Change-Id: I56e1023731e2e78febaa4f45808d6f07656d290f Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com> Reviewed-on: https://review.gerrithub.io/c/436494 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
b45bc79461
commit
b2d5bfd0d1
@ -510,6 +510,11 @@ uint64_t spdk_get_ticks_hz(void);
|
||||
*/
|
||||
void spdk_delay_us(unsigned int us);
|
||||
|
||||
/**
|
||||
* Pause CPU execution for a short while
|
||||
*/
|
||||
void spdk_pause(void);
|
||||
|
||||
struct spdk_ring;
|
||||
|
||||
enum spdk_ring_type {
|
||||
|
4
lib/bdev/ocf/env/ocf_env.c
vendored
4
lib/bdev/ocf/env/ocf_env.c
vendored
@ -101,7 +101,9 @@ env_completion_init(env_completion *completion)
|
||||
void
|
||||
env_completion_wait(env_completion *completion)
|
||||
{
|
||||
while (atomic_read(&completion->atom));
|
||||
while (atomic_read(&completion->atom)) {
|
||||
spdk_pause();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -307,6 +307,11 @@ void spdk_delay_us(unsigned int us)
|
||||
rte_delay_us(us);
|
||||
}
|
||||
|
||||
void spdk_pause(void)
|
||||
{
|
||||
rte_pause();
|
||||
}
|
||||
|
||||
void
|
||||
spdk_unaffinitize_thread(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user