From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EDCE30569F for ; Fri, 12 Jun 2026 13:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781272457; cv=none; b=Y+6WnYcXrwfjOo96Gp5YmXd/O7DsVje9qnN+E61N8a+TkFaxhcpy/YpD/7rB/jX2RS8EHPE3znOCij0XLXMMpYyb4YpyWrzN1y3MV6VaagM3NPqNyjMTan75PWbeQ0IqT4iAYmWhA9o5uJsQnfeiKl3QdapH1/3T8CgBs65wMrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781272457; c=relaxed/simple; bh=qN4yzoth1LaW60vFJEAmmrb4qCXdJVnNa0CSkClKJrk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=plKbB9qsF3nHQoBBI8E+CbNN58hDbZn9y4NabuvQ2RRMrfcsuEpgT6Fy6uIL/tT/OpD9hokFjByyrLc9zBhKf5XPGCwhzAmjkc149DnZpraMiarpTeWhCuzYQerCkkakaEHjhYPAiEd+3YmYYJ4ZHVMZRPHIXXfu5db3nYaibZ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=B1o03+fw; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="B1o03+fw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781272455; x=1812808455; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qN4yzoth1LaW60vFJEAmmrb4qCXdJVnNa0CSkClKJrk=; b=B1o03+fwMvddiAS0G8blmoVdyNbBG6mz7mN9NsVVwKOHoOuiAssqk3NM WhQIYtk9OIU3/sI5jQb9czoPctJku8zMbFFBM8x30anh1R5abNFbhbitN //BcvXV/LZuJocXMCaxwfZ3BbiyeCgMKnFeqcbr/ayajvE5ZkjAmufDI6 KgbA3luy6XkbcrxY1Z3r8GJJ3HUd2hMFXqY9qIs2Ubva2USjvT7m8rIOo cdtxDq/BM1c5g1vKeK+oaJ+qinbUNe8inp97Rn4LNSfw+nzchLavp7xaM 9wc594eUx353ITxMdcNZcJbcodEO+dAKobc5/wFRxCgSevvx2V+fB9i6f Q==; X-CSE-ConnectionGUID: U6AJ/WvmTt6ZQ70P5UUeww== X-CSE-MsgGUID: OBArXj4zRDyKAzTFXvtjMg== X-IronPort-AV: E=McAfee;i="6800,10657,11813"; a="82163292" X-IronPort-AV: E=Sophos;i="6.24,200,1774335600"; d="scan'208";a="82163292" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2026 06:54:15 -0700 X-CSE-ConnectionGUID: VfAvi7N8QpSq/D+9VuxTEw== X-CSE-MsgGUID: uy1KPicUTYyGPIYdxBHaeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,200,1774335600"; d="scan'208";a="242446517" Received: from slindbla-desk.ger.corp.intel.com (HELO fedora) ([10.245.245.68]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2026 06:54:11 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost , Maarten Lankhorst , Michal Mrozek , John Falkowski , Rodrigo Vivi , Lahtinen Joonas , David Howells , Christian Brauner , Kees Cook , Davidlohr Bueso , =?UTF-8?q?Christian=20K=C3=B6nig?= , Dave Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, LMKL Subject: [RFC PATCH 0/4] Xe driver asynchronous notification mechanism Date: Fri, 12 Jun 2026 15:53:36 +0200 Message-ID: <20260612135340.116100-1-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a need to inform user-space clients when a rebind worker has ran out of memory so that it can react, adjust its working-set and restart the job. This patch series aims to start a discussion about the best way to accomplish this. The series builds on the core "general notification mechanism" or "watch_queue", and attaches a watch queue to each xe drm file. The watch_queue is extremely flexible and allows filtering out events of interest at the kernel level. There can be multiple listeners. Patch 1 Implements a restart IOCTL for rebind-workers paused on OOM. Patch 2 Adds fault-injection into the rebind worker for testing. Patch 3 Adds a DRM_XE_NOTIFY watch_type. Patch 4 Implements watch_queue event sending from within xe. igt series: Test-with: https://patchwork.freedesktop.org/series/168429/ Compute UMD side is not available yet. Will be available before final review. Thomas Hellström (4): drm/xe: Add DRM_IOCTL_XE_VM_RESTART IOCTL drm/xe: Add fault injection for rebind worker -ENOSPC watch_queue: Add a DRM_XE_NOTIFY watch type and export init_watch() drm/xe: Add watch_queue-based device event notification MAINTAINERS | 1 + drivers/gpu/drm/xe/Kconfig | 1 + drivers/gpu/drm/xe/Makefile | 1 + drivers/gpu/drm/xe/xe_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_device.c | 8 ++ drivers/gpu/drm/xe/xe_device_types.h | 6 ++ drivers/gpu/drm/xe/xe_vm.c | 135 ++++++++++++++++++++++++++- drivers/gpu/drm/xe/xe_vm.h | 13 ++- drivers/gpu/drm/xe/xe_vm_types.h | 3 + drivers/gpu/drm/xe/xe_watch_queue.c | 111 ++++++++++++++++++++++ drivers/gpu/drm/xe/xe_watch_queue.h | 20 ++++ include/uapi/drm/xe_drm.h | 91 +++++++++++++++++- include/uapi/drm/xe_drm_events.h | 62 ++++++++++++ include/uapi/linux/watch_queue.h | 3 +- kernel/watch_queue.c | 13 ++- 15 files changed, 462 insertions(+), 10 deletions(-) create mode 100644 drivers/gpu/drm/xe/xe_watch_queue.c create mode 100644 drivers/gpu/drm/xe/xe_watch_queue.h create mode 100644 include/uapi/drm/xe_drm_events.h -- 2.54.0