Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp421014lqs; Tue, 5 Mar 2024 06:08:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWduINNA/4v4k+Qi8UEqezGRM/RGdBNesFeHchPw9bAKkF4MDpF2e0bRACU4E0FQP4egsIgG9F+yCp99X2ORfCeOBMsS9tjIJjh4vKszw== X-Google-Smtp-Source: AGHT+IEKxH31oScw8XTUm5qgl/GXRZlDStBVRe9ycDWJ+dXozC3isV0oJhwtqDjl5vxlk6U4DiNo X-Received: by 2002:a05:6a21:32a9:b0:19e:cbe9:63b with SMTP id yt41-20020a056a2132a900b0019ecbe9063bmr2885720pzb.3.1709647734572; Tue, 05 Mar 2024 06:08:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709647734; cv=pass; d=google.com; s=arc-20160816; b=NkANBuWbBJcR0nKG7AjzII1Xw67yTK5XaFz36wUDt9Poh7+vqpABDZ07WIBD13yF+O CcZjp4V6TWnoUEd925ke6XuxpcOEA8ozMYmb2V6EXJimpfhyqGg12DWru0VuCenOBrNS wiuig9f+AXFviLoPsesfNXWiaiBlgCdZc0mcCJRR6XuY9msdUGUyp3VmQHXcPQaiyMiT prbYB5cN/PEkicQJyz3eZoPJOMnfMaeU7xmfYr9x0r55c9CfUjF8+tfn7VGAgvrGS8Ly iUFpeNRcTLbbdiatxw9JFcn4XaVt80hWZYPzAK5KgCcGQR1cIVQrP8tP62VWCtkYHCxL j4ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=ewCGOUvvhW7Ce/IrgNIDAy5v5dBppGB7wTuBIxp0XdI=; fh=09k9upITHCl+oq58DBjIHtZT5YJPbjIm9qOYjWJIAYM=; b=O5ZdBappuYE0j0F7WI6V03jEEtlI41chOGUd8794zgRYrgtDGd/qPI6MP2jeqayJQx ZxrY+uEUyk8tybAf1rNErGB9egpieGaPmpnvQTl38Yo7LggCqgLasKSwHVGxMcjEAB0t N4xpHeNOr8tXCWvYILBkmHPOFvK5X0WJGVdeGZFdRhBlFXj6WB62birpn0heyb1zQnfS 5ovJWeN6ShfOF0MSU17P03H8pyK3SA9n4EozmQZ+FN3zsRzCq9tODOz7qm+KuB+P1DPT +zSfk/J+ZnxDt3OQ7THkL6OtrwX2v4kWlDyZro5/crkww7oa4qpBAXl1i9Uz/XN+Qh0F oP4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-92490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92490-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r4-20020a63d904000000b005dc4c1f8c5dsi10192916pgg.579.2024.03.05.06.08.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 06:08:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-92490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92490-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 250B1283510 for ; Tue, 5 Mar 2024 14:08:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75D5D8615C; Tue, 5 Mar 2024 14:08:40 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 91DAF8613C for ; Tue, 5 Mar 2024 14:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709647720; cv=none; b=CBVUGpEWV6ggbSHYn555qOjfJcp5eM/7zKmxJNbgyFFmdRobonAJhLUJzKNwZGsHZPlBokTDhOPC+47SOfZ+dHc1NDYAHSbEEdugWxYup82U6Q0iURDb86OSMMuS/wo2+ntGJdAM45R05okiofGbueVxLiCSJHaiQitAIYWM2Rw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709647720; c=relaxed/simple; bh=ewIBfX/apZ/XRSsDq8e9bZDdrJfrqmhnRuRfiKH1Lmg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IKpY3sAT4ZKaIWGA/OTvY2V7/Px4+y+VMczcH4A6uAhGy4+Q+hrsEqM+Sy0QdC8OvUe+SHkk8Y/NoDYTQ2afCcajN5STdBjBfmgA0pM2OqqyT9Iw4e2Guw7EbCZ4XWejHziUYBhXsPgusmsqJkQMNkIlXm1db4pVPQxsQ5qX8Pg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 220A468C7B; Tue, 5 Mar 2024 15:08:34 +0100 (CET) Date: Tue, 5 Mar 2024 15:08:33 +0100 From: Christoph Hellwig To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Michael Kelley , Will Deacon , Robin Murphy , Christoph Hellwig , "linux-kernel@vger.kernel.org" , Petr Tesarik , "kernel-team@android.com" , "iommu@lists.linux.dev" , Marek Szyprowski , Dexuan Cui , Nicolin Chen Subject: Re: [PATCH v5 6/6] swiotlb: Remove pointless stride adjustment for allocations >= PAGE_SIZE Message-ID: <20240305140833.GC3659@lst.de> References: <20240301180853.5ac20b27@meshulam.tesarici.cz> <8869c8b2-29c3-41e4-8f8a-5bcf9c0d22bb@arm.com> <20240301194212.3c64c9b2@meshulam.tesarici.cz> <20240304120055.56035c21@meshulam.tesarici.cz> <20240304165506.49e3b2d3@meshulam.tesarici.cz> <20240304160210.GB21077@willie-the-truck> <20240304200428.4111d78e@meshulam.tesarici.cz> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240304200428.4111d78e@meshulam.tesarici.cz> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Mar 04, 2024 at 08:04:28PM +0100, Petr Tesařík wrote: > Sure, this will solve the allocations. But my understanding of this > same thread is that we don't need it here. The historical page order > alignment applies ONLY to allocations, NOT to mappings. It is > documented in Documentation/core-api/dma-api-howto.rst under Consistent > DMA mappings, for dma_alloc_coherent(). IIUC it does not apply to the > streaming DMA mappings. At least, it would explain why nobody > complained that the more strict guarantee for sizes greater than > PAGE_SIZE was not kept... Yes. arm32 (and before the dma-direct conversion various other architectures) have relaxed the required to a PAGE_SIZE alignment, and at least no native dma direct has ever returned less than PAGE_SIZE alignment even for smaller allocations (as they are all rounded up to PAGE_SIZE). So I think the documentation could also use some updating to match reality.