Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2830320imu; Thu, 29 Nov 2018 10:54:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/VhnF84uaefPqKoLWOFr+tActDiy1DVdBBQualB9P06kWJt16DVJ/HcNPU5/a6noB9JKT/c X-Received: by 2002:a17:902:3283:: with SMTP id z3mr2672984plb.76.1543517687055; Thu, 29 Nov 2018 10:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543517687; cv=none; d=google.com; s=arc-20160816; b=efghrkPNraBMnpCJrHozvrYMVu35PNXs8yB6aa1iPsjDFfkUkORwWMxGKx5VSzlxOV /VE8HX0IqJR0P0FsFTLWzk8TbKVpwqZr25x4abtijmpx9LHiHoiKMZwGY0w2+HVIKeJq 7EAmsQbZ2Gxl0EpFPwHLjZ/DKzhRW4fn85RMSLqGd3Y3kJG/Vha9J+M8C2O+bw7Rx0NK 4BWUCOLBLMazuXamlrKjaFo4XFV7ZEQBkm99r6a2B3Fx3Rto5B48Rco+TS749Y6i34hR 6huPdOK7jsYIAh2D5htdlpIKt0YFuym/hJpoTpzMufJG7WpboiFbbikkbtOFMmSh7ihG 1UjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JrDIGvMFZ61P7XwTjN+VVrxZRozo8qUinJjUBiQ+wXc=; b=jBOtaw03aVlatV771xg2jTNTNaBoofI7HJVHuiiy+V+4nAD4etEZ9s+rO4dvDNQh0s fx7QuKXf+DCIuZQx6+hK9OJj0PqH6+t3lMHCcJgrK8KKkUqA12Ak7hSR00GMWr1uZkm1 rI6inEbYRSf+P2Ck5mHP0qYfj1IPX2xxqiuJ4Ht3d6HvfMJviMvHk+aquTwSpEIlgURY fG5fP55etK8UVu+rP93UBRMA2rUFGWZdotGE2Qw8Eon/h0RahAErLEdIldWeT0bGfdta KLuRewL4pz2y5qjpmj+FM+BS07sH/NH3JObpwE0nByjpSRGuKZhu3qYmvlhQP531H+rD j23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bg74843n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si2629493pgg.430.2018.11.29.10.54.32; Thu, 29 Nov 2018 10:54:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bg74843n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726386AbeK3GAR (ORCPT + 99 others); Fri, 30 Nov 2018 01:00:17 -0500 Received: from mail-lf1-f41.google.com ([209.85.167.41]:43489 "EHLO mail-lf1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbeK3GAQ (ORCPT ); Fri, 30 Nov 2018 01:00:16 -0500 Received: by mail-lf1-f41.google.com with SMTP id u18so2241138lff.10 for ; Thu, 29 Nov 2018 10:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JrDIGvMFZ61P7XwTjN+VVrxZRozo8qUinJjUBiQ+wXc=; b=Bg74843nWWHD1YXFMRpFOEVId3CigmBTYWk97VTcqHNX8thigu5UZBMANFPm6658ZG 9gBULGWSjyzDunuSSIyCiEzHwB2IBI3s3sHc2Shjx/NhwAFGvrSWRwWkxY/sbk0AhAhH ItXS8zjlSZNUQgEDHFgBfOgroGuk35J4gRqUg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JrDIGvMFZ61P7XwTjN+VVrxZRozo8qUinJjUBiQ+wXc=; b=hhqSbLrY5dYunO6ioZM8AwKIxzNn+BO/OlP+ZauDqYtFEQOihCRnXWCt8A2xUCW3s2 URLEGW5NZ7D9PxtWK5dlpNc12Y7xcfcsZv/pOf0a2ybAvnvb+M20In9TnLh/TwAzMxYV oxOQzOApLWpai94qMex8M/WM5aOYUAcz0GZXcCJeOPY8Q+kQdzaGpGiMFR5UE1IDRxiY dW3asqigaD73ov2WcgRD8sp72WtSaSjDTZWsG9X+842xeHtzsHsUnynuPPYwN+MlA2Wd 7RC2X2NIxxPb/6pHRYwK+GxI1EQnOy5oJnKRSTlAHC274sQ5S6vAwrZluY9eXhApIBBq tM9A== X-Gm-Message-State: AA+aEWaQ55rrG0ZxW0BTPpOefiHydhfu2pMNNNHTWnvZmk0a/ZKFE9Rj DlScWviQVU1XFtA9a74svt6puhact1c= X-Received: by 2002:a19:d90c:: with SMTP id q12mr1735710lfg.24.1543517632407; Thu, 29 Nov 2018 10:53:52 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id e13-v6sm408030ljk.53.2018.11.29.10.53.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 10:53:49 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id z13so2242484lfe.11 for ; Thu, 29 Nov 2018 10:53:49 -0800 (PST) X-Received: by 2002:a19:7013:: with SMTP id h19mr1899446lfc.147.1543517628990; Thu, 29 Nov 2018 10:53:48 -0800 (PST) MIME-Version: 1.0 References: <20181123065511.GA17856@lst.de> <20181128074117.GA21126@lst.de> <20181128174545.GJ30658@n2100.armlinux.org.uk> <20181128180841.GM30658@n2100.armlinux.org.uk> <20181129162323.GA27068@lst.de> <20181129183132.GA30281@lst.de> In-Reply-To: <20181129183132.GA30281@lst.de> From: Linus Torvalds Date: Thu, 29 Nov 2018 10:53:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: remove the ->mapping_error method from dma_map_ops V2 To: Christoph Hellwig Cc: Russell King - ARM Linux , linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, robin.murphy@arm.com, "the arch/x86 maintainers" , Linux List Kernel Mailing , iommu@lists.linux-foundation.org, linux-alpha@vger.kernel.org, xen-devel@lists.xenproject.org, David Woodhouse , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 10:31 AM Christoph Hellwig wrote: > > > Or, better yet, plan on removing the single-page dma mappign entirely > > at a later date, and make the issue moot. > > What would be the replacement? Build a S/G list for every single page > mapping? Not sure that would create a lot of happy campers.. It's what we ended up doing with some other cases, and it didn't really end up hurting as much as I thought it would. I'm thinking of the vfs functions that end up turning "buf, len" into struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; and then passing it around as a single-entry iov instead (not even that - they end up being an iov_iter, which is not just the iov, but the whole "what _kind_ of iov" indirection) Maybe a very similar model could be used for just simplifying the core dma mapping setup: sure, people will want to do single-area dma, but how bad would it be to just turn them into single-entry SG lists on stack, and then the dma-maping internally would just always see that? Most of the high-performance IO is already using SG lists anyway, no? Disk/networking/whatever. But just an idea. And the "map_sg()" error handling isn't actually any better, I think. It returns zero on error, no? So it's not improving the error handling. The whole dma-mapping layer seems full of those kinds of "inspired error handling choices" ;) Linus