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/amdkfd: Add batch MMU notifier support Date: Wed, 11 Feb 2026 17:15:49 +1000 Message-ID: In-Reply-To: <20260209061047.3881808-5-honglei1.huang@amd.com> References: <20260209061047.3881808-1-honglei1.huang@amd.com> <20260209061047.3881808-5-honglei1.huang@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Patch Review **Overview:** Implements MMU notifier for batch allocations. **Issues:** 1. **Race Condition - Critical:** After unlocking `notifier_lock`, the code continues to access `mem`: ```c + mutex_unlock(&process_info->notifier_lock); + mem->invalid++; ``` There's a TOCTOU (time-of-check-time-of-use) issue if `mem` can be freed between the check and increment. 2. **Return Value Ignored:** ```c +static bool amdgpu_amdkfd_invalidate_userptr_batch(...) +{ + amdgpu_amdkfd_evict_userptr_batch(mni, range, cur_seq); + return true; +} ``` Always returns true even if eviction failed. The caller might need to know about failures. --- Generated by Claude Code Patch Reviewer