Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp434430lqb; Thu, 29 Feb 2024 05:33:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0QY2M3za3hx70UbzQ7mi8/GePBBt7/CIAlFR/bpDasCQpnKw0efBQ+3wbzkqm+hm/sctLphP4L3SfpvmVpZpbc61KuHMDdmVe97YS/Q== X-Google-Smtp-Source: AGHT+IHnXG7NMit4Yx4HSIhfp1TyvPb2O+3D27NzuRE0pnKUu7JdmPXOMMNLoNQ/sLrsBvSw5Iyr X-Received: by 2002:a17:90a:d383:b0:299:5e44:dad9 with SMTP id q3-20020a17090ad38300b002995e44dad9mr2124119pju.12.1709213639583; Thu, 29 Feb 2024 05:33:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709213639; cv=pass; d=google.com; s=arc-20160816; b=CnB7BKUC/WOt/dNa3yI5215v7Y818S7Bb9AxhgMJxueuX+9lfiyQI8j9/gxgp7aS6D vH1lTpQadM4lYR39MqqWfg9obUe8L277KIf7aqQYZGRX1ErjI5j+N/b1nVAwyNT0AP1C CvKyMKRgS1LMI3/G6y7v6QcBIx4B4V/taqKIfC9IDHVptRcAWM3jG7WxYetY4GqfULGK y/cAfmer07fhreD1m53ZlPQV3Iir+vW3/OmvkGXzaVY9AiXYDkLY3BjZB4wW+C/cQSrM m97ZFvF/K99qiFY7zUrOqDY0Q48D9MT5kWQH87/z/4I+hn5WWIE8QtLX5GTqVhYnIuqw Y5CA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=RZG2DtmrpFisQrWVzOuyf+JzLtFoWM04oj0Ur3NWb9E=; fh=kxwxwzmZizArvi38AdZy4qFssCWPRhmFQwgsIPCQhd0=; b=PKVUMr4cTJMenIdgABPVCs12SDOoomKkdgO7Xb1+X8S1wx2590qI5xkt6lt+fuMOfw a6M9+jzOJNEmffPYPo69PR9kK5qjdht3pyfxKxxQzXmZoXb+c8sVvnoz3LA+eFleBATN ecfBExPl195t21pSfHQ9PDv3Pz0XQyBMNYTJvk4D+6yxyNrmWKgq+JNbqSG/47BKcI8f Rg9eBYU7O1JxftEB92mm0Tjdg/PMgNZdkIaEaHYwuoqcJsrSHOUkXKqQH/EJUqD1evor kaNm4OfvUcu8j+LTlCtoLeceCnOIUBR517a9Hqo3WSS1Zq1by6HGeguKypjqSXlrai2c xyGQ==; 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-86757-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86757-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 19-20020a630a13000000b005dc7e74bd95si1354758pgk.564.2024.02.29.05.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:33:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86757-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-86757-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86757-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 428892844DC for ; Thu, 29 Feb 2024 13:33:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 197077E782; Thu, 29 Feb 2024 13:33:53 +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 45F497CF20 for ; Thu, 29 Feb 2024 13:33:51 +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=1709213632; cv=none; b=smpx7TPvo2F+jG+Mig8Il7qFb5arvp5+btiir6K/JF0ExMDp7h4hRpl+NWaJ/Hbzfp7odQKTEwyaM79yP6nl+76VCsp9pNXMyHrEfjRnvKxDybtP/sI9gGqa2w9eTAjLBlO8SeaeFJ38rLUsVvO7CCMhViVABtUeumTU2Rx6XsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709213632; c=relaxed/simple; bh=LThZZNkAXsa+89NZS8uyFLOdu2ejwU5VZEYspmYPWDU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TOn90iUeArr1XQqUBeDxSGpRxqWYyhBsDDPEIRDUYkObIuqJIKwIl47q5h24KZqL9PSDN+1ZJPF3i9FPEQ+fIGn/is9ZGnfm31jML49OVKOubmKyl1+fxbzs/B3POH84wSCILZtjIVeHoOHpaKUfelT8tk2TiZ5WGq9uHtUxC1w= 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 61F8168BEB; Thu, 29 Feb 2024 14:33:46 +0100 (CET) Date: Thu, 29 Feb 2024 14:33:46 +0100 From: Christoph Hellwig To: Michael Kelley Cc: Will Deacon , "linux-kernel@vger.kernel.org" , Petr Tesarik , "kernel-team@android.com" , "iommu@lists.linux.dev" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Dexuan Cui , Nicolin Chen Subject: Re: [PATCH v5 6/6] swiotlb: Remove pointless stride adjustment for allocations >= PAGE_SIZE Message-ID: <20240229133346.GA7177@lst.de> References: <20240228133930.15400-1-will@kernel.org> <20240228133930.15400-7-will@kernel.org> 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: User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Feb 29, 2024 at 07:36:05AM +0000, Michael Kelley wrote: > If there *is* a requirement for page alignment of page-size-or-greater > requests, even when alloc_align_mask and min_align_mask are zero, > we need to think about how to do that correctly, as that requirement > is no longer met after Patch 1 of this series. It has been historical behavior that all dma allocations are page aligned (including in fact smaller than page sized ones that get rounded up to a page size). The documentation actually (incorretly) states an even stronger guarantee: "The CPU virtual address and the DMA address are both guaranteed to be aligned to the smallest PAGE_SIZE order which is greater than or equal to the requested size. This invariant exists (for example) to guarantee that if you allocate a chunk which is smaller than or equal to 64 kilobytes, the extent of the buffer you receive will not cross a 64K boundary."