From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 0F0E0257825; Fri, 9 Jan 2026 03:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767929305; cv=none; b=OELkRcL54go3m4v1tAvlBaIn/bKMNpVBd1/glNeqDLGVt2JAajFs9WBht97m/pWZaUjEPWO+iw+/w67L/wzIP0hlbkT6eSAvivzkzTkG6OzFIh5KAqZg/sFaLEAJ8n/8X6bEK9+qz8YAgbGTX8lFfmqigtvMmOdYyhPltRnYuhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767929305; c=relaxed/simple; bh=y4tYwPF3ZC63Ir+4yC1KcSfjvehP4llbqhsh9Bjl7/k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ezuI3ijMF3g2S9dgHXTqTjmPHl13oVPGnqSu6+o0wvr0ez3wbA/yWexVtQS24d14HxEq9t36dLWoEfOCeYUr2RJSAfduQS1XTWa6du0QEiGvNH3OLdGJK//Xru7/ZiFCvW8MgA0GPcOOqY+SKWozaE8i+8U1dVvOaTKhwHEPyQc= 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=afRkp4W6; arc=none smtp.client-ip=198.175.65.17 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="afRkp4W6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767929303; x=1799465303; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=y4tYwPF3ZC63Ir+4yC1KcSfjvehP4llbqhsh9Bjl7/k=; b=afRkp4W6KLwUtO4TNBtROPnQx2Jbq0ixXXDnZWte4+wa5tfYGrX5uVh2 NrvUiEEFgCB0dJt3mbACdEA9Qm04zx7zdsb1SyozuheSGL2hv6HoICpg9 wl0oehYHHB2RbsOgblqyK/OEb5td3a5l0xyzso87epsTskbdwynMp5jCO hx2l74DvKO4DcpMS/j+xYE6eHcFglu995vpCazax1oE8hncwmP/BX9hd2 0tcu8Cf3RP8bW2tWbIFAPsI3V1nQXvb4y7JxNNLstaRX7oFUqvB2OXAu1 XOQxJjxTSBf7NYNlLqUpXG8sTkhT2v4Qz2Rsmlwm0SeeOBCAOSWyvNYOc A==; X-CSE-ConnectionGUID: GHrceak3Ryab9MJKMqBaHQ== X-CSE-MsgGUID: Nuk94SToRr6upbBsSGTYbQ== X-IronPort-AV: E=McAfee;i="6800,10657,11665"; a="69296281" X-IronPort-AV: E=Sophos;i="6.21,211,1763452800"; d="scan'208";a="69296281" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 19:28:23 -0800 X-CSE-ConnectionGUID: 2d2ZBL/rTb2r1726moL31A== X-CSE-MsgGUID: A7Och2SKQ2eaTHkkLOcU4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,211,1763452800"; d="scan'208";a="234075920" Received: from allen-sbox.sh.intel.com (HELO [10.239.159.30]) ([10.239.159.30]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 19:28:18 -0800 Message-ID: Date: Fri, 9 Jan 2026 11:28:32 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 3/4] iommu: debug-pagealloc: Track IOMMU pages To: Mostafa Saleh , Pranjal Shrivastava Cc: linux-mm@kvack.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, akpm@linux-foundation.org, vbabka@suse.cz, surenb@google.com, mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, david@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, rppt@kernel.org, xiaqinxin@huawei.com, rdunlap@infradead.org References: <20260106162200.2223655-1-smostafa@google.com> <20260106162200.2223655-4-smostafa@google.com> Content-Language: en-US From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/8/26 19:33, Mostafa Saleh wrote: > I have this, it should have the same effect + a WARN, I will include > it in the new version > > diff --git a/drivers/iommu/iommu-debug-pagealloc.c > b/drivers/iommu/iommu-debug-pagealloc.c > index 5353417e64f9..64ec0795fe4c 100644 > --- a/drivers/iommu/iommu-debug-pagealloc.c > +++ b/drivers/iommu/iommu-debug-pagealloc.c > @@ -146,16 +146,12 @@ void __iommu_debug_unmap_end(struct iommu_domain *domain, > if (unmapped == size) > return; > > - /* > - * If unmap failed, re-increment the refcount, but if it unmapped > - * larger size, decrement the extra part. > - */ > + /* If unmap failed, re-increment the refcount. */ > if (unmapped < size) > __iommu_debug_update_iova(domain, iova + unmapped, > size - unmapped, true); > else > - __iommu_debug_update_iova(domain, iova + size, > - unmapped - size, false); > + WARN_ONCE(1, "iommu: unmap larger than requested is > not supported in debug_pagealloc\n"); > } > > void iommu_debug_init(void) How aobut if ((unmapped == size) || WARN_ON_ONCE(unmapped > size)) return; /* If unmap failed, re-increment the refcount. */ __iommu_debug_update_iova(domain, iova + unmapped, size - unmapped, true); ? Thanks, baolu