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 63AF8C6FD1F for ; Tue, 14 Mar 2023 21:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbjCNVvI (ORCPT ); Tue, 14 Mar 2023 17:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230380AbjCNVvG (ORCPT ); Tue, 14 Mar 2023 17:51:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 406DA51F8C for ; Tue, 14 Mar 2023 14:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678830622; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KWBL8j9Kw5UJa5rIZGzcpgA4OkzAlidgj6Myi5kTuW4=; b=NmhO5j5sk17P9kJvZzsDugALTp/4OTA83s1iIusZtulttcspa9/zhsbcr48ekppeBnGIyZ QSWNJhp3voXGsjLW2DiBXPf/CCREXAb1Mo5iVQEzZ/TCayuhn5P9Tj9Y8kSst61l7njEe6 TqWil1j2PylkPdT9BGS3jj4ABRwcjr0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-URV1ga8lPOq_q_b6t_9rpg-1; Tue, 14 Mar 2023 17:50:16 -0400 X-MC-Unique: URV1ga8lPOq_q_b6t_9rpg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7DB3385A588; Tue, 14 Mar 2023 21:50:15 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB3572166B26; Tue, 14 Mar 2023 21:50:12 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230308165251.2078898-1-dhowells@redhat.com> <20230308165251.2078898-4-dhowells@redhat.com> <3761465.1678818404@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Matthew Wilcox , Jens Axboe , Al Viro , Christoph Hellwig , 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, Daniel Golle , Guenter Roeck , Christoph Hellwig , John Hubbard , Hugh Dickins Subject: Re: [PATCH v17 03/14] shmem: Implement splice-read MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3826545.1678830612.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 14 Mar 2023 21:50:12 +0000 Message-ID: <3826546.1678830612@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > But please at least stop doing the > = > get_page(buf->page); > = > on the zero-page (which includes using no-op .get and .put functions > in zero_pipe_buf_ops(). I'll make the attached change. It seems to work. David --- diff --git a/mm/shmem.c b/mm/shmem.c index 3cbec1d56112..d9b60ab556fe 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2719,6 +2719,17 @@ static ssize_t shmem_file_read_iter(struct kiocb *i= ocb, struct iov_iter *to) return retval ? retval : error; } = +static bool zero_pipe_buf_get(struct pipe_inode_info *pipe, + struct pipe_buffer *buf) +{ + return true; +} + +static void zero_pipe_buf_release(struct pipe_inode_info *pipe, + struct pipe_buffer *buf) +{ +} + static bool zero_pipe_buf_try_steal(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { @@ -2726,9 +2737,9 @@ static bool zero_pipe_buf_try_steal(struct pipe_inod= e_info *pipe, } = static const struct pipe_buf_operations zero_pipe_buf_ops =3D { - .release =3D generic_pipe_buf_release, + .release =3D zero_pipe_buf_release, .try_steal =3D zero_pipe_buf_try_steal, - .get =3D generic_pipe_buf_get, + .get =3D zero_pipe_buf_get, }; = static size_t splice_zeropage_into_pipe(struct pipe_inode_info *pipe,