Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4858077rdh; Wed, 29 Nov 2023 12:45:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IG85jZI+F9bDpHlizJ7VZqkxRi3ga515n53TjQ0UqjbI5QbyrXml8SnabksY3ry6M3rKfA8 X-Received: by 2002:a05:6a21:3283:b0:18b:246a:d43d with SMTP id yt3-20020a056a21328300b0018b246ad43dmr25938552pzb.15.1701290734280; Wed, 29 Nov 2023 12:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701290734; cv=none; d=google.com; s=arc-20160816; b=gBeJrfnBchv3nELpscHWuWnSdcRatF2bo7wALuxRUJAyUZimyH5/HAM6myJLG4HhJH KG9Jh5twZG0yr2IxBBBR6GrWj4pdiCyxmVxfqqyr+QYMfGSWQzMYCcU3vugLpZVAg0fy tdL9nlNUckeGUhAMseCfsoaeNvMN86ac9/5ex87UiHxAdQsAUUkmda/dh1fpMfefH2/h PX2gCX6zeu8r7QlkAFkw/A11FQ7yWwoIDUbRR0F2y1pYEXhcFSQm31niM6J6kEkyuUc+ DdqAqF23K94GE2SmI1SC4AYwXu5DP8WdKgLWv/Yd9aa68zW9Kd86WeqDPgPM3R8IWhIr 7gxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tlZYiStM5KCC7J/v+177rjHqt9KWJCfJWFMkelab9t4=; fh=FSgw5fXAB0uvpCJThThbSGNHitVMYeGBnRxyIZtWuT4=; b=RcsbEHP9BsVeVT6Zduf1TrFHa0EzzhcwTWLHkpyVC/tL0fsIwtEXW4yCgxvlKdeLM4 VRKE5aLA7S1XKbsryfKyqeDKaUl6aHqmGF4QCBomWC0uz/GfxGWA+LBaiCtk9uT7VrzD 0ywYLWmf7nkTwmUy3dgusbqs3gkuU9Zpq8lIRdJVeCjo9b2p8hxb9IG7Qbv5rJ3o2OWh 9VAas5b70xB9x0zx0TqbdfWM2XJ1XzAKhnoYGQRyg+bPYCqX75d6TskM1cshZZ8mGCkf Eh+E3MGhWmT7iVjkICP0ZYztKTNo2BVhodUPKiqhVoquseeIKtC1hLMuIegSFuWAupzj LsKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=FdbZffxY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id m21-20020a634c55000000b005bd6784a9fasi14802334pgl.676.2023.11.29.12.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=FdbZffxY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id EBC438078633; Wed, 29 Nov 2023 12:45:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234010AbjK2Uo7 (ORCPT + 99 others); Wed, 29 Nov 2023 15:44:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbjK2Uo6 (ORCPT ); Wed, 29 Nov 2023 15:44:58 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA22D7F for ; Wed, 29 Nov 2023 12:45:02 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50bbfad8758so331686e87.3 for ; Wed, 29 Nov 2023 12:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701290700; x=1701895500; 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=tlZYiStM5KCC7J/v+177rjHqt9KWJCfJWFMkelab9t4=; b=FdbZffxY5wQE+/0cxXCbRI/zPDDidiVXjjUtYaRCjcBeQNV8h6tZEhOFNmoiYL7FiG h1K6pRO8QjrrRpKLtVPO4KusIRh7cFjdTbXZrtnRwsrN9zOW761HtsD0DnDQGZcBO4B4 zZlRZaXN56UCW9RjgD3piveQC/RlmHoA707iaWD4ZKMsSGCKKX0wS590lk9hL1bOd4IZ 7f3rTyKVruPGPNdmdliTvnn9TTnMX3gBAn3rgBg3AHi7tU6xptVxJXv22YHnauF+xp/J vi7OWlea2BYfXpETx4UFSoOwGVhEA35lLfaJJPqVDZIFT4A3eDZKoi2IYAMKrMsVwmSJ 8bzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701290700; x=1701895500; 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=tlZYiStM5KCC7J/v+177rjHqt9KWJCfJWFMkelab9t4=; b=CJTQ8WmkQWN2RmP+TVyLaHTMfdGalrdfbjJMhRaay15rOznEgtH6lX3djHtyM8nUEW BH68WG0yo50bj8NslwXYLXOma5gfnvDdCt/g97BfdGGxh0qy90iSLpUOIpMRNmIxOVgZ urDfioNtxb11r9ZvjTOrY9y8JZmKsUUyczc1ZupC+LIaIh+sUWnb02sRhEg8m4KY9wO4 z+kb9uNuCu5e/ZByY9m8WJdw4Cpkn29Fde6JqHjVyJmD36UYlRv+h7/rWFJG34+GPKje hL0/UwI+VKBJLwFos8otVS/bzFVrPTPHDvlrLIF1tVlCQX6Kvp6fjuwDW++tr6XprCM6 PO1g== X-Gm-Message-State: AOJu0YxI0enJ4wk8MY8QVZuXApS0B6hYeyzQ5yXfJyVZwuubnKOuYQ61 5NSRFCkaKvHBdqySWcPiSKTeTTjlno3HtD+swjxAyg== X-Received: by 2002:ac2:4a6f:0:b0:50b:cb50:401 with SMTP id q15-20020ac24a6f000000b0050bcb500401mr153882lfp.34.1701290700342; Wed, 29 Nov 2023 12:45:00 -0800 (PST) MIME-Version: 1.0 References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> <20231128204938.1453583-9-pasha.tatashin@soleen.com> <1c6156de-c6c7-43a7-8c34-8239abee3978@arm.com> <20231128235037.GC1312390@ziepe.ca> <52de3aca-41b1-471e-8f87-1a77de547510@arm.com> <20231129200305.GI1312390@ziepe.ca> In-Reply-To: <20231129200305.GI1312390@ziepe.ca> From: Pasha Tatashin Date: Wed, 29 Nov 2023 15:44:21 -0500 Message-ID: Subject: Re: [PATCH 08/16] iommu/fsl: use page allocation function provided by iommu-pages.h To: Jason Gunthorpe 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 29 Nov 2023 12:45:16 -0800 (PST) On Wed, Nov 29, 2023 at 3:03=E2=80=AFPM Jason Gunthorpe wrot= e: > > On Wed, Nov 29, 2023 at 02:45:03PM -0500, Pasha Tatashin wrote: > > > > same kind of big systems where IOMMU pagetables would be of any conce= rn. > > > I believe some of the some of the "serious" NICs can easily run up > > > hundreds of megabytes if not gigabytes worth of queues, SKB pools, et= c. > > > - would you propose accounting those too? > > > > Yes. Any kind of kernel memory that is proportional to the workload > > should be accountable. Someone is using those resources compared to > > the idling system, and that someone should be charged. > > There is a difference between charged and accounted > > You should be running around adding GFP_KERNEL_ACCOUNT, yes. I already > did a bunch of that work. Split that out from this series and send it > to the right maintainers. I will do that. > > Adding a counter for allocations and showing in procfs is a very > different question. IMHO that should not be done in micro, the > threshold to add a new counter should be high. I agree, /proc/meminfo, should not include everything, however overall network consumption that includes memory allocated by network driver would be useful to have, may be it should be exported by device drivers and added to the protocol memory. We already have network protocol memory consumption in procfs: # awk '{printf "%-10s %s\n", $1, $4}' /proc/net/protocols | grep -v '\-1' protocol memory UDPv6 22673 TCPv6 16961 > There is definately room for a generic debugging feature to break down > GFP_KERNEL_ACCOUNT by owernship somehow. Maybe it can already be done > with BPF. IDK