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/amdgpu: fix sleeping allocation under spinlock in PASID IDR Date: Tue, 31 Mar 2026 17:36:41 +1000 Message-ID: In-Reply-To: <20260330053025.19203-2-mikhail.v.gavrilov@gmail.com> References: <20260330053025.19203-1-mikhail.v.gavrilov@gmail.com> <20260330053025.19203-2-mikhail.v.gavrilov@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Status: Good** The fix uses the standard `idr_preload()` / `GFP_NOWAIT` pattern: ```c + idr_preload(GFP_KERNEL); spin_lock(&amdgpu_pasid_idr_lock); pasid =3D idr_alloc_cyclic(&amdgpu_pasid_idr, NULL, 1, - 1U << bits, GFP_KERNEL); + 1U << bits, GFP_NOWAIT); spin_unlock(&amdgpu_pasid_idr_lock); + idr_preload_end(); ``` This is the textbook kernel approach: `idr_preload(GFP_KERNEL)` pre-allocat= es radix-tree nodes in sleepable context with preemption disabled, then `GF= P_NOWAIT` inside the spinlock draws from the preloaded pool. `idr_preload_e= nd()` re-enables preemption after the lock is released. The ordering is correct: `idr_preload()` before `spin_lock()`, and `idr_pre= load_end()` after `spin_unlock()`. No issues. Note: The Fixes: tag references `14b81abe7bdc` while the cover letter menti= ons `8f1de51f49be`. Both should refer to the same commit that introduced th= e IDR conversion. The cover letter and patch 2 use `8f1de51f49be` =E2=80=94= the discrepancy in the Fixes: tag on patch 1 (`14b81abe7bdc`) should be ve= rified. If these are different commits, the correct one to cite is whicheve= r actually introduced `idr_alloc_cyclic()` with `GFP_KERNEL` under the spin= lock. --- Generated by Claude Code Patch Reviewer