From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EFF7C4167B for ; Tue, 28 Nov 2023 23:50:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A61F98D0011; Tue, 28 Nov 2023 18:50:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A11568D0001; Tue, 28 Nov 2023 18:50:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D8F38D0011; Tue, 28 Nov 2023 18:50:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7C3838D0001 for ; Tue, 28 Nov 2023 18:50:41 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 547A480363 for ; Tue, 28 Nov 2023 23:50:41 +0000 (UTC) X-FDA: 81509010282.02.1C570D3 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) by imf16.hostedemail.com (Postfix) with ESMTP id 66193180019 for ; Tue, 28 Nov 2023 23:50:39 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b=f4xRSpkB; spf=pass (imf16.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.161.46 as permitted sender) smtp.mailfrom=jgg@ziepe.ca; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701215439; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XYTfkI+bm13XmNm4VDm7JNv4il6+T5S3nBbruRBN+40=; b=cA8/NqyM+SzqrWFLN8Tvzo4HSXl59Yt16j5/wodBfplmrONIZyE7gAbjmJB2GCYWxfdaiG VZL15VzqUGMoI261XJWh/aa7SV1+5BwAoj8bRUQVU75s/Lx4zUM84FtxbAQwOOcQLaY1bO 4hZlReViRGfy3Y7p45Yo8gjAlhBBi/Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701215439; a=rsa-sha256; cv=none; b=3LSsRDotKQOjQesL2nbLsarQ9CgYiW1jfkdXxBn3kMk7BGPRRYzk8sOA81MZEVT8fHnkiN lru1nErh1rb6Y5reugRDmBQqHpJsjSxvbPzNDtZF1t+KnsmJAHa/UFKstNdVrF/O3z/tgm 0dY67osUn3GebdXcJQ3McaGnQPQ/l5k= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b=f4xRSpkB; spf=pass (imf16.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.161.46 as permitted sender) smtp.mailfrom=jgg@ziepe.ca; dmarc=none Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-58d06bfadf8so3650177eaf.1 for ; Tue, 28 Nov 2023 15:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701215438; x=1701820238; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=XYTfkI+bm13XmNm4VDm7JNv4il6+T5S3nBbruRBN+40=; b=f4xRSpkBEUFrE9GZKBhWWm5V11YSH4UZ58mKZEWT6HPl46oefAuujI0qNweJ3qekVy 5h6SbqBwVZ2btzyMGRSxCHv3gRZ5UDH9VN9os47K5izygAXiUZKta85zy5UOf3G076yj 95zA/SHzw63nd13IquuEPtlNL80cIuwGGsU9tskiqNZWOROpl5nFoif0aPCYyRrU0jGP zp/FuQj0jeTitVEPjrT10YBPw0Fm2LSMFY696WePIsZDtYl+ZUPutVHbr+UTuuBEJexy pYLj8VY+MA0ee4jcoil0nrPfeZYsWw3okkEFgQB8XwtPDwBcHG0RfclxjPcp7XCjfefr lnVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701215438; x=1701820238; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XYTfkI+bm13XmNm4VDm7JNv4il6+T5S3nBbruRBN+40=; b=NHDCsJ867fNtteWFBTjSJR19nF/0DXnHOuTATPzrN0wyPB03fJuk+EfkNt+l52J1+Y IYPzYCbRKVKt6V82eukf6E+rsDYxkEVPZU4p9o0ZH+I11tFUlg8Mo4CW/1PXW+WGQRFL vmEc+yjjIkWhN8snVvhi+ZNAqbvh+lP9RumqwPVJIJa0E6375DpdoosTE6g4R3ThifzF oSk4ZiH/FMWNp4+o+RZYzZVWt/Ax9C5+sP2pOXXhJA8Gn4FXMdl5PxXjQdDtm2kOmTA9 RwSiHI259ZX7V2+ys7PicCTPxXTK2BQrZaz0Zb+BwqzXp6CWIh7XQU8HeZ5La5wxG1gF IoUQ== X-Gm-Message-State: AOJu0YyzJspoJ9iylcyofdfdqbAlh12WDTjq+ZZg2z6psF0OHzOuuWZc pcIQZXzl6Md8siqx20oMndV7cA== X-Google-Smtp-Source: AGHT+IGwgOr6qdtdfdMX4Rg2CnVVZBQ0aH/828IT9FkkN9y3SJG6wbzLt3OY2goWTqPUl1CtrUxcHA== X-Received: by 2002:a05:6820:809:b0:58d:a6ed:5601 with SMTP id bg9-20020a056820080900b0058da6ed5601mr6252111oob.1.1701215438416; Tue, 28 Nov 2023 15:50:38 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-134-23-187.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.134.23.187]) by smtp.gmail.com with ESMTPSA id b35-20020a4a98e6000000b0058d2ea19475sm1934017ooj.11.2023.11.28.15.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 15:50:37 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r87qf-005jHH-5R; Tue, 28 Nov 2023 19:50:37 -0400 Date: Tue, 28 Nov 2023 19:50:37 -0400 From: Jason Gunthorpe To: Pasha Tatashin Cc: Robin Murphy , akpm@linux-foundation.org, alex.williamson@redhat.com, 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, jasowang@redhat.com, jernej.skrabec@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, kevin.tian@intel.com, krzysztof.kozlowski@linaro.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.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, mst@redhat.com, m.szyprowski@samsung.com, netdev@vger.kernel.org, paulmck@kernel.org, rdunlap@infradead.org, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, virtualization@lists.linux.dev, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com Subject: Re: [PATCH 08/16] iommu/fsl: use page allocation function provided by iommu-pages.h Message-ID: <20231128235037.GC1312390@ziepe.ca> References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> <20231128204938.1453583-9-pasha.tatashin@soleen.com> <1c6156de-c6c7-43a7-8c34-8239abee3978@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 66193180019 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: gdxejfxkfjf4adnf48qs7woq51ktb9t6 X-HE-Tag: 1701215439-364937 X-HE-Meta: U2FsdGVkX18Ec+bW+2qmCqIJ9pS1+QSA1IXlHK8ZthCAOEuKfn3uFi/KuFw1tpzwabqocpsS5Uq1faXu/i6rWbjH4ApfJ5gPINGJ0TfajXfdwc39wTmAVUZcTe5Qp82F/wRx7MjmDdbPFtM62LqPS86tP2x0CqdlYiWhglXJXLxfabJHfbRp7pdmZoRgIuaSeB14WMvhRaLsQMtufZWMGJcC0bH+Iw0+D0TV2E6cOrkpCTFPykvm29t+VOtx8VGJXwNyH3w5wL2/U1SO28KOfRhCQd80v3XPFoTVoGtwhBvTEfvoTdRzzq2Xzhthjr1W5B5eFyg3vBNVVlLuz4U33zfzvHnd/xwa0Lc8LuAa/1koEsNFGCLK3Y2UXi1prAGy/g7Z2NRSmYBI3yNfI4jwVnW1rraO1HoEbNwEULZ4ZavvURAUhdTwz+2mmd+bhJ4XZeATrmxFbxc3qHyNuPK+0LZfOs6M5tf6VS7dK1LdFbMcMzzHke7jGSrKhuUSSmHBYbxoKe+AsFNQqLwvn5CfhPSlTWqhNJTC8wP5vgs23Xylk725Nitdxz3d8UgG8TRUqWwVUALt9VNLYqFvboOLH/mqG6eVhIkfsQQBTTHzaz5Yt0NcS9hAhb5MmzCAT9Ix5P1+CrMqNiIMd3Fav5sX93F7g8Sluj54MSQD3RENcunRZH3YVNMXIjLo/OWRVHO6b7gPx2ialadcslU0p+VGhZigY+xoh9F+F0yu1DakfMWmDfl6dRiqelV4AaNrs1GvrP+ngBCBSB1sGm2qfOsAMh7jUEwsOPj+kfmC3pQu5e7R7zVDpRgrJ58QaNbhzfT+Kd4qwOUKeOqSdTYfb89vBMOGcN8xk5XPzgo7/DsxPwMV62cdggp1NryUbDPcYHAOQQ0nTNhFNDqWz1xE4CLouMgJi9mj2vi392KZlrhGUsStRL070gI7ef5P/5Y5hxNb6yUFyseVSF+TsEWNqhR EW7tGr96 BrUyhX/opEKwdX7CNtYMPEXMUVDMkeLWI1VmZ6zomme9VQz4GkmZOPPFcFC1vGi7SxLcza2t1WlkSG9EzU/fQEV1ORw0pXMQgnKRudeoUPc7ONU3hgQZZaEIaQtJAGZf94t1hvNyeFJV4SNBhSH4uNul6zEO7xnSV5MyusQUFdJ84YFTsxwPZER1yWrtbIJkogwHxcg5A0+yqYwldzgQoDYjEEt/pFUHXiuzZ0kvAZSpGnAtin5uCAnIC6E+hmvZ+espOMG9LdZZ2HmsA1ZkXseSFdu9WE1R5QKmdW80M5FKt44D19xck2mSSb6iWs5VfP054wQenY4VK2A+tqIGZJSfew+t227ZsQVKz1GiigUpOrI0z5gEkAkO/3acnyFhO046HeMhLI2T6fJdJS2sLJuBcxV9LvHtrOkS1DqLrOgZw+YKLsjW/8bBm4Davg2NDWOsu X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 28, 2023 at 06:00:13PM -0500, Pasha Tatashin wrote: > On Tue, Nov 28, 2023 at 5:53 PM Robin Murphy wrote: > > > > On 2023-11-28 8:49 pm, Pasha Tatashin wrote: > > > Convert iommu/fsl_pamu.c to use the new page allocation functions > > > provided in iommu-pages.h. > > > > Again, this is not a pagetable. This thing doesn't even *have* pagetables. > > > > Similar to patches #1 and #2 where you're lumping in configuration > > tables which belong to the IOMMU driver itself, as opposed to pagetables > > which effectively belong to an IOMMU domain's user. But then there are > > still drivers where you're *not* accounting similar configuration > > structures, so I really struggle to see how this metric is useful when > > it's so completely inconsistent in what it's counting :/ > > The whole IOMMU subsystem allocates a significant amount of kernel > locked memory that we want to at least observe. The new field in > vmstat does just that: it reports ALL buddy allocator memory that > IOMMU allocates. However, for accounting purposes, I agree, we need to > do better, and separate at least iommu pagetables from the rest. > > We can separate the metric into two: > iommu pagetable only > iommu everything > > or into three: > iommu pagetable only > iommu dma > iommu everything > > What do you think? I think I said this at LPC - if you want to have fine grained accounting of memory by owner you need to go talk to the cgroup people and come up with something generic. Adding ever open coded finer category breakdowns just for iommu doesn't make alot of sense. You can make some argument that the pagetable memory should be counted because kvm counts it's shadow memory, but I wouldn't go into further detail than that with hand coded counters.. Jason