Hi Amiya,

NDC is a cache that NPA uses to cache frequently accessed contexts and stack 
pages. All accesses to contexts/stack pages go via this cache only. There is NO 
direct access to backing memory in NPA operations.

On AQ Init, the context is first allocated in the cache. Whenever NPA must 
access this context (for subsequent alloc/frees or AQ reads/writes), it will 
read/write directly from the cache. The context/stack pages never gets evicted 
out of the cache (unless there are more contexts/stack pages active at the same 
time than the NDC can hold).

Doing an NDC sync will write back the dirty entries in the cache to the backing 
memory. This does not affect the normal operation of NPA in anyway. Even after 
you do a sync, the entries remain in the cache and further NPA operations still 
read/write from the cache. The backing memory is NEVER accessed directly.

Why we need it at teardown is to avoid corruption. We free stack pages when we 
destroy the pool. If there are stale entries for these stack pages remaining in 
the cache, then at a later point of time, these entries can become candidates 
for eviction and can cause writes to memory which was already freed causing 
corruption/translation faults etc.

>> how it's a side effect of IOVA as PA
IOVA as PA is NOT a supported mode. We have not studied what kind of errors 
will pop up in this mode. Explaining the side effects in this mode will require 
deeper study which we don't think is necessary for an unsupported mode. 

Thanks
Ashwin  

Reply via email to