Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1105352lqs; Wed, 6 Mar 2024 06:34:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWcE3WziV87jrQfqBqm6jB1dBVJ3wb9GkwzTZHOi54otFrTe281WdpTKAp1VOQNAZcrfU0h0HkMqfwev7KILMCTS/IRR/c9HBFqStosQw== X-Google-Smtp-Source: AGHT+IElr8h1rYt1NN6LXiIH8jmzfF5zPKyn8moWNWXNXSXOFCFWfwDpV+lS26HToJQuBzuqGhI1 X-Received: by 2002:a17:902:eed5:b0:1dc:ae92:7e9 with SMTP id h21-20020a170902eed500b001dcae9207e9mr4729765plb.62.1709735642952; Wed, 06 Mar 2024 06:34:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709735642; cv=pass; d=google.com; s=arc-20160816; b=L8MNFVvcjvKWYV+Phm2Cg42J3aEm+fA7x5hKLX1C8R255B/MyFd6TMlttJoTcgr1Bv IfQpnHJPd9X58+ccXzXNbC2gJ0p7Fpq/ZUAyB52MdS5FkimezCEaReO+ZXWTjQLUVOOC Tt5BKpuKRkFoKoX1Z7KKfvuAiTRmfp82AQkWMqSb+UCdcNKArVbnhxR0qRceEJMuVxj1 38zha6P4Ab8Py1bR2gsS8lZ6Bi88TDT5suEK5qBvIaDIqVwFCXjRyqYUMwZhk9M8Ai9K 6kW9I1UCcc/teMsCeHLN0QHbYlLThXEyJjLCKKDqrGHiLwGD6w1F9srd00nioDdSjHWL 3emA== 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=TPfk3/rg5x7LQCu6CiycFoix8G7EBd+0lpqcx+Dlhh0=; fh=Siq6CRabiLcWdboW5oDPdsT7cd61Us38/QuvsYKGhrU=; b=KL4lWfBBjvSRDkP67shi4oCokRyiEsI2lhjo4IP7IAbY+d1bKdBu7deWLjoCJADsxP 7i1dUCLmg2nO8qUSmjvA12avrzwQh6P2/mBeMVVQuGozqxbXyi3lY3Ej/jsPXrx1J8U0 rrr6ug98ssxmJdtnmNLZHmit/3tHFhgTscT+F0y2Tsh3DBiUVCoRAaGrgjsJkdnC5CU7 x7hGBtjcaUCJrgxCp1nBWXqIwlZiDbzbz/+bZ8lviZF7izSltppZ+9ceBzbgbRtpf0Nz mIpuSGfqqfrd0NyhfEkOGzfCArfUQi5VEsFRKrGGtzC2XhiSrS/cWjJGkKeF56DAwztY kPeA==; 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-94059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94059-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u10-20020a170903124a00b001dcb8376f66si12339285plh.265.2024.03.06.06.34.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 06:34:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-94059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94059-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 9DDA9285D15 for ; Wed, 6 Mar 2024 14:34:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35C97134CCB; Wed, 6 Mar 2024 14:33:37 +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 8E6BE7FBDC; Wed, 6 Mar 2024 14:33:34 +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=1709735616; cv=none; b=q97PFBI6ReOmQlg6l1dU/FDzmqnqKhycsmwuV6/YxYRH7LW031r8c7Q6MXl7WfAn7yDwNu/GT6EiTbPyX4zr3XFWZ1hnys/agyAvXTRNpn7QOgY+rUH71BNQghdjnXjgwbbDRfVuP2ZUuisCk8ZnkjIe0jp75N32TRsVtNjEcv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709735616; c=relaxed/simple; bh=WWXYolFOYwBAJ/CdfPd6/jJ5gcZIPqiPh9G+qpwJ/Rw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mmP20bLAEemw2jng5Dqo0A5A+tj6rOXTDNFhxtBV42PChWJzW3eh1WD6wHFjfPpm7FglW1gyDQCXDpCebvIERcDGfQHr2Rl/hNyXskQv+gRfy/GlBMaz51EZ+NStzLmSGmIUnd5htWymED6y6VIgmCjjns4UVxb8lOS/yim6MGc= 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 378F068C4E; Wed, 6 Mar 2024 15:33:22 +0100 (CET) Date: Wed, 6 Mar 2024 15:33:21 +0100 From: Christoph Hellwig To: Keith Busch Cc: Leon Romanovsky , Christoph Hellwig , Robin Murphy , Marek Szyprowski , Joerg Roedel , Will Deacon , Jason Gunthorpe , Chaitanya Kulkarni , Chaitanya Kulkarni , Jonathan Corbet , Jens Axboe , Sagi Grimberg , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, kvm@vger.kernel.org, linux-mm@kvack.org, Bart Van Assche , Damien Le Moal , Amir Goldstein , "josef@toxicpanda.com" , "Martin K. Petersen" , "daniel@iogearbox.net" , Dan Williams , "jack@suse.com" , Leon Romanovsky , Zhu Yanjun Subject: Re: [RFC RESEND 16/16] nvme-pci: use blk_rq_dma_map() for NVMe SGL Message-ID: <20240306143321.GA19711@lst.de> References: <016fc02cbfa9be3c156a6f74df38def1e09c08f1.1709635535.git.leon@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 Tue, Mar 05, 2024 at 08:51:56AM -0700, Keith Busch wrote: > On Tue, Mar 05, 2024 at 01:18:47PM +0200, Leon Romanovsky wrote: > > @@ -236,7 +236,9 @@ struct nvme_iod { > > unsigned int dma_len; /* length of single DMA segment mapping */ > > dma_addr_t first_dma; > > dma_addr_t meta_dma; > > - struct sg_table sgt; > > + struct dma_iova_attrs iova; > > + dma_addr_t dma_link_address[128]; > > + u16 nr_dma_link_address; > > union nvme_descriptor list[NVME_MAX_NR_ALLOCATIONS]; > > }; > > That's quite a lot of space to add to the iod. We preallocate one for > every request, and there could be millions of them. Yes. And this whole proposal also seems clearly confused (not just because of the gazillion reposts) but because it mixes up the case where we can coalesce CPU regions into a single dma_addr_t range (iommu and maybe in the future swiotlb) and one where we need a dma_addr_t range per cpu range (direct misc cruft).