Repository navigation
feature(sysman): report page offline state from drm-ras - #1071
rodrigovivi wants to merge 3 commits into
Conversation
Take drm_ras.h from make headers_install of the drm-ras retired-pages series, which adds the telemetry and retired-pages node types and their commands: https://github.com/rodrigovivi/linux/commits/xe-ras-retired-pages-v7 This should be replaced by the regular drm-next sync once the series lands. Assisted-by: LLM Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Add the get-retired-pages dump and the get-retired-pages-info request of the drm-ras retired-pages node to DrmNlApi. A dump of a node with no retired pages only carries NLMSG_DONE, so also end the transaction on NL_CB_FINISH, instead of waiting for a reply that never comes. Assisted-by: LLM Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Report the offline and pending offline pages, and the maximum number of offline pages, from the drm-ras retired-pages node of the device, when the kernel exposes one. This works for any device whose driver registers the node, and gives the page address in bytes, where the vram_bad_pages file gives a page frame number. Fall back to the vram_bad_pages sysfs file when there is no such node. Assisted-by: LLM Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
| std::vector<MemPageInfo> pageList; | ||
| ze_result_t result = NetlinkRetiredPages::getPages(pLinuxSysmanImp->getDevicePciBdf(), pageList); | ||
| if (result == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) { | ||
| return pSysmanProductHelper->memoryGetPageOfflineStateExp(pSysfsAccess, pageStatus, pCount, memPageInfoList, pPageOfflineInfo); |
There was a problem hiding this comment.
Will the sysfs node for the bad pages still be available alongwith the netlink interface ?
There was a problem hiding this comment.
No! This drm-ras is a replacement.
| */ | ||
| enum drm_ras_node_type { | ||
| DRM_RAS_NODE_TYPE_ERROR_COUNTER = 1, | ||
| DRM_RAS_NODE_TYPE_TELEMETRY, |
There was a problem hiding this comment.
What is this type used for ?
There was a problem hiding this comment.
It comes with the header sync. Telemetry nodes were added upstream in c95c93b6e26c ("drm/drm_ras: Extend DRM RAS interface to include telemetry nodes"), for the qaic accelerator. Sysman doesn't use them; they're in the header because it's a copy of the kernel uAPI.
| ze_result_t NetlinkRetiredPages::getPages(const std::string &devicePciBdf, std::vector<MemPageInfo> &pageList) { | ||
| auto pDrmNl = createDrmNlApi(); | ||
| std::vector<uint32_t> nodeIds; | ||
| ze_result_t result = getRetiredPagesNodes(pDrmNl.get(), devicePciBdf, nodeIds); |
There was a problem hiding this comment.
Can this return multiple nodeIds for each device ? If no, then the subsequent for loop may not be required.
There was a problem hiding this comment.
Yes, the uAPI allows it: a driver can register one retired-pages node per memory that retires pages, for example VRAM and system memory. xe registers only vram-retired-pages today, so the loop runs once, but it keeps sysman correct if a second node shows up. For the max pages, the nodes are added up.
| ze_result_t NetlinkRetiredPages::getMaxPages(const std::string &devicePciBdf, uint32_t *pMaxPages) { | ||
| auto pDrmNl = createDrmNlApi(); | ||
| std::vector<uint32_t> nodeIds; | ||
| ze_result_t result = getRetiredPagesNodes(pDrmNl.get(), devicePciBdf, nodeIds); |
There was a problem hiding this comment.
Make the Level Zero sysman page offline API report the pages the kernel retired through the new drm-ras
retired-pagesnetlink node. The API is unchanged:zesIntelDeviceMemoryGetPageOfflineStateExpand themaxOfflinePagesproperty keep their signatures and semantics.build: syncdrm_ras.hwith the kernel series (to be replaced by the regular drm-next sync once it lands)DrmNlApi: add theget-retired-pagesdump and theget-retired-pages-inforequest. Also end a transaction onNLMSG_DONE, since a dump with no pages carries no reply message.vram_bad_pagessysfs file otherwise. Retired maps to offline; pending and failed map to pending offline. Addresses are in bytes, while the sysfs file gives page frame numbers.The node isn't tied to CRI, so this works for any device whose driver registers it.
Kernel series (drm-ras retired-pages node type, xe user):
IGT test and tool: https://lore.kernel.org/igt-dev/20261127181133.801215-10-rodrigo.vivi@intel.com/T/#t
Testing:
ze_intel_gpu_sysman_testspass on all 16 products, with new tests for the netlink requests and the global operations path.zello_sysman -greports the same pages and max pages as the drm-ras IGT tool and debugfs. Without root it returnsZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS, and the iGPU without a node still reports unsupported.🤖 Generated with Claude Code