From: hch@infradead.org (Christoph Hellwig) Date: Thu, 21 Jun 2018 07:56:27 -0700 Subject: [PATCH] nvme: use __GFP_NOWARN for iod allocation In-Reply-To: References: <4cb394ca-7032-ea67-5bb1-ef331e42ace2@kernel.dk> <20180621071535.GC21304@infradead.org> Message-ID: <20180621145627.GA17825@infradead.org> On Thu, Jun 21, 2018@08:37:28AM -0600, Jens Axboe wrote: > On 6/21/18 1:15 AM, Christoph Hellwig wrote: > >> else > >> - max_hw_sectors = UINT_MAX; > >> + max_hw_sectors = NVME_MAX_KB_SZ << 1; > > > > I think this only makes sense when using PRPs. If we use SGLs > > in Fabrics, or in PCIe controllers that support them we are > > only bound by the number of SGL segments and MDTS. > > The problem is that we have to limit the max size, since the > sg allocation depends on that, marginally. In reality, the segments > will dictate the max size anyway. The sg allocation depends on the number of segments. The PRP allocation (if using PRPs) depends purely on the size + a little slack for unaligned first or last arguments. > > > This also seems to miss handling the case where MDTS is set, but > > above our software limit. > > Shouldn't, we're using the min of MDTS and the software limit. Ok, maybe I misread the patch, but it surely looked like that.