L4 removes RRPV array, will not support cross-predictor reuse, will use out-line predictcount and map count array, will not use inline predict count.
This commit is contained in:
@@ -93,16 +93,15 @@ namespace StgSharp.HighPerformance.Memory
|
||||
// This branch performs resident-line adoption rather than a simple policy
|
||||
// equality check. Returning true means the current predictor can keep using
|
||||
// the existing cache bytes without a write-back plus re-prefetch cycle.
|
||||
if (predict.IsSamePolicy(head->Profile, belong))
|
||||
if (!ReferenceEquals(predict, belong))
|
||||
{
|
||||
head->Predictor = (short)predictIndex;
|
||||
throw new L4PredictConflictException(head->Origin, head->Profile, predictId);
|
||||
} else
|
||||
{
|
||||
// Compatibility failed, so the old owner must first flush its view of
|
||||
// the line before the new predictor rematerializes the cache bytes.
|
||||
belong.WriteBack(head->Origin, head->Profile, new ReadOnlySpan<byte>((byte*)head->Address, (int)head->Size));
|
||||
head->Profile = pHandle.MapPolicy;
|
||||
predict.Prefetch(head->Origin, head->Profile, new Span<byte>((byte*)head->Address, (int)head->Size));
|
||||
|
||||
_ = Interlocked.Increment(ref head->RemainingPredictionCount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user