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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 227A4CDB483 for ; Thu, 19 Oct 2023 05:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbjJSFkc (ORCPT ); Thu, 19 Oct 2023 01:40:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjJSFkb (ORCPT ); Thu, 19 Oct 2023 01:40:31 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB39FAB; Wed, 18 Oct 2023 22:40:29 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 8A63867373; Thu, 19 Oct 2023 07:40:26 +0200 (CEST) Date: Thu, 19 Oct 2023 07:40:26 +0200 From: Christoph Hellwig To: Keith Busch Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, io-uring@vger.kernel.org, axboe@kernel.dk, hch@lst.de, joshi.k@samsung.com, martin.petersen@oracle.com, Keith Busch Subject: Re: [PATCH 2/4] nvme: use bio_integrity_map_user Message-ID: <20231019054026.GD14346@lst.de> References: <20231018151843.3542335-1-kbusch@meta.com> <20231018151843.3542335-3-kbusch@meta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231018151843.3542335-3-kbusch@meta.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Wed, Oct 18, 2023 at 08:18:41AM -0700, Keith Busch wrote: > From: Keith Busch > > Map user metadata buffers directly instead of maintaining a complicated > copy buffer. > > Now that the bio tracks the metadata through its bip, nvme doesn't need > special metadata handling, callbacks, or additional fields in the pdu. > This greatly simplifies passthrough handling and avoids a "might_fault" > copy_to_user in the completion path. This also creates pdu space to > track the original request separately from its bio, further simplifying > polling without relying on special iouring fields. > > The downside is that nvme requires the metadata buffer be physically > contiguous, so user space will need to utilize huge pages if the buffer > needs to span multiple pages. In practice, metadata payload sizes are a > small fraction of the main payload, so this shouldn't be a problem. We can't just remove the old path. We might still need bounce buffering to due misalignment and/or because it is notcontiguous. Same as we have a direct map and a copy path for data.