Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4894469rdh; Wed, 29 Nov 2023 14:01:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IETCLAy9ixukpsSzITeZlpmwLJULyTCgFaoJtME3M3/Dd9xRxA826/p1B/tnmfMd4jOcdj6 X-Received: by 2002:a17:903:1107:b0:1cc:36fb:22ae with SMTP id n7-20020a170903110700b001cc36fb22aemr30936048plh.2.1701295291310; Wed, 29 Nov 2023 14:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701295291; cv=none; d=google.com; s=arc-20160816; b=fGcKUItIVuQIFOof+fLVA3MBQGROTKfzSqL2dv5SlRo7qPeoFGSgrtGBL7N8gq0Xpj 78TP2GD5icFrpQQKjzl19DhQL6i80KKTlP6Vd09HnIUgZk0UZues5abwWejYSr8M3fVK Kwy447RfDLEjK+KJTCbNKuTZnwQzIv4FMo/pjKuoZ/saE7B8uQYLkPZJ0pmFYdcFu0Cc 2WB9+HYRHAhY8zV3UgCdc+1hiO9GV9MM15EjThRWuR9xsjrXrplJFbJP2jieREM8i9Xj NpO0K/ZoEA/5J0n8gA2Ta3saOyz0Yol22Fe/0kdcshVmDtR+r25BFaUMj4Fhq4i0w/AH MujA== 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=aiOfm5uGDMrP0UYnHwC5BRUcA0oU3b2DbcdcIFPiI/Q=; fh=oGjukuYUwZ8oOy3SQ9HM0p01Kt76o7jOodIpCCilVsY=; b=u3GHoJNojBv+yvTv8sFT8qUZqRoBjlkzhYVfSLdgwr5dIbVIfhUEE51H3NRxNhzp7K w3SyUy+Cw/lrmd9hMJwZkRc8QgTey9bXCS4PDtozPHyy7rHf2HnrsgecagsZUxPeAavU n8Isc54bC+9/gjRegrYF1Yukx2OX2xyiqjRGH4OLbb5CN1eoqqmKk7CxvLt/ifczVu0L nfneerYxnOWxFEnoSmBEioxoKi1SMOLFDWnpvnHN8BtI/Lt6eEjsrH5+SxnrSBNuB4AA DGO7+aOT3qfPPME8b+cWtMvF/WXUWkXWVWUlsG0YRwmAkWK8C4dAWQ0ofw94uYHabj1W G7Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=RvsWmgXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h20-20020a170902f7d400b001cfc03c0e88si9102779plw.579.2023.11.29.14.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:01:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=RvsWmgXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 6F32F8092200; Wed, 29 Nov 2023 14:00:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjK2WAR (ORCPT + 99 others); Wed, 29 Nov 2023 17:00:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjK2WAQ (ORCPT ); Wed, 29 Nov 2023 17:00:16 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977E9D1 for ; Wed, 29 Nov 2023 14:00:21 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-423e7e0a619so2234851cf.1 for ; Wed, 29 Nov 2023 14:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701295220; x=1701900020; 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=aiOfm5uGDMrP0UYnHwC5BRUcA0oU3b2DbcdcIFPiI/Q=; b=RvsWmgXgSTSe55spuxPnTVTCjzAxwYMn8vLxWO0UVjnE/+I0G4uCc/mMWkz7TzlfJF KtNWzgzGYoJ7fLVvLoxeVMtb3WDlPy+6hP4iRUccXPRDSbTrJ0gTwMO2CKuKMefAWzee AWa1cOJNynCMOnsZbRXAg79SjOOjhjwxG/jxiqwbT6OYyryLd2NFMXae+aTGw7ZYNbNT lN5L1ym5+VyVJRztXDpUf9KRzZpuOqiQ8vr22ep7YL+20UAw1+yFUey6AP6YH8T7Y0iX +xsXaew4+oGxUiXkTu/6edL8aFZwNJyZj60Wggxyt0s69I5lmMnbtZaKAuS/hIAHRZNz oSBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701295221; x=1701900021; 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=aiOfm5uGDMrP0UYnHwC5BRUcA0oU3b2DbcdcIFPiI/Q=; b=P4do1z+InnSC/w/klbDavuISS4k+w5VlRRDsDd9uNXhCdEwdIXDkjuGqmjk8s36V8y TQ4fCnOxnbamBpqQ0EDphRcSn5n1Ual7agZNd7nasRRhCeOK7Gqoj1782k3NJjzmTTsk NXuGQfO+/fDRHxQBZc8vwXEZ6cWsiOfyJpgxg1dkmCZIqRINwK6W608ea3kRSikL2NqZ o1gNLYWMzsnCKNs2QYobfjPzw01KsLaeYvW/ZrSPuDixswFvu+pfhQZKRpbRCYSgXhhB j6XJrYOWzyiLyUqPwy6QmKSkQFA4uk7EEXD0/A+vugduzP/uk/KUQKsSdayPAM1rl3zP xjbA== X-Gm-Message-State: AOJu0YwI+dlTdvHSaLl7gqDzBABRJVbdTbmGjcTuFlhIuqpZZsxyRfnQ dtPCOrvqE73q421lTX0b46kQmHBNHQFhAUf5ozVO8g== X-Received: by 2002:ac8:5ac4:0:b0:41c:d62b:fb51 with SMTP id d4-20020ac85ac4000000b0041cd62bfb51mr39263562qtd.26.1701295220560; Wed, 29 Nov 2023 14:00:20 -0800 (PST) MIME-Version: 1.0 References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> <20231128204938.1453583-10-pasha.tatashin@soleen.com> <20231128235254.GE1312390@ziepe.ca> In-Reply-To: <20231128235254.GE1312390@ziepe.ca> From: Pasha Tatashin Date: Wed, 29 Nov 2023 16:59:43 -0500 Message-ID: Subject: Re: [PATCH 09/16] iommu/iommufd: use page allocation function provided by iommu-pages.h To: Jason Gunthorpe Cc: 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, 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, 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 14:00:35 -0800 (PST) On Tue, Nov 28, 2023 at 6:52=E2=80=AFPM Jason Gunthorpe wrot= e: > > On Tue, Nov 28, 2023 at 08:49:31PM +0000, Pasha Tatashin wrote: > > Convert iommu/iommufd/* files to use the new page allocation functions > > provided in iommu-pages.h. > > > > Signed-off-by: Pasha Tatashin > > --- > > drivers/iommu/iommufd/iova_bitmap.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > This is a short term allocation, it should not be counted, that is why > it is already not using GFP_KERNEL_ACCOUNT. I made this change for completeness. I changed all calls to get_free_page/alloc_page etc under driver/iommu to use the iommu_alloc_* variants, this also helps future developers in this area to use the right allocation functions. The accounting is implemented using cheap per-cpu counters, so should not affect the performance, I think it is OK to keep them here.