Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess it depends on if the IOMMU has a fault interrupt that can be acted upon. If it does, then it can probably be done. However, I'm not sure if the OS will handle this or not.

When the OS runs out of RAM, it can swap pages to disk. If this page also has a mapping in an IOMMU, it can invalidate the mapping there as well.

Then, when the device attempts to touch the page, the IOMMU faults and the CPU would swap the page back in.

I'm not sure if this is possible, but this is the route I'd expect something like this to follow.



> I guess it depends on if the IOMMU has a fault interrupt that can be acted upon. If it does, then it can probably be done. However, I'm not sure if the OS will handle this or not.

Interesting idea. I'd also like to know if IOMMU faults can be acted upon. It might require protocol support between the bus and hardware device (GPU) [1], to tell it the page is not currently present. And a way to tell GPU once the page is available.

As far as I can see this kind of mechanism would require one CPU interrupt per GPU fault. That might be too inefficient.

[1]: Edit: It's indeed possible to handle, if the device supports "PCI-SIG PCIe Address Translation Services (ATS) Page Request Interface (PRI) extension".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: