Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3530976ybb; Mon, 6 Apr 2020 10:28:32 -0700 (PDT) X-Google-Smtp-Source: APiQypI1pVrPAShVHP/IqSnT7N9G9TpjVe84jndKLry3eDey8S+RlHofchZS2qMsDjXlN5GfBAPT X-Received: by 2002:a9d:5191:: with SMTP id y17mr18910374otg.267.1586194112572; Mon, 06 Apr 2020 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586194112; cv=none; d=google.com; s=arc-20160816; b=wbmmlc/Mj41KV2Q6K6JkPLEQGRJTSbIcb1PDl5OBq+yeosfWUwO7o3Ms6j51JvYwzn BcKOTrXCyYmZlZs05xpG477Xmc+Dxzk3t08wzt9O56ps5zu0T0Ei7M7r6WJPnjvx73bX ixbyoc0QElxqLm98ulNjvn69xZE0KBgmj7ZVqH1AjbXhO0mJrplrxI1/WZJiz8EfmOWg vdw90us0TsqQOCkusywLokEczznnL32UIZpw3urMyUiaAFurRtyG+19gU/sKXzwNh2or VSYFuRo0K7EUXVDJcRXDc6dYe9X3T9OTgWMcPMg88Kj4Pc+rTQavNkRbB9h1FOa/Z0tm FXWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=z9u4z17MQHLU8JjKlQEWBupT2rR4NGIh6VInp4fg8wg=; b=ci7fjhQamRECcfnqXieIBG/iFz3ll8NeShu7NkNQhC4LK++u/hXavRE/V0pdUIU2D8 ecMVD4xHlGO2txNADF0evPvWnI5P06N0FQ+U6wlelo9vj4MLPgsGsHJ9YPFtF9vK4jjl mI1Ans9o6Z8J5fa34e/D7DBuzTKm9bnr80LMniSEzHsUx4vevj2KYr55T2VypJYCmRi/ CZty84CPm4i6w1r6+B6Y3QYX2NZLW+WmU/Cui4PPL7dxULdPmx/zNl/DRd0dsxPqGA5j QldPdI13JMptZno4mO1cAbLUljBN2WYsJah7qChU5UpNcPygMkMEFWNkG6LqVA4nSVej hC9A== 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 r67si7887685oib.237.2020.04.06.10.28.20; Mon, 06 Apr 2020 10:28:32 -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 S1728645AbgDFRRK (ORCPT + 99 others); Mon, 6 Apr 2020 13:17:10 -0400 Received: from verein.lst.de ([213.95.11.211]:34502 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbgDFRRK (ORCPT ); Mon, 6 Apr 2020 13:17:10 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 0319068BEB; Mon, 6 Apr 2020 19:17:06 +0200 (CEST) Date: Mon, 6 Apr 2020 19:17:06 +0200 From: Christoph Hellwig To: Alexey Kardashevskiy Cc: Christoph Hellwig , "Aneesh Kumar K.V" , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Lu Baolu , Greg Kroah-Hartman , Joerg Roedel , Robin Murphy , linux-kernel@vger.kernel.org, Michael Ellerman Subject: Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device Message-ID: <20200406171706.GA3231@lst.de> References: <87sghz2ibh.fsf@linux.ibm.com> <20200323172256.GB31269@lst.de> <20200324075402.GJ23447@lst.de> <41975da3-3a4a-fc3c-2b90-8d607cf220e6@ozlabs.ru> <20200325083740.GC21605@lst.de> <213b0c7d-f908-b4f4-466d-6240c3622cd6@ozlabs.ru> <20200406115016.GA10941@lst.de> <348046e7-7a38-62d6-4df0-e4a537b98926@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <348046e7-7a38-62d6-4df0-e4a537b98926@ozlabs.ru> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 06, 2020 at 11:25:09PM +1000, Alexey Kardashevskiy wrote: > >> Do you see any serious problem with this approach? Thanks! > > > > Do you have a link to the whole branch? The github UI is unfortunately > > unusable for that (or I'm missing something). > > The UI shows the branch but since I rebased and forcepushed it, it does > not. Here is the current one with: > > https://github.com/aik/linux/commits/dma-bypass.3 Ok, so we use the core bypass without persistent memory, and then have another bypass mode on top. Not great, but I can't think of anything better. Note that your checks for the map_sg case aren't very efficient - for one it would make sense to calculate the limit only once, but also it would make sense to reuse the calculted diecect mapping addresses instead of doing another pass later on in the dma-direct code.