Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2038693rdb; Sun, 24 Dec 2023 13:48:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEaHvFo+3mJ90jXHDOUhyo6w9P7Al1PFjk7AjUgpf/Cn65zE5hok0lEx0mZ6VAUJan0HVPW X-Received: by 2002:a05:620a:2296:b0:77f:913:1dd1 with SMTP id o22-20020a05620a229600b0077f09131dd1mr5924923qkh.105.1703454522938; Sun, 24 Dec 2023 13:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703454522; cv=none; d=google.com; s=arc-20160816; b=ITEubDlauPBoGg2BNHZxNa8d72n0Xoxrpr3mVKAU+HU0c46Ho7riFLv7DTj5TaRqqo aAV86w6yzAKm7KaNqpZGfdXwL/RLn+3v/KHC8lPVwEmfXQsA4xvuiUDb2G9Nr3O/Je7T OXrlLePmfVwHxULJPYwsjsQPCwxWuqbhcbCuj2jAKK6H8edjGDlakgj5hS4b9oH/L/cF aM+Yu5KWo/chEeGiAOSokS47NwM0UeDJ13PQkJZguSw8aJj1NYJSmBZHXY8SBR7Dyj2K 2Im7GgkXcNQVas8KJLjLa3m8OZT7gyMXArb/ntB99XWBlKd0aBkLHnc9odougIv9JtPe 6pXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iS4XqJ2iABVTA87UAP3QHDG9uzTMdMhBSMobX+j7nkw=; fh=GUtF3P4Z8kawozrWiYaJnDNV8ciZe+heX4/T67G0XGA=; b=zoHfdXxOfxCbCl7ACrxDj4d8pdXUUaXwLXQCi9aEhF85okMcIspJcxuzC40NEYB0XG 4jCatQ1KfyaAJKI5Zx+Duzu+AZ7Vrzq6cg8aTlmUyxmvfcT7plDJZ23Z4ZpJ0hp+LP9v hOARvmH42dePlRrLHQifEG9b84kIP60mehQIrVFEqtjprYw9AyZ+6GcHNmVLQnIZPTlN 3JuMtsWuWFjAYukZEsLrhfEu1ze1boL/isCEGkghPt9YBlyVjr2eBOBpZtrK7qtut9/N YkiA4fEXmJL9Gzkz+h2urHXW07ATe2yxdMVnsICHx5VxXIyOSVQcukLHThw8EQyYBVaq SUdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oP0ArS5X; spf=pass (google.com: domain of linux-kernel+bounces-10838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10838-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m21-20020a05620a24d500b0077d7c062e8bsi9632807qkn.568.2023.12.24.13.48.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 13:48:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oP0ArS5X; spf=pass (google.com: domain of linux-kernel+bounces-10838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10838-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 AA2D91C213D1 for ; Sun, 24 Dec 2023 21:48:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA567107A4; Sun, 24 Dec 2023 21:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="oP0ArS5X" X-Original-To: linux-kernel@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E27DFBEF; Sun, 24 Dec 2023 21:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iS4XqJ2iABVTA87UAP3QHDG9uzTMdMhBSMobX+j7nkw=; b=oP0ArS5XMerkIUplOafUOc2jkf xd6inAczmxuCSkcupZtjzZwLdPR450XFbqVXVdOoMu+ZgEVMSuXyBqVXwLEj+cvFCdjyaQ+TZlMeN GPOAZmWo5vwwIoSDRpkjzeZd01Ff1VKdrXgltm6g3/O7LKt01JtGOFz06MdIJNKq41AoANV1GBtj3 PhNxXHKxaT0oXm1YvIs1BY1OMqYslvGZF/l6iqnZ/PzN0NVBoFRKY3Jw9xZriwpXUM5iuZAbG0inV SHNsGQLdXhf87JrqnW9GEnwoHW0R+6ZiRH01SK2HXETJ5P1bOkUJ1WUd+OiIFkLTH3xg6no19SMEl /vYubegA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rHWKG-00Ek0R-Do; Sun, 24 Dec 2023 21:48:01 +0000 Date: Sun, 24 Dec 2023 21:48:00 +0000 From: Matthew Wilcox To: David Rientjes Cc: Pasha Tatashin , Andrew Morton , 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 01/10] iommu/vt-d: add wrapper functions for page allocations Message-ID: References: <20231130201504.2322355-1-pasha.tatashin@soleen.com> <20231130201504.2322355-2-pasha.tatashin@soleen.com> <776e17af-ae25-16a0-f443-66f3972b00c0@google.com> <1fd66377-030c-2e48-e658-4669bbf037e9@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1fd66377-030c-2e48-e658-4669bbf037e9@google.com> On Sun, Dec 24, 2023 at 01:30:50PM -0800, David Rientjes wrote: > > > s/pages/page/ here and later in this file. > > > > In this file, where there a page with an "order", I reference it with > > "pages", when no order (i.e. order = 0), I reference it with "page" > > > > I.e.: __iommu_alloc_page vs. __iommu_alloc_pages > > > > Eh, the struct page points to a (potentially compound) page, not a set or > list of pages. I won't bikeshed on it, but "struct page *pages" never > makes sense unless it's **pages or *pages[] :) I'd suggest that 'pages' also makes sense when _not_ using __GFP_COMP, as we do in fact allocate an array of pages in that case. That said, we shouldn't encourage the use of non-compound allocations. It would also be good for someone to define a memdesc for iommu memory like we have already for slab. We'll need it eventually, and it'll work out better if someone who understands iommus (ie not me) does it.