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 C4D56C636D7 for ; Wed, 8 Feb 2023 16:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbjBHQUQ (ORCPT ); Wed, 8 Feb 2023 11:20:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjBHQUN (ORCPT ); Wed, 8 Feb 2023 11:20:13 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A520C10EC; Wed, 8 Feb 2023 08:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LdWmKE8iSIX1JlD2STqVG0cGUOnOBTQ2AvkgJAV1Ucw=; b=mzpUA3HNhoAPzog8HOG696touj O4bPToePR6BJZyqSoKQZwpXI3Sr/Aa/CM+ph4rCpAdCGtSo/xwCaX3Uv+A7K/BqUmm1J9kiW9vYLv 5vkbTBCBhEbhqkIBAW3P5qFZ1qioHcDKFj4IxB02xSbP0r41dIndR94DuXY43KOnM5ztcmz3+a1oz xeA1ETJl8rK5BGdIbdtE7fs2iIBY0YOiQD6QoRArx69tYSAdfUTli5YiIP5HNZrZ2pDOJqgSh+nPY wnbdumaj4MLlobdcYTMAHbGVXdZzwvuKoB6dBKSBiBh9EMoJragF8nZxpQ4zFqKW4tR0wOpMBCLgV /EnT95QQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPnAq-00GEkU-2z; Wed, 08 Feb 2023 16:19:56 +0000 Date: Wed, 8 Feb 2023 08:19:56 -0800 From: Christoph Hellwig To: David Howells Cc: Christoph Hellwig , Jens Axboe , Al Viro , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzbot+a440341a59e3b7142895@syzkaller.appspotmail.com, Christoph Hellwig , John Hubbard Subject: Re: [PATCH v12 01/10] vfs, iomap: Fix generic_file_splice_read() to avoid reversion of ITER_PIPE Message-ID: References: <20230207171305.3716974-1-dhowells@redhat.com> <20230207171305.3716974-2-dhowells@redhat.com> <176199.1675872591@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <176199.1675872591@warthog.procyon.org.uk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 08, 2023 at 04:09:51PM +0000, David Howells wrote: > How about one of two different solutions? > > (1) Repurpose the function I proposed for generic_file_splice_read() but only > for splicing from O_DIRECT files; reading from non-O_DIRECT files would > use an ITER_PIPE as upstream. Given the amounts of problems we had with O_DIRECT vs splice, and the fact that even doing this is a bit pointless that seems sensible to me. > for splicing from O_DIRECT files, as (1), but also replace the splice > from a buffered file with something like the patch below. This uses > filemap_get_pages() to do the reading and to get a bunch of folios from > the pagecache that we can then splice into the pipe directly. I defintively like the idea of killing ITER_PIPE. Isn't the 16 folios in a folio tree often much less than what we could fit into a single pipe buf? Unless you have a file system that can use huge folios for buffered I/O and actually does this might significantly limit performance. With that in mind I'll try to find some time to review your actual patch, but I'm a little busy at the moment.