From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADB95C2E9; Mon, 6 Nov 2023 07:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: by verein.lst.de (Postfix, from userid 2407) id 3581C6732D; Mon, 6 Nov 2023 08:08:45 +0100 (CET) Date: Mon, 6 Nov 2023 08:08:44 +0100 From: Christoph Hellwig To: Keith Busch Cc: Marek Marczykowski-G'orecki , Mikulas Patocka , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Jan Kara , Vlastimil Babka , Andrew Morton , Matthew Wilcox , Michal Hocko , stable@vger.kernel.org, regressions@lists.linux.dev, Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, linux-mm@kvack.org Subject: Re: Intermittent storage (dm-crypt?) freeze - regression 6.4->6.5 Message-ID: <20231106070844.GA17022@lst.de> References: <20231031140136.25bio5wajc5pmdtl@quack3> <8a35cdea-3a1a-e859-1f7c-55d1c864a48@redhat.com> <3cb4133c-b6db-9187-a678-11ed8c9456e@redhat.com> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) > - dev->ctrl.max_hw_sectors = min_t(u32, > - NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9); > + dev->ctrl.max_hw_sectors = min3(NVME_MAX_KB_SZ << 1, > + dma_opt_mapping_size(&pdev->dev) >> 9, > + dma_max_mapping_size(&pdev->dev) >> 9); dma_opt_mapping_size is already capped by dma_max_mapping_size, so no need for this hunk. > dev->ctrl.max_segments = NVME_MAX_SEGS; > > /* > diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c > index 946bd56f0ac53..0e6c6c25d154f 100644 > --- a/drivers/xen/swiotlb-xen.c > +++ b/drivers/xen/swiotlb-xen.c > @@ -405,4 +405,5 @@ const struct dma_map_ops xen_swiotlb_dma_ops = { > .get_sgtable = dma_common_get_sgtable, > .alloc_pages = dma_common_alloc_pages, > .free_pages = dma_common_free_pages, > + .max_mapping_size = swiotlb_max_mapping_size, > }; > -- And this is the right thing to do. I'm pretty sure I wrote this myself a while ago, but I must not have sent it out in the end.