Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7903699rdb; Thu, 4 Jan 2024 11:13:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFy4t9gwt9hU938cCKCIWrxcbHuD2JzaMBIU28d82s4nNVMjblr0WN8UwF82xfCCtIawCoE X-Received: by 2002:a05:6808:3186:b0:3ba:1042:aef1 with SMTP id cd6-20020a056808318600b003ba1042aef1mr1481964oib.39.1704395606273; Thu, 04 Jan 2024 11:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704395606; cv=none; d=google.com; s=arc-20160816; b=qPNfOc5L1hWRXYVnGN2sANjX5p7yx6u1FWs9Mo31dnKCHU60/+WJwV7aSCOujTni40 vhm+noxY7K501wnQRE9RqIzs9SatjJVlQwhvTgiCVGHRap8PoFZejQSmwFzSQM1RJifG MVCvJ3X+ws6PjUoUCXbfwBZqM0Js5dUIEGj5z3soRme4EMet+nK29lG/FDRpHxoNXgWc UpG45EBy7S1xeltyjcXiQ1Dkc9QCbtryvZeE537ozW6o5kQPOZ0LchHExpYpHR2Xahrg Qiorq+yjbPLMFktxi8AzO5D2so1nUqIjIlXE1wQDDlJDSkZTBOTodgefoRZ5yPiRQbUz BJcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/+vYEuDAPJ/iEdESxX2pInRN4g9EPXyQ5h9FSdd/4u4=; fh=dQkE0rjPkRupeRfRe886IbNEvqSZODCDG/62kQ9k1Q0=; b=stQ2kqQs6C6JAgol/wq1LUODhAoP9I1cF3r0uds91UnJSg2f5y2WeiGa6ywcYSaL/h tI9NGTxP3LIcQEjh7E6yxSazJsuqyesXz4vI0QH103RH4YfX3lDh3rWm0XJ3nvUy5tnW 38PfkPqonDartS1KzGWJi3FMU9gc0E3WevgFdYBiesFBl3van2ZDRXU9saqYfFkacS9m Hg4H6oK+SzEXRYYNWXRlEhSeEVGmENBNFVeuFXAPyZOk4oxlCgzSs5i7sPhcG+pMMvcj gL9fNghOx+ULLKodXwpd9DHmZO1gFKaqBB/ZWNkNsT56DLE5uPCR4TybyEmTkmQnNSg3 VYug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="F/ZnFVg7"; spf=pass (google.com: domain of linux-kernel+bounces-17135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17135-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t7-20020a0cb387000000b0067f68fb505fsi49094qve.577.2024.01.04.11.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 11:13:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="F/ZnFVg7"; spf=pass (google.com: domain of linux-kernel+bounces-17135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17135-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0A0561C22371 for ; Thu, 4 Jan 2024 19:13:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 132CA2C68B; Thu, 4 Jan 2024 19:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="F/ZnFVg7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (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 C91082C18F for ; Thu, 4 Jan 2024 19:13:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-596175c0be0so452536eaf.3 for ; Thu, 04 Jan 2024 11:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1704395583; x=1705000383; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/+vYEuDAPJ/iEdESxX2pInRN4g9EPXyQ5h9FSdd/4u4=; b=F/ZnFVg7p6RCRwo6c599coMU7gxw34TnRuIn9tv4NSDTLCFyNIcCycMnVBIoSBhUaf 5VePqzrdqqOPRKKkraOQpG8XlgFm3zjmU3ROzjemte9baJ4kCqNNrgdAqngJeCHvlLMT ccN+J71GjNlNUYaCcvaMn9xh9mjC0xYx+SwN4B6qr/yTTMnZRYvNOhLp64UX+NkJd/Vy YSkeOW4R3gS7ZDU8/YKly32rHGE+xlyTcPg4qLxF5bOlnB3yUbFqy9azk3VRBB7HpFXx waNjhIskVtiY0gZZye1eBD20fLHFMqL1LxWwap0rGSneRmh7FVOv1Qc8SWhK/C/qEkoW tynA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704395583; x=1705000383; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/+vYEuDAPJ/iEdESxX2pInRN4g9EPXyQ5h9FSdd/4u4=; b=XSS+L+VDR9qnPbKbxzLi/4TCrMNQluOzt9pFcwza+CcE9mXRSJRPNtfk71MNKacF9L oqf//G0Z0NRNH4CcnnCACIwxPyzg4d/TOnmAjmicUoAe4N7j/RwEYBD8WxU38KWeq2a4 TNREAbzL5IfEWvB0jaIyOAQdgV0IHLOQ7LwSRGyA+7QNgPLAoh+TmCEY0Sl4y5ts0nE/ 4l8OcjPblfXV8T52bixHei61h+U6XYdSZott8R02/toU4/sxxi1V1y26pQ/TQki9Y8Fv Z6/IVsR7tJc4VcKhkZoZ79NvL/aKGE0tZAwONhm8Ngv19x3gCGNWyfHkanfe3qxDZzrq 09IQ== X-Gm-Message-State: AOJu0YyzpccgstuiIE9Y2QQp2Dy0bgtKqVARZHD2GDzumbmr/S+c/6Bf SY11VsfoBgg04ajaJJJphWJlMmo12TvHQVpvBKkdytHf0Q3JrA== X-Received: by 2002:a05:6358:8828:b0:174:b7f2:51db with SMTP id hv40-20020a056358882800b00174b7f251dbmr1188037rwb.19.1704395582852; Thu, 04 Jan 2024 11:13:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231226200205.562565-1-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Thu, 4 Jan 2024 14:12:26 -0500 Message-ID: Subject: Re: [PATCH v3 00/10] IOMMU memory observability To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: akpm@linux-foundation.org, alim.akhtar@samsung.com, alyssa@rosenzweig.io, asahi@lists.linux.dev, baolu.lu@linux.intel.com, bhelgaas@google.com, cgroups@vger.kernel.org, corbet@lwn.net, david@redhat.com, dwmw2@infradead.org, hannes@cmpxchg.org, heiko@sntech.de, iommu@lists.linux.dev, jernej.skrabec@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, krzysztof.kozlowski@linaro.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, lizefan.x@bytedance.com, marcan@marcan.st, mhiramat@kernel.org, m.szyprowski@samsung.com, paulmck@kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com, rientjes@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 4, 2024 at 12:04=E2=80=AFPM Michal Koutn=C3=BD wrote: > > On Thu, Jan 04, 2024 at 11:29:43AM -0500, Pasha Tatashin wrote: > > Thank you for taking a look at this. The two patches [1] [2] which add > > GFP_KERNEL_ACCOUNT were sent separate from this series at request of > > reviewers: > > Ah, I didn't catch that. > > Though, I mean the patch 02/10 calls iommu_alloc_pages() with GFP_KERNEL > (and not a passed gfp from iommu_map). > Then patch 09/10 accounts all iommu_alloc_pages() under NR_IOMMU_PAGES. > > I think there is a difference between what's shown NR_IOMMU_PAGES and > what will have __GFP_ACCOUNT because of that. > > I.e. is it the intention that this difference is not subject to > limiting? Yes, we will have a difference between GFP_ACCOUNT and what NR_IOMMU_PAGES shows. GFP_ACCOUNT is set only where it makes sense to charge to user processes, i.e. IOMMU Page Tables, but there more IOMMU shared data that should not really be charged to a specific process. The charged and uncharged data will be visible via /proc/vmstat nr_iommu_pages field. Pasha > > (Note: I'm not familiar with iommu code and moreover I'm only looking at > the two patch sets, not the complete code applied. So you may correct my > reasoning.) > > > Thanks, > Michal