From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: accel/ivpu: Limit number of maximum contexts and doorbells per user Date: Sat, 21 Feb 2026 05:58:02 +1000 Message-ID: In-Reply-To: <20260220160059.220328-1-maciej.falkowski@linux.intel.com> References: <20260220160059.220328-1-maciej.falkowski@linux.intel.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: accel/ivpu: Limit number of maximum contexts and doorbells per user Author: Maciej Falkowski Patches: 1 Reviewed: 2026-02-21T05:58:02.994714 --- This is a single patch that introduces per-user resource limits in the Intel IVPU (NPU) accelerator driver. The goal is to prevent a single user from monopolizing all contexts and doorbells on multi-user systems, by allowing root to use all resources and non-root users to use at most half. The general architecture is reasonable: a `struct ivpu_user_limits` is allocated per-uid, reference-counted via kref, and tracked in a hashtable on the device. Each `ivpu_file_priv` holds a reference to the limits structure for its uid. Doorbell counts are tracked with an atomic counter. The implementation correctly handles error paths in `ivpu_open()` and `ivpu_register_db()`, and adds proper cleanup in `ivpu_cmdq_reset()` and `ivpu_cmdq_unregister()`. There are several issues, most notably an off-by-one error in the context limit enforcement that allows one extra context beyond the intended maximum, a change to `IVPU_USER_CONTEXT_MAX_SSID` that expands the total context count to 129 (an odd number that doesn't divide neatly), and a raw uid comparison for privilege checking instead of using standard kernel credential helpers. --- Generated by Claude Code Patch Reviewer