From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796052940; b=cdIRMlshAQve+vqd6OTC4grRa3sEc8dZHrZApurb6vTBxSw8bqL42GhDXgu/EsoPJDPT H5p5CBMJjsyqnshESbrzNP3WKbZyBA1vX3RY2Y7tOo61bJnHynpcRT+gI6Uxcf9bVMrBk dVdQCCkGlGW+lSgzhudHFqunzEpORSlAY0gmx4ivh14ZyReiOl9yDqYQF1iaqvPVcsSUV hSc5fqjSrxSqLsUAAXyV4PEXIPkXsjx9fTc05rvQPR0ZgMi/j2sHJoVYgfZ4g/uYcae6E zb1h1k/bvMPc264OJ9ELsG1tPDPv3ac7m2q8DnsTD9QPxAruHN/JXqjymbs0zdvhAlw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796052940; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=VUV4W7lgQgMUfQ6MvvOyUuO3X3Stv0933vpgPRxXhRs=; b=z7A93IGgYcrDpIA/PQMYYJbY5n3/TJU3fErD7eDAKl5eNfowZCOY7g2Ki6qOJEcsdNiS X0RygllVr5GYK1QKc1rP0q+ydxTlxp1Oe11bppd3/GqC2pJfVX/lixFi2kVojYHgzQ6HB xKXoWvOOGdv9iZfd1nxsz5sG2/TFBBYZLbono/JZU8ocsyR+fOhpGEcd4HwQ4cCff5LV2 MYBemoNA7A1eNwHVgcgUbgYX9OX4AocWqdehS7EH6Un3phM/3DREMgD50z3o9AzKKC4cG 9qcvd82fdlR6m6fheKz4UEyaX/Jk8e+MnyEmKp6yrxMyMK2B/sGjbfMN+4sGvttFn6g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=KBiZ6Dpp; arc=none smtp.remote-ip=209.85.214.174 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C91D606A31C for ; Mon, 30 Nov 2026 15:35:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C91D606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=KBiZ6Dpp Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2f0e8bbc7a4so236205ad.1 for ; Mon, 30 Nov 2026 07:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796052940; x=1796657740; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VUV4W7lgQgMUfQ6MvvOyUuO3X3Stv0933vpgPRxXhRs=; b=KBiZ6Dppgj2QnCJAeWdl7/x+5nZ8Jl+gJZkFm80PIvRqO0zs0FBvMHMXrWa/qN4+2i DdxORKgkczE0G1e8DsqM2wHxJ7FxEQ/Xf5kqkP2elMiVZa66lNfMdWFLuCUsCsHC43oi djJ7mJpymtG2XtWmARpDtipRAdjkxENankhdlm+WjPKbr9pyFNdOhy/Pm0SX+062bVi0 nXFnbAC7A/nZQe14BDPz2wCvcdD2iAiGKP+4MkU1gyGDS3vAGjoxmYtatp4DbHZ4ts/t SXmxyYT0MQSZfXCQhieWEb9W3HNS6ccWUcECBWKqA87gofta2wtkH5qE20xqhY1MS6zp T6KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052940; x=1796657740; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VUV4W7lgQgMUfQ6MvvOyUuO3X3Stv0933vpgPRxXhRs=; b=rmY2fc415l1QgmDJlBzGzZSzz/R3Ag9MZ84QBLoAhJzK8Is94RI3rEdDqdKJ7wVwX1 bFuTo2Wl8Ua6aXc36GPE2rRvHjFttwIUgicpEb61Ha9AyFxL6xDWW6akFsYNN7gvQ0vg HNx4GzPf080xtf3myGig40OqDtob2WCAT1LYEqA6781alYNKm4apMjX6FQ4PHe4rQtq/ EXEJlybfk4Edz5yN+aBRCNjdJKhV0wpDX4dvufnJUDorLMZx4ESZKYfxF0ol5SqnE9q9 WKU8Hf+x2DiDQRIBoAtdaO3a2eUobfQPfq+fkovK7fHEARJgp6bGhC/mRv8mO91hTW+7 LkVw== X-Forwarded-Encrypted: i=1; AL+hErHY7OKtLhyYf9mcYHvBZ3Mdy82ExOazqpuU0ZoR8xJbR8HbUoJpE+9y4vqeHLWKbf+VDifFAoE+KvzaRis=@vger.kernel.org X-Gm-Message-State: APuU4Z8m9k5E6gWJ6RwBgM2f68Kdj0dYs1/1BJxuuiFbSL0TaLXtoTMd 4mczN57Y2cIdBSyA2Ev8oyp2MeCKHHHr2/7FlB+NojfaEcmZpgp4yVphNFBk6mXMaw== X-Gm-Gg: AZFdTZcJryWq2Sssfzo31nNDFYVd0aw8RN/1qmmpC20sjq37h0mPzhOmP8CM7HCnXSj felYJ6QHMiEr/AIXQYQ5ZaWpShdT6KsT42rO4wIKB726hu2pVyr7J6D5M/shqv/+1KMo/d4EoMm t8ZO6p5RekXIDyas6y45rLHZvhZD30p0boMMMF/XjnLeo8WWv877+GR6+CD6wovICcfxFBQYKLO kb/UIbTDv0m+9dg5Bu8KzKvllKjS5FnziI08FWkiv44qYXm1e72uP0xthHYBpKJXAJul55MXNEy qO4sypDMUUEhmWpB8H+sNZBc1jJ6u4W66Ziw1rcLPChbW/X21qXwIWuvUp82IpTQLyzAU4rxhVa u1cMBHevNz5V6B7WuF8749M/R15vsuV2ZjD/0HIaQy8O4RXJV2Q3nrH6fgJvspBVCYHdfVmMWib 1vkOthrHUucW2ml9Bsq5NRgUbX/0Eeexdle94S8lvErXnBP8k33mpUjZI4+jHWZ98fo80Vm9t03 U1CCdRj/a2dynPZP2wjA6NszmknWdncV/iIuGHSZRJgCpHZyfWSC6Yr7x9hHqVdXHP91FfMU6dW 7njkfZKAOf59w88wpzmL/ybZLhjapquQuoPP3c/ssFx2761OMnxjwrUhfFtPLs35qA4= X-Received: by 2002:a17:902:f709:b0:2e6:1735:f645 with SMTP id d9443c01a7336-2f062b91bfdmr28218695ad.4.1796052939048; Mon, 30 Nov 2026 07:35:39 -0800 (PST) Received: from google.com (105.211.142.34.bc.googleusercontent.com. [34.142.211.105]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c872e4aca2sm18053346b3a.32.2026.11.30.07.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:35:37 -0800 (PST) Date: Mon, 30 Nov 2026 15:35:31 +0000 From: Pranjal Shrivastava To: Jason Gunthorpe Cc: Mostafa Saleh , Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , Daniel Mentz , Samiullah Khawaja , Logan Odell , iommu@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/5] iommupt: Introduce IO page table shrinker Message-ID: References: <20261001230219.818128-1-praan@google.com> <20261002150844.GC3481470@ziepe.ca> <20261109145250.GO663069@ziepe.ca> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261109145250.GO663069@ziepe.ca> On Mon, Nov 09, 2026 at 10:52:50AM -0400, Jason Gunthorpe wrote: > On Mon, Nov 09, 2026 at 12:34:54PM +0000, Mostafa Saleh wrote: > > > I believe there is a value in supporting other users beyond IOMMUFD/VFIO > > (eg. DMA domains) or even outside of iommupt, I haven't investigated this, > > but it's worth looking into either integrating the "iommupt clean(gap)" > > idea in the IOVA allocator or more generally rely on refcounting + > > shrinker (or other method). > > The main point is to avoid the refcounting because that is going to be a > perf negative for everyone.. > IIUC, we are also wanting to avoid refcounting for observability, right? > I think most people should be able to do a clean call, and if it is > routed as a generic domain function that would be fine too > Right.. in that case I suppose we'd move forward with IOMMUFD ioctls that take a lock (maybe iova_rwsem?) for both, clean up and observability? And a similar approach can be taken for in-kernel users? My question was why shall we walk each time (with a lock) just for observability? Can't we follow the refcounted approach just for observability as in the RFC series [1] and just avoid refcounting for PTEs? Since that's iommu->domain level refcounting it should not be in any perf-sensitive path too? An offline discussion with Joerg revealed that there's interest to have observability even if we have the required shrinking / clean up logic in place. I was wondering if that could mean keeping the observability series [1], almost similar apart from dropping the vfio-type1 support? WDYT? Thanks, Praan [1] https://lore.kernel.org/all/20261001224531.765278-1-praan@google.com/