From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.173 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796052940; b=16/Y7UucJKRZeNfDWImyRCphSNkv3Gwou8VGKojuByjVu2vIOGmtB6TbnkUIKxUHQ0QT LCmFeXFjA+sOqQVMTkY8WliQyFYK+qIhaYQGpXYEH3VJc3gSq1jegGdNNENzDiZd4H03l KhuZxcW6Vghn3MHMFfhEEJ/xfGh0bALYWsGJqyjZolWVz1NTRGWzeHxt4f4n27Cb+ADvb Hy79qzebjbEPdun8P3WDE2RRvzClzhsyU6vhPc4oSS1Jwv3OX3evC17BWn/pFdIv9fWHi SPBoZgJZtE888hO/+X2VFTCM+A8VPUvPJAYpcg+V7Tr+iWwE6uYWNuvy7A9Yoy5FC0A== 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=KSSFoP07IWWfjQtecSg+YN/gBfNtKezmJToqaBl8KF/NpOYsSXN4Ghb4FKSl3whaA3Kc Zo9U8rmqPxY2ADEska8AGML30ZTXcijBMU5YE7fihU6ZppedHra1so7qpf1diLRSwxm7e aVBPkA406VT72cdviaGyzJP0Aq/6YkrNzaBuKCEghZr7I/R31dVmEqqwBb98Y21Ke163Q re0uOP1eetW6kGqjh6yz1BKNUv4ZCtroC6j4J3TJPsY7x1nZ1UF2jV8U4YYRyKx1yAdgQ us/bGT0YcGJYFVvtXB86kRepPmc8TSjc5GJv+04ThdnXQOy4TARYPdtQEbq1G2c8GCw== 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=RRLkV9A0; arc=none smtp.remote-ip=209.85.214.173 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 48DB3606A329 for ; Mon, 30 Nov 2026 15:35:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48DB3606A329 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=RRLkV9A0 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2f0e8bbc7a4so236185ad.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=1796052939; x=1796657739; darn=lists.linux.dev; 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=RRLkV9A0fNLYV7QLSty66/PrPkMDb7JUQYmab1LmVtixrxFAo7xlMcM9UzMsfTmZZJ KEPwOTkxAaockz3r1JhP+I4WGs9swWXhzg+eROm6Cc+W2KgAyTY0UluLSmsabDEJXZxo SA3uAX4nwOZYHekgvEfKf2QbahVmGcv4SMj5i5IDvIoqIfYwAVej1S3BKis6HjhynfyE Li2ZBKao7T7NHEsPgF5DpmTCeTXS2NUS+qXREyrqcvy5oPHL6fwd6csS9rFqHEYcNzpk FfUzaarSfp5zXYEOv3dhjF4AGSNx4sbUm9laFG2vv9L0ls9Om5F7T2qW9Od0GAw3EVRy d6tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052939; x=1796657739; 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=Ug9SrViqM+Tuy5l0n186ad1X0WrSJKRnzjUSbXuilhGv8vgDJlk19Z0+Rm2A8eFxZ6 6aC+VJ306HpCiowKPofeFdcDarF5RGElJyplp8B5o3lMH9DnTOZYRkaSkvAniQx3QeH1 lErS0YJfvZDkNVVCOi2c+58sAE5qtkuieUDMZYAHkidRICvXMAPTplBb9HYE0ruG9hCw RXSHoOyWDnjSI/IaqbwxvyICQM7txYl9CTnQ+v9hqxqloP5BSYUeELnAsf0sFKuqfR1F lmvKCPfZIozfAGQi3MeIcBgAipRAZmkZPLiIpBigINn8kodIOtPc7TQGj+s7jr7x45YO 01sg== X-Forwarded-Encrypted: i=1; AL+hErE9HuVAjHEyVx5+W4ehRbavkCtNZZKXmQHwVp73LDQe83eE+aEmQJiWDED74ROW4Vxr0cb6QA==@lists.linux.dev X-Gm-Message-State: APuU4Z++VpHbpk6ShovgXhjn2csG4OojvtWAoPpTy3wyU6EdGIgIKZ5y onXOE8YLgtR1vTqpx4Z8sE7wrFYXRE2Bybppm3qRAilCYGQiYOkh5bFMdAEmhzD/gA== X-Gm-Gg: AZFdTZejgonE2TBTs0Agf6yaUNqvPM0AmbPxxDPZ318XnJoQdVkhZ2pGLvUyQaJ9LG9 ZgqBbMUFHY2ql5W3JUdvJhVc8Ka7pREo7D1tTlliFxLWumhQ7fOpKBxyAJOBe+3O3dyquuotl2p DvrKZkWW76wvg7eB2mONozKshzs8+lnJDfkHPGxlYb+V01s44BtLs0DhYgD5mnVisAs299m8TIu tKNMlA9foHKY39SKMsynXHJkUKYNmZRz19Y7NwwO8uPBG0V/uk5lx1+grMwHU6FlaOkOhLccRlr Mb9NaWg7AWkxoO7YgiUHC6Z5m7SOn6fpCP4tny8WHMW9f9kZpSes90sy0XnaFwTDQlRdMZXItU8 H4qxYLUJFqK0T/AiF0kkDTQedR/yTtYe2eTVDZPQ8OVqrS4pe3MCB2iDI6cMKgIQZN5+LWRRBsb CZwADTQHPfzmjfoVAhAb0MfmhZsPVqqScC04UsCE8e8d1h5mnpv/ZQljN7ZxYu3AZy3cK2E7gN1 cDKmWI/bN2NIQk1YkV/QnuYwjiffl2j79+RI2utCsvwrGSAUfWK1k1fNCyUqmkPsH04X+JJx3IW 9pFX8D+XsaCSdtTkfkiZnvxScgOW0+A3z/lPiDo1u9dbXWF/Yd5Swo9whRln6lvIlpY= 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: iommu@lists.linux.dev 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/