From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 08D0A107A2 for ; Sun, 24 Dec 2023 21:44:05 +0000 (UTC) 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.b="Ob7Izpl8" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-36000a26f8aso26495ab.0 for ; Sun, 24 Dec 2023 13:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703454245; x=1704059045; darn=lists.linux.dev; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=WCfzVP8j8LySAgZKEW6wfy9xuAGJ9Ouy6ckQlduRZH0=; b=Ob7Izpl85WdNqaQhmSASk3fVhbN9DCgq7Cf9/BElqFXij/R6VHoDk4mO6+yKb7E6+Q zpHXBNPZNN3OVjj0w/2dlYX5kF4MP2HsoxZzKGnc/lyeYOf+PHhlTuYDlzF/BS7v5b3P U544E37IVJSzzq70WmQnBnRDJhkxmc/nquRsIoxZ4uq6wDMlAb4cEp5zycrplOHqcPlV 52Ci5AbV3cOpG5OuT6Odm/1zEDTNIwaYvvWlliNG55/tGRg+I461008rJB62uv15AGj8 GpxtI69VnEbtLh7b99MUdXjM30dB4oCK8Rg1rdaoaSGUdarbwMlrD0zaQo9dHXRMYZI2 fDog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703454245; x=1704059045; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WCfzVP8j8LySAgZKEW6wfy9xuAGJ9Ouy6ckQlduRZH0=; b=dkwRB/jOzUnx+V29vt13a4YMmDpxny8x9LRuo7Hndip/h4GFCoXrEDjwFsuXuazW/G CZIM+srmET6Dzsg5KFBqUdPIMchMQDG41Ywwdj4g5/hlo165/ofeIqar+NOd7IChZCDm X9KvJ+H6W6PLlw6IUJ9/0SZ5PI9zYRT0dpu96nd+xB1p4xldepBvq1eCEAuhIlhVTqEP VIJ8UP8HrdRp2YUbBnv928d3uSLaRhxBX1Mb+gDIvV1wpXY45f61v+Mx0dPjTLGEU/Lw p52jHj1X1xGRSXPNpYWIHyQV01GfRwxOh+UQwaA3GG4tTR0ZXm31ITQguDCuX7WSCp/2 u7Hg== X-Gm-Message-State: AOJu0Yxf65c9XvuZ2m/z2wXRU1UdcAV8rVJdeFxYoDWg2r6fFuefqSTM hgZdUnEA2kubLj+WH+IdSTVmJH/jDQZ8 X-Google-Smtp-Source: AGHT+IHfKZUme1UezcYWHyTRRlZSLSoThXV3/HhZuf4mQ55yUvSKSE3jgK8NmLNN9oMH6ocZqVCboQ== X-Received: by 2002:a05:6e02:1786:b0:35f:e24a:36f7 with SMTP id y6-20020a056e02178600b0035fe24a36f7mr373370ilu.3.1703454245075; Sun, 24 Dec 2023 13:44:05 -0800 (PST) Received: from [2620:0:1008:15:c723:e11e:854b:ac88] ([2620:0:1008:15:c723:e11e:854b:ac88]) by smtp.gmail.com with ESMTPSA id n9-20020a056a000d4900b006d9a0c6ce2csm2974325pfv.54.2023.12.24.13.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 13:44:04 -0800 (PST) Date: Sun, 24 Dec 2023 13:44:03 -0800 (PST) From: David Rientjes To: Pasha Tatashin 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 Subject: Re: [PATCH v2 10/10] iommu: account IOMMU allocated memory In-Reply-To: Message-ID: References: <20231130201504.2322355-1-pasha.tatashin@soleen.com> <20231130201504.2322355-11-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Fri, 15 Dec 2023, Pasha Tatashin wrote: > > > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst > > > index 3f85254f3cef..e004e05a7cde 100644 > > > --- a/Documentation/admin-guide/cgroup-v2.rst > > > +++ b/Documentation/admin-guide/cgroup-v2.rst > > > @@ -1418,7 +1418,7 @@ PAGE_SIZE multiple when read back. > > > sec_pagetables > > > Amount of memory allocated for secondary page tables, > > > this currently includes KVM mmu allocations on x86 > > > - and arm64. > > > + and arm64 and IOMMU page tables. > > > > Hmm, if existing users are parsing this field and alerting when it exceeds > > an expected value (a cloud provider, let's say), is it safe to add in a > > whole new set of page tables? > > > > I understand the documentation allows for it, but I think potential impact > > on userspace would be more interesting. > > Hi David, > > This is something that was discussed at LPC'23. I also was proposing a > separate counter for iommu page tables, but it was noted that we > specifically have sec_pagetables called this way to include all non > regular CPU page tables, and we should therefore account for them > together. > > Please also see this discussion from the previous version of this patch series: > https://lore.kernel.org/all/CAJD7tkb1FqTqwONrp2nphBDkEamQtPCOFm0208H3tp0Gq2OLMQ@mail.gmail.com/ > Gotcha, I think that makes sense. When sec_pagetables was introduced, I can understand the need to account for non-primary pagetables separately because of the long-standing behavior. In that sense, sec_pagetables becomes a dumping ground for "all other page tables" which IOMMU would naturally include. So this looks good to me. Acked-by: David Rientjes