Implementing a custom replacement policy for Unified Memory

I’ve been think of analyzing the behavior of the current replacement policy for Unified Memory, then write one on my own.

Recently, I’ve been told that different replacement policy can be implemented on the Nvidia driver interface code.

But since the driver kernel code is pretty monolithic, I wish to get a prior knowledge before getting started.

Can it be done, to pin data on either side of device and host memory byte by byte, to manipulate replacement policy.

Also, will it be related to the uvm8_perf_*.c?