요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==========================
I915 Small BAR RFC Section
==========================
Starting from DG2 we will have resizable BAR support for device local-memory(i.e
I915_MEMORY_CLASS_DEVICE), but in some cases the final BAR size might still be
smaller than the total probed_size. In such cases, only some subset of
I915_MEMORY_CLASS_DEVICE will be CPU accessible(for example the first 256M),
while the remainder is only accessible via the GPU.
I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS flag
----------------------------------------------
New gem_create_ext flag to tell the kernel that a BO will require CPU access.
This becomes important when placing an object in I915_MEMORY_CLASS_DEVICE, where
underneath the device has a small BAR, meaning only some portion of it is CPU
accessible. Without this flag the kernel will assume that CPU access is not
required, and prioritize using the non-CPU visible portion of
I915_MEMORY_CLASS_DEVICE.
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
:functions: __drm_i915_gem_create_ext
probed_cpu_visible_size attribute
---------------------------------
New struct__drm_i915_memory_region attribute which returns the total size of the
CPU accessible portion, for the particular region. This should only be
applicable for I915_MEMORY_CLASS_DEVICE. We also report the
unallocated_cpu_visible_size, alongside the unallocated_size.
Vulkan will need this as part of creating a separate VkMemoryHeap with the
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set, to represent the CPU visible portion,
where the total size of the heap needs to be known. It also wants to be able to
give a rough estimate of how memory can potentially be allocated.
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
:functions: __drm_i915_memory_region_info
Error Capture restrictions
--------------------------
With error capture we have two new restrictions:
1) Error capture is best effort on small BAR systems; if the pages are not
CPU accessible, at the time of capture, then the kernel is free to skip
trying to capture them.
2) On discrete and newer integrated platforms we now reject error capture
on recoverable contexts. In the future the kernel may want to blit during
error capture, when for example something is not currently CPU accessible.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Small BAR와 CPU-access BO flag
1-21DG2부터 device local memory인 `I915_MEMORY_CLASS_DEVICE`에 resizable BAR를 지원하지만 최종 BAR size가 전체 `probed_size`보다 작을 수 있습니다. 이 경우 예를 들어 처음 256M만 CPU가 접근하고 나머지는 GPU만 접근합니다.
새 `I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS` gem_create_ext flag는 BO에 CPU access가 필요함을 kernel에 알립니다. Small BAR의 device-memory object placement에서 중요합니다.
Flag가 없으면 kernel은 CPU access가 필요 없다고 가정하고 `I915_MEMORY_CLASS_DEVICE`의 CPU-visible하지 않은 부분을 우선 사용합니다. uAPI kernel-doc은 `Documentation/gpu/rfc/i915_small_bar.h`의 `__drm_i915_gem_create_ext`를 포함합니다.
Device region을 CPU visibility로 나눕니다.
Flag가 allocation 후보를 제한합니다.
==========================
I915 Small BAR RFC Section
==========================
Starting from DG2 we will have resizable BAR support for device local-memory(i.e
I915_MEMORY_CLASS_DEVICE), but in some cases the final BAR size might still be
smaller than the total probed_size. In such cases, only some subset of
I915_MEMORY_CLASS_DEVICE will be CPU accessible(for example the first 256M),
while the remainder is only accessible via the GPU.
I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS flag
----------------------------------------------
New gem_create_ext flag to tell the kernel that a BO will require CPU access.
This becomes important when placing an object in I915_MEMORY_CLASS_DEVICE, where
underneath the device has a small BAR, meaning only some portion of it is CPU
accessible. Without this flag the kernel will assume that CPU access is not
required, and prioritize using the non-CPU visible portion of
I915_MEMORY_CLASS_DEVICE.
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
:functions: __drm_i915_gem_create_ext
CPU-visible region size attribute
22-36새 `struct__drm_i915_memory_region` attribute `probed_cpu_visible_size`는 특정 region에서 CPU가 접근 가능한 전체 크기를 반환합니다. `I915_MEMORY_CLASS_DEVICE`에만 적용해야 합니다.
전체 미할당 크기 `unallocated_size`와 함께 CPU-visible 미할당 크기 `unallocated_cpu_visible_size`도 보고합니다.
Vulkan은 CPU-visible 부분을 나타내는 `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`가 설정된 별도 `VkMemoryHeap`을 만들 때 전체 heap size가 필요합니다. 또한 앞으로 allocation할 수 있는 memory를 대략 추정하려 합니다.
관련 kernel-doc은 `i915_small_bar.h`의 `__drm_i915_memory_region_info`입니다.
전체 device memory와 visible subset을 구분합니다.
Visible subset을 별도 heap으로 노출합니다.
probed_cpu_visible_size attribute
---------------------------------
New struct__drm_i915_memory_region attribute which returns the total size of the
CPU accessible portion, for the particular region. This should only be
applicable for I915_MEMORY_CLASS_DEVICE. We also report the
unallocated_cpu_visible_size, alongside the unallocated_size.
Vulkan will need this as part of creating a separate VkMemoryHeap with the
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set, to represent the CPU visible portion,
where the total size of the heap needs to be known. It also wants to be able to
give a rough estimate of how memory can potentially be allocated.
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
:functions: __drm_i915_memory_region_info
Error capture 제한
37-47Small BAR system의 error capture는 best effort입니다. Capture 시점에 page가 CPU-accessible하지 않으면 kernel은 해당 page capture를 생략할 수 있습니다.
Discrete와 더 최신 integrated platform에서는 recoverable context의 error capture를 거부합니다.
미래에는 현재 CPU가 접근할 수 없는 data를 capture하기 위해 kernel이 error capture 중 blit을 사용할 수 있습니다.
CPU visibility와 context 복구성에 따른 제한입니다.
Capture 가능 여부를 visibility와 context로 결정합니다.
Error Capture restrictions
--------------------------
With error capture we have two new restrictions:
1) Error capture is best effort on small BAR systems; if the pages are not
CPU accessible, at the time of capture, then the kernel is free to skip
trying to capture them.
2) On discrete and newer integrated platforms we now reject error capture
on recoverable contexts. In the future the kernel may want to blit during
error capture, when for example something is not currently CPU accessible.
요약·해설
i915_small_bar.rst:1-47DG2 small BAR의 CPU-visible memory placement·region info·error capture를 설명합니다.
Source와 관련 symbol입니다.