From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/shmem-helper: Fix Map huge page mapping in fault handler Date: Sat, 14 Mar 2026 06:52:13 +1000 Message-ID: In-Reply-To: <20260313141719.3949700-1-pedrodemargomes@gmail.com> References: <20260313141719.3949700-1-pedrodemargomes@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: drm/shmem-helper: Fix Map huge page mapping in fault handler Author: Pedro Demarchi Gomes Patches: 2 Reviewed: 2026-03-14T06:52:13.837152 --- This is a single-patch fix for a real race condition in `drm_gem_shmem_helper.c`. The bug occurs when two concurrent page faults within the same PMD range cause one fault to install a PMD mapping via `vmf_insert_pfn_pmd()` from the `.fault` handler, while another tries to install a PTE mapping via `vmf_insert_pfn()`. The kernel then hits a `BUG()` in `walk_to_pmd()` because it encounters an unexpected `pmd_trans_huge` entry. The fix correctly separates the PMD mapping path into a `.huge_fault` callback, letting the mm subsystem properly route faults of different orders. The approach follows the same pattern already used by the VFIO PCI drivers (`vfio_pci_core.c`, `nvgrace-gpu/main.c`). The fix is appropriate and the Fixes tag is correct. There are a couple of minor issues worth noting. --- Generated by Claude Code Patch Reviewer