From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22D4023C39A for ; Fri, 10 Jul 2026 19:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783710478; cv=none; b=HgkIcS7wqggp5fi9Mer7nIzQP4qoBXIcCfv2nRRHeZ0eF2WTqZj/gSYRoeqLMwGLyB5SL80fCqKOBE+AWz8XKqtHpOQypTxK4V3/6Kh4OP2RwW3RkFL/SPfBdY60LhJ0+hjX4ddvgRTP+bFYNLaUQiOBJksZ0poLzD2wLHn1Z10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783710478; c=relaxed/simple; bh=v2c8ve1eOpm9ZGAfxSFM+Y9p3YLh5Tuis6XJ274g65g=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qRbaeP18tN8hu4xEmwNR8vzyTILZmZrw11ul9gv/avc0KgpJNvtDLqiUb3HF1JwDuuzvxHv6aIzZdSVq+sFdEm3FBeQxJpMqjHlVNjpq2M/Zk86EW4KT6dUS428bOehwo079FWoaKy+gKC0utLI5Q2Nw4vA6JUodlvr/R2RkVMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gf5FoW0z; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gf5FoW0z" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-493b77b150aso11104765e9.2 for ; Fri, 10 Jul 2026 12:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783710475; x=1784315275; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=v2c8ve1eOpm9ZGAfxSFM+Y9p3YLh5Tuis6XJ274g65g=; b=gf5FoW0zGTLzaoFgrbvIOl3NDiESKc0OVz+TgmFr3sJYv3iz4TM8Dt0CmbIfHdROnx p9kBbOWQx4/UZlTVR9gDDYi80VHxq/EOZBjGqa/Z21Rctmc5a/qwqOyuh2oQaBEPKzeT KCpilYkqhTwpfqKt3EP46HCUpHxwRSeC6WqSkusMAzNKiQoytT8vR7l18KBswGN7ulkn kWz/AIa8b7dLs2oD8HJZaRvEWASgHajyZn0rW38cLXDTlh7pXH0JrdAfBcAabrdXzU6U ByoluUeyXkhLTKzcJLW+gjZV6+a5HVITzZYi2qy+Ae+IFMX7B7v39kzVwSohrRNH2bTY eDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783710475; x=1784315275; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=v2c8ve1eOpm9ZGAfxSFM+Y9p3YLh5Tuis6XJ274g65g=; b=fm3IqBNTgPg0/wtv/ZcIyNPuno1dAn7VL6nkgFRFwYJhZK7juD8k8dyCXH+8ihmOAe t702EW20TiyHtI5sxgglbaqNVzuAkJiPx+MQewI5OpJCEn5cc1usRPnXRTZHL6+SR/oF 9BDd0IAxo6JMaj3p5DvcYN9Y+9euFCPvs2COAQCFJXqT5hWV9LkfgEbDOV/BcfvC3utl m3RIBAunv8046JAVSbfd31Vtl9EDuwWumsYMuQ9vwOvCplT3EhCo5q7EtbsOTCagLj/R +6MMJlA6R1aiDrSLUQtiqz3MqrtTyJowbjE9F1nJIFdmgvwRnkPb2kIay3CNU8PkIRo2 mhfQ== X-Forwarded-Encrypted: i=1; AHgh+RrBKWAaJUfsO5ylehZwF624+0zNCXDViogxZ5Jc89fZ5pu/dE/nppS0AKeVdpogoHnMptSbBcwn5aFXGmE=@vger.kernel.org X-Gm-Message-State: AOJu0YzoBcRVqZDNCRjpChQtHR+cHtMr4IvrGms8Gbm9WUbP4zhYSG+W 0on8MH/wNyc171eN3YEKIAQ6+uioED+QFnQm3wQgsSxaNZ7t3mGdZM0w X-Gm-Gg: AfdE7clubV/PzOz0z0j8hEbCLRnvI0lJSgJkOWix20EE8vk7yRj10vM5pqCnH8Al1/K qDydd2wMdJmjsLfSXsIKas6L3Jp2EQldWvfV383CGbwtRzQpSjLLtd0OAOAqhdKF/Jw7GDvs8Rz ukiuibiWLC6oGP0PQn4LxNfrDb1bc8lrMPQqJ31rVHQVIsdaiJsF9MgA3KaqQrteXDhMR7iznzy +rJ9/NtWoOmxz1CeLqPKKugHpNDJYusKfDteCOgbfAfrQSR9QqhRmGZQ/TxJDDFKHtDAimZbkvq JkaUXpCCRURnrKOGKViLBVPBf8p7LcUCskhfMpr59kT/+2fHyimBFoSJdl6tlfJN1w1enSMXOPD uvEnzbUKaShUU9wGB5SX2Eboyx4Xrrv427HPwsIR3JesZ4wGapm+82iHtJVURRvhHSD5OYkTVbm XeaXFspsuJwytoDB3Gul8mMq8isg== X-Received: by 2002:a05:600c:5489:b0:493:e97c:216e with SMTP id 5b1f17b1804b1-493f8851d4emr810365e9.39.1783710475270; Fri, 10 Jul 2026 12:07:55 -0700 (PDT) Received: from able.fritz.box ([2a00:e180:154f:ec00:aa08:de24:db33:4496]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f567eadfsm55000755e9.6.2026.07.10.12.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 12:07:54 -0700 (PDT) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: thomas.hellstrom@linux.intel.com, dakr@kernel.org, ecourtney@nvidia.com, simona@ffwll.ch, matthew.brost@intel.com, nat@pixelcluster.dev, airlied@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: Refcounting dma_resv and using that for drm_exec support in TTM Date: Fri, 10 Jul 2026 20:52:40 +0200 Message-ID: <20260710190752.2355-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi everybody, The idea of ref-counting dma_resv or ww_mutex came up multiple times from different people, but so far at least I have abandoned that as to complicated to implement considering how widely used that object is. Thanks to AI I gave the task to refcount dma_resv to Claude Sonet 4 just to check how horrible it would look like. Well turns out that this is actually a cleanup we should most likely aim for and I'm really wondering why we haven't done it like this in the first place. Not only resolves it a bunch of issues with dma_resv instances shared by multiple GEM objects (we just recently had a bunch of patches for that on the mailing list), but also allows TTM to implement it's delayed delete handling without any zombie resurrection or similar hacks. The patch set is totally work in progress and only survives a smoke test with amdgpu, but I still wanted to check if the idea is valuable and should be looked in further. Please comment and/or tear apart :) Cheers, Christian.