Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp114301imm; Fri, 21 Sep 2018 11:14:01 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb0tZefHysLkhi7ZbmDXnz8pJo80IbXb5RGGM+7Cpo2VxgpS3Thn3hn73liIYICEAyJsivQ X-Received: by 2002:a17:902:784a:: with SMTP id e10-v6mr7709420pln.197.1537553641436; Fri, 21 Sep 2018 11:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537553641; cv=none; d=google.com; s=arc-20160816; b=ANkaw7iAmblKs6PMOG76oCEKr3J87sZ30dln97NuTjBLJDmn7QwZ1v22IZbyEFgn9Y caFin/GKDYWDrFHStY35FbpZ7Asf8kVCpf54ujmf9QLIrbj4spX+ep+zWg4vVSvepdQF 2XRwUI8YtZNPAWtav2IvkjTRUm4dv7s2qPaSL9N1PY1hRrv1iRpEqOBjyqTw20/62TTB +bVQODR2COC+oKk0UgFXg6oBuz3Ey1z0XQosY6VYRhRCAqSu1zCRHFEHupYzmmgp/inR DbdAFgWzM42XqjjwN4RSxXjVw0vrJVhtLb1spi4Z2nGpmoyhvDuMkCVJ2c6BdLBi5ghY FueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=rn7MlAH/0XDwxkzedy6rLOoP+76l2uP5EcBRSi36Vr0=; b=AXMVLH04EcwdwxQuvhBr/tR0AJgWHYOw1TJg9uSI+RbODD99oyXXAXzeEJU3gBoh6K kUQfRJgKqv0E+aabCPZYuyw9dta5mgVQbPpcinOYcVIPSSk0YfD9YvN5bfwXX+nflzoc uWcSjR021F/XiOMGfCMNi1xNKGTn/o2ru4+pXNUUeq5SZd3JZlHYTy7apxDw0BzEnsF3 Xg0aMFAw7NWuRKHjsaEflYOtO1Segn6ShHAlFA5UdoU8Y84ER7f81a3ciVJlR53XkkDI tDrq6bDJ6e+OLDZBYHM7DFtC5xra/mSXAsDOVn5Ff/pT1eXsX/DvqdT895eA0nXrmCye k+nA== ARC-Authentication-Results: i=1; mx.google.com; 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 w7-v6si27713167plq.198.2018.09.21.11.13.45; Fri, 21 Sep 2018 11:14:01 -0700 (PDT) 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; 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 S2391134AbeIVADi (ORCPT + 99 others); Fri, 21 Sep 2018 20:03:38 -0400 Received: from ale.deltatee.com ([207.54.116.67]:45342 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390076AbeIVADi (ORCPT ); Fri, 21 Sep 2018 20:03:38 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1g3Pvg-0001PM-0z; Fri, 21 Sep 2018 12:13:24 -0600 To: Bjorn Helgaas Cc: Jens Axboe , Keith Busch , Alex Williamson , Sagi Grimberg , linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Stephen Bates , linux-block@vger.kernel.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , =?UTF-8?Q?Christian_K=c3=b6nig?= , Benjamin Herrenschmidt , Bjorn Helgaas , Max Gurtovoy , Dan Williams , Christoph Hellwig References: <20180913001156.4115-1-logang@deltatee.com> <20180913001156.4115-4-logang@deltatee.com> <20180921131550.GG224714@bhelgaas-glaptop.roam.corp.google.com> <20180921164813.GJ224714@bhelgaas-glaptop.roam.corp.google.com> From: Logan Gunthorpe Message-ID: <506dd00c-35e9-e285-bc97-c689c766b4cf@deltatee.com> Date: Fri, 21 Sep 2018 12:13:21 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180921164813.GJ224714@bhelgaas-glaptop.roam.corp.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: hch@lst.de, dan.j.williams@intel.com, maxg@mellanox.com, bhelgaas@google.com, benh@kernel.crashing.org, christian.koenig@amd.com, jgg@mellanox.com, jglisse@redhat.com, linux-block@vger.kernel.org, sbates@raithlin.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, sagi@grimberg.me, alex.williamson@redhat.com, keith.busch@intel.com, axboe@kernel.dk, helgaas@kernel.org X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v6 03/13] PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-09-21 10:48 AM, Bjorn Helgaas wrote: >> I think the use of "map" in this context is slightly confusing because the >> general expectation is that map/unmap must be balanced. Yeah, Jason said the same thing, but having an empty unmap function seems wasteful and Christoph said to just remove it. My opinion is that it's not that big an issue one way or another -- if we have to add an unmap later it's not really that hard. >> If you keep "map", maybe add a sentence or two about why there's no >> corresponding unmap? Will do. > Another wrinkle is that "map" usually takes an A and gives you back a > B. Now the caller has both A and B and both are still valid. > Here we pass in an SGL and the SGL is transformed, so the caller only > has B and A has been destroyed, i.e., the SGL can no longer be used as > it was before, and there's no way to get A back. I wouldn't say that. Our map_sg function is doing the same thing dma_map_sg is: it sets the DMA address and length in the scatter list. So B is still A just with other fields set. If the caller wanted to map this SG in a different way they can still do so and the new DMA address/length would override the old values. (Normally, you'd want to unmap before doing something like that, but seeing our unmap is an empty operation, we wouldn't have to do that.) Logan