Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752685AbeAETE2 (ORCPT + 1 other); Fri, 5 Jan 2018 14:04:28 -0500 Received: from ale.deltatee.com ([207.54.116.67]:46718 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511AbeAETE0 (ORCPT ); Fri, 5 Jan 2018 14:04:26 -0500 To: Keith Busch Cc: 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, Stephen Bates , Christoph Hellwig , Jens Axboe , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt References: <20180104190137.7654-1-logang@deltatee.com> <20180104190137.7654-10-logang@deltatee.com> <20180105181152.GA10657@localhost.localdomain> <6c89e4b4-1854-c251-a5ec-7e54bc8085fc@deltatee.com> <20180105190135.GB10657@localhost.localdomain> From: Logan Gunthorpe Message-ID: Date: Fri, 5 Jan 2018 12:04:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180105190135.GB10657@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, axboe@kernel.dk, 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, keith.busch@intel.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 09/12] nvme-pci: Use PCI p2pmem subsystem to manage the CMB 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 05/01/18 12:01 PM, Keith Busch wrote: > On Fri, Jan 05, 2018 at 11:19:28AM -0700, Logan Gunthorpe wrote: >> Although it is not explicitly stated anywhere, pci_alloc_p2pmem() should >> always be at least 4k aligned. This is because the gen_pool that implements >> it is created with PAGE_SHIFT for its min_alloc_order. > > Ah, I see that now. Thanks for the explanation. > > Does it need to be created with page sized minimum alloc order? That > granularity makes it difficult to fit SQs in CMB on archs with larger > pages when we only needed 4k alignment. > > I was also hoping to extend this for PRP/SGL in CMB where even 4k is > too high a granularity to make it really useful. > > It looks like creating the gen pool with a smaller minimum and > gen_pool_first_fit_order_align algo would satisfy my use cases, but I'm > not sure if there's another reason you've set it to page alignment. I don't see any reason why we couldn't change this at some point if it makes sense to. PAGE_SIZE just seemed like a suitable choice but I don't think anything depends on it. In the end, I guess it depends on how limited typical CMB buffers end up being. Logan