diff options
author | Daniel M. Crowell <dcrowell@us.ibm.com> | 2014-07-11 20:27:33 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2014-07-11 20:30:06 -0500 |
commit | 2c06d0339fa477951f4a65df8bed606de1a2ec5e (patch) | |
tree | c7e73c5804f524e55676e47b94ee5393fb0cc6a9 /src/kernel/deferred.C | |
parent | 2d5e027994238b824314dd4522efdb7c79107758 (diff) | |
download | talos-hostboot-2c06d0339fa477951f4a65df8bed606de1a2ec5e.tar.gz talos-hostboot-2c06d0339fa477951f4a65df8bed606de1a2ec5e.zip |
Revert "Resolve deadlock conditions in deferred work queue."
This reverts commit aaadc0e5955551542ddc5fc84cc54dd32f8d9788.
Change-Id: Ia92dcb307efbacea6a7afbee00b1e881f995cfa2
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/12181
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel/deferred.C')
-rw-r--r-- | src/kernel/deferred.C | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/kernel/deferred.C b/src/kernel/deferred.C index 2e77a125d..ffa16d742 100644 --- a/src/kernel/deferred.C +++ b/src/kernel/deferred.C @@ -31,20 +31,10 @@ reinterpret_cast<DeferredWork*>((item)->iv_cpus_and_next & 0xFFFFFFFF) /** Set the DeferredWork pointer part of a iv_cpus_and_next instance var. */ -#define DEFERRED_QUEUE_SET_NEXT_PTR(tail,item) \ - { \ - uint64_t old_value = 0; \ - uint64_t new_value = 0; \ - do \ - { \ - old_value = (tail)->iv_cpus_and_next; \ - new_value = (old_value & 0xFFFFFFFF00000000ull) | \ - reinterpret_cast<uint64_t>(item); \ - } \ - while (!__sync_bool_compare_and_swap(&(tail)->iv_cpus_and_next, \ - old_value, \ - new_value)); \ - } +#define DEFERRED_QUEUE_SET_NEXT_PTR(item) \ + (item)->iv_cpus_and_next = \ + ((item)->iv_cpus_and_next & 0xFFFFFFFF00000000ull) | \ + reinterpret_cast<uint64_t>(item) /** Extract the CPU count portion of a iv_cpus_and_next instance var. */ #define DEFERRED_QUEUE_GET_CPU_COUNT(item) (item)->iv_cpus_and_next >> 32 @@ -89,7 +79,7 @@ void DeferredQueue::_insert(DeferredWork* i_work) } // Add work item to the end of the list. - DEFERRED_QUEUE_SET_NEXT_PTR(tail, i_work); + DEFERRED_QUEUE_SET_NEXT_PTR(i_work); } lock.unlock(); @@ -135,9 +125,6 @@ void DeferredQueue::_complete(DeferredWork* i_work) old_ptr = iv_cpus_and_next; } while(!__sync_bool_compare_and_swap(&iv_cpus_and_next, old_ptr, new_ptr)); - // Clean up our own queue pointer. - DEFERRED_QUEUE_SET_NEXT_PTR(i_work, (DeferredWork*)NULL); - // Get the CPU count from the old object pointer and wait until those // CPUs get into i_work. old_ptr >>= 32; |