From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B702C369C2 for ; Tue, 22 Apr 2025 07:44:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE72D6B0005; Tue, 22 Apr 2025 03:44:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A96B16B0007; Tue, 22 Apr 2025 03:44:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95CFE6B0008; Tue, 22 Apr 2025 03:44:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 770D26B0005 for ; Tue, 22 Apr 2025 03:44:27 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F34D9C5E71 for ; Tue, 22 Apr 2025 07:44:27 +0000 (UTC) X-FDA: 83360892174.22.A3E008C Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf22.hostedemail.com (Postfix) with ESMTP id 38808C0009 for ; Tue, 22 Apr 2025 07:44:26 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UWT8zpQs; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of leon@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=leon@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745307866; a=rsa-sha256; cv=none; b=LiX1JwyIo7YwkuPHIE1zcmPhV0a4uk1z7zYBIXQIqC8+bifqC8vDglVLsC8pEDusnUDPBI rdB/N1BGOR7438rJXk2XlaSKwIO6LMx968Y76ED43I8NojKOlq8gixMo4lI0vGvNUtLRMr ZVPj51ZvxFRsGnFYatIV3r1/UG/nLmg= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UWT8zpQs; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of leon@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=leon@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745307866; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UnX3SwBrFlJmAEIyOKmv2MkVZ0z5pQYpYBguMGQREqw=; b=Dxkppu5LpGrgw7dKC4aq212vJbXpPSOmkGYrAIgmK5bJ6Yk/o8fulsaAnzjCkw5hSW/3VL +Gc9x18tVHsHONUeWi63G9e4B4hDGF3SuX4sKo3uLb5CzUaNSmT9NXuE/wfZ3bASr+LBXy uEL2QpYkmHoVbmxMjrX4/u8pV0xTsvc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id A085444996; Tue, 22 Apr 2025 07:44:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1566FC4CEE9; Tue, 22 Apr 2025 07:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745307865; bh=IkpCJe6iK3e0zmgzu4HOe7msfQx4RRcdkVXQ/zE59nM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UWT8zpQsdCGRmAI20Z+3AYlApwN36Cmhj6cwB5IbEbE/IARvNVu0tWdo4mIoQ7tla jNP/ANqauZjnvPJUDWeJ8zADeaD5f36aQ2RWsAs+HUooXKhuTuo6yu/E07zazBROX6 xznqv+BPsU6Ncghg2SNTxJe37syfeyaxQcr9WAF/Foen5407hErRIFOLLYGI7pgvGN CyJIqFICxTnqDUBmc1sGRXnHfviqEbMmgDyblOZ2xNZJFl02u19GY6Nbpt7EgtHA8c CrDGpNwLguDhhfqO7ogHBVTsHjC7XaO9VuKIwQLJaY5iHytN6aNXhIGafF6/jV6lt1 HqZxDZY2NWy3Q== Date: Tue, 22 Apr 2025 10:44:19 +0300 From: Leon Romanovsky To: Christoph Hellwig Cc: Marek Szyprowski , Jens Axboe , Keith Busch , Kanchan Joshi , Jake Edge , Jonathan Corbet , Jason Gunthorpe , Zhu Yanjun , Robin Murphy , Joerg Roedel , Will Deacon , Sagi Grimberg , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, Niklas Schnelle , Chuck Lever , Luis Chamberlain , Matthew Wilcox , Dan Williams , Chaitanya Kulkarni , Nitesh Shetty Subject: Re: [PATCH v8 24/24] nvme-pci: optimize single-segment handling Message-ID: <20250422074419.GD48485@unreal> References: <670389227a033bd5b7c5aa55191aac9943244028.1744825142.git.leon@kernel.org> <20250422043955.GA28077@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250422043955.GA28077@lst.de> X-Rspam-User: X-Rspamd-Queue-Id: 38808C0009 X-Rspamd-Server: rspam04 X-Stat-Signature: 8efizh6ia7zgb1jgw4kwbyfo67u1mmia X-HE-Tag: 1745307866-82427 X-HE-Meta: U2FsdGVkX18LPFxjhe1a45wWgXDdsV60QrWfU4ZCjR/iIKGWlSo5qN4IrDi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ezrqlDEyQyf6L0sOf5zZfOUh49UpQsvbXddJqEl6TWqcoed1FeJsv5K0Gg3FCWaLwOGy3DCCxfmoEPHmWknsuNI5g0/kzN/ZqK5OnKVH4Ioz/7Pyg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Apr 22, 2025 at 06:39:56AM +0200, Christoph Hellwig wrote: > On Fri, Apr 18, 2025 at 09:47:54AM +0300, Leon Romanovsky wrote: > > From: Kanchan Joshi > > > > blk_rq_dma_map API is costly for single-segment requests. > > Avoid using it and map the bio_vec directly. > > This needs to be folded into the earlier patches or split prep patches > instead of undoing work done earlier, preferably combined with a bit > of code movement so that the new nvme_try_setup_prp_simple stays in > the same place as before and the diff shows it reusing code. > > E.g. change > > "nvme-pci: use a better encoding for small prp pool allocations" to > already use the flags instead of my boolean, and maybe include > abort in the flags instead of using a separate bool so that we > don't increase hte iod size. > > Slot in a new patch after that that dropping the single SGL segment > fastpath if we think we don't need that, although if we need the PRP > one I suspect that one would still be very helpful as well. > > Add a patch if we want the try_ version of, although when keeping > the optimization for SGLs as well that are will look a bit different. > > I'm happy to give away my patch authorship credits if that helps with > the folding. I used this patch separation for two reasons: 1. Your conversion patch is absolutely correct and this patch is an optimization. 2. Wanted to make sure that I'll post to the ML the code exactly as it was tested. I'll try to split/fold this patch now. Thanks