Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp220288imm; Thu, 30 Aug 2018 12:19:23 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb5d6R8QyZRLn/yXfTHTsoVQu2xmLBno/xz3ndK+q/zlCzx+ATniu5ATv/xG1r0lGMOod9J X-Received: by 2002:a17:902:64c1:: with SMTP id y1-v6mr11364084pli.45.1535656763003; Thu, 30 Aug 2018 12:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535656762; cv=none; d=google.com; s=arc-20160816; b=cqDo/SLMHh/rt+PpFw/qvsnC6k5tlwMfrt/sfrCvecRJ4jsQdA8GqyNbtXUDJ7VhfO pt2B0KsNV3/E46Cc+gP/mAYzABbHIgNWwicg/BAfmURb3HrWkPRFVToiEdjHS/mQ1RKk 4gq1uh8pHPOvsf9jW9kAhTeMWaoLVAdCp4tpE8TgBqPmLrz2kfdGkAE2w9ZTF9Ups1iG 27FG7EpKAzn35POKhpzEw2wqNjZhf1+MC+g0Xr0D5QQ/3+3GbdAjfF6w/2K640649Tko VZtGR4/fXu7tN+fogG3C8N23iHXfbq+REUfNhePSpcAvhW08csKoXGWCS+VmSd6VRCTL HpUA== 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:arc-authentication-results; bh=LaVHOnBiErYFFK4DVnlmNUKK7Wsd7ZuTPduzKpU477Y=; b=I7ZUfKtRDWjbCY6yOlE5O3NjsM7UadoVGATNIlnAGcTvuW2ch/p5bWYR4Rt3zC92ge 2L4m49RPShQiHuiTWJusuq+CBVFpyUnbFTMVFSrNgP8i9He+pU//q04o6uowBhpAf38Q HwB2RSveV8bm9UwaAdCi7U23LA3fuUkwHjWE73mA9fa1eWoZd0aqWBVpotFlQ3NZrcqs ak7N3qHylhQTTxjphp/1hFhGFabhM0u30xcM7xEpnE4HBCeuv+wdDfi1fkcUhfktVsIX qOTPZJuXlapkHysOBNSokRfySax4qYRcFv4ZCjTELhv4yJS2IOLnoxoZTYeutayOi0fU uNlA== 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 j1-v6si7102281pfh.63.2018.08.30.12.19.06; Thu, 30 Aug 2018 12:19:22 -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 S1727233AbeH3XVe (ORCPT + 99 others); Thu, 30 Aug 2018 19:21:34 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40596 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbeH3XVd (ORCPT ); Thu, 30 Aug 2018 19:21:33 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fvSRq-0006wf-LJ; Thu, 30 Aug 2018 13:17:43 -0600 To: Jens Axboe , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20180830185352.3369-1-logang@deltatee.com> <20180830185352.3369-8-logang@deltatee.com> From: Logan Gunthorpe Message-ID: <7c5b9d2c-d94e-582c-f1d7-0827dbb7df7c@deltatee.com> Date: Thu, 30 Aug 2018 13:17:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: 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: christian.koenig@amd.com, alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, hch@lst.de, sbates@raithlin.com, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk 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 v5 07/13] block: Add PCI P2P flag for request queue and check support for requests 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 30/08/18 01:11 PM, Jens Axboe wrote: > On 8/30/18 12:53 PM, Logan Gunthorpe wrote: >> QUEUE_FLAG_PCI_P2P is introduced meaning a driver's request queue >> supports targeting P2P memory. >> >> When a request is submitted we check if PCI P2PDMA memory is assigned >> to the first page in the bio. If it is, we ensure the queue it's >> submitted to supports it, and enforce REQ_NOMERGE. > > I think this belongs in the caller - both the validity check, and > passing in NOMERGE for this type of request. I don't want to impose > this overhead on everything, for a pretty niche case. Well, the point was to prevent driver writers from doing the wrong thing. The WARN_ON would be a bit pointless in the driver if we rely on the driver to either do the right thing or add the WARN_ON themselves. If I'm going to change anything I'd drop the warning entirely and move the NO_MERGE back into the caller... Note: the check will be compiled out if the kernel does not support PCI P2P. Logan