简体   繁体   English

如果它具有活动映射,我必须保留虚拟地址范围保留吗?

[英]Must I keep a virtual address range reservation if it has active mappings?

CUDA's low-level virtual memory management mechanism involves: CUDA的低级虚拟memory管理机制涉及:

  • Physical allocations物理分配
  • Virtual address range reservations虚拟地址范围保留
  • Mappings between the above上述之间的映射

Conveniently, if you map a physical allocation to some address range - you can "free" the physical allocation and keep using it until it is unmapped.方便的是,如果您 map 对某个地址范围进行物理分配 - 您可以“释放”物理分配并继续使用它,直到它被取消映射。

Can we also do this for virtual address range reservations?我们也可以为虚拟地址范围保留执行此操作吗? ie will they be kept alive until the mappings are gone?即在映射消失之前它们会一直保持活力吗? The documentation doesn't say.文档没有说。

You can't early-free reserved address ranges.您不能提前释放保留的地址范围。

Virtual memory address range reservations apparently don't have the reference-counting mechanism which physical allocations have;虚拟 memory 地址范围保留显然没有物理分配所具有的引用计数机制; the driver expects them to be released when they are no longer in use, period.司机希望它们在不再使用时被释放,期间。 An attempt to free the reservation will fail with CUDA_ERROR_INVALID_VALUE .释放预留的尝试将失败并显示CUDA_ERROR_INVALID_VALUE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM