mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Avoid cmpexchg due to CPU Hardware limitation
Limit the amount of times compare_exchange_weak is called, to avoid issues with contention when multiple cpu cores request the same address. Related-To: NEO-7030 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f77f47099c
commit
30fe24aa79
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/interlocked_max.h"
|
||||
#include "shared/source/helpers/mt_helpers.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
|
||||
#include <atomic>
|
||||
@@ -33,7 +33,7 @@ class OsContextLinux : public OsContext {
|
||||
uint32_t peekTlbFlushCounter() const { return tlbFlushCounter.load(); }
|
||||
|
||||
void setTlbFlushed(uint32_t newCounter) {
|
||||
interlockedMax(lastFlushedTlbFlushCounter, newCounter);
|
||||
NEO::MultiThreadHelpers::interlockedMax(lastFlushedTlbFlushCounter, newCounter);
|
||||
};
|
||||
bool isTlbFlushRequired() const {
|
||||
return (tlbFlushCounter.load() > lastFlushedTlbFlushCounter.load());
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/helpers/heap_assigner.h"
|
||||
#include "shared/source/helpers/interlocked_max.h"
|
||||
#include "shared/source/helpers/mt_helpers.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/helpers/windows/gmm_callbacks.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
@@ -1171,7 +1171,7 @@ void Wddm::waitOnPagingFenceFromCpu() {
|
||||
}
|
||||
|
||||
void Wddm::updatePagingFenceValue(uint64_t newPagingFenceValue) {
|
||||
interlockedMax(currentPagingFenceValue, newPagingFenceValue);
|
||||
NEO::MultiThreadHelpers::interlockedMax(currentPagingFenceValue, newPagingFenceValue);
|
||||
}
|
||||
|
||||
WddmVersion Wddm::getWddmVersion() {
|
||||
|
||||
Reference in New Issue
Block a user