Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1909156rwl; Wed, 12 Apr 2023 21:51:50 -0700 (PDT) X-Google-Smtp-Source: AKy350azNLv+aEt0xojclnYj23o9TaAa2rL1pRJ6iukl6NzytheP/BsgeNfyROWYqKcuvx6q0OjC X-Received: by 2002:a17:906:2788:b0:94a:90e5:b2b6 with SMTP id j8-20020a170906278800b0094a90e5b2b6mr1234935ejc.58.1681361510372; Wed, 12 Apr 2023 21:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681361510; cv=none; d=google.com; s=arc-20160816; b=u0mEL+NS5yCLchPPi1FN76iLWsMEnYYWTkUwFqJ3WD3E4B7uK6WBXk1ndch1/gLy/d fbUGpoqckB4p0zp5RLhSa4Y+KsDfnwdhVmdo76gDKSr0iVAdxqYC7OYxxF4+5mKT7POB gTENuaR2iSSfx8p2hNGfvbkutZZ7iY2KB4F3OIB/+xjI7JU/uLD16/CrpzHAUwcVvRNx LHNiEcRUWCuGdM6fs/er1eU9JapjeHhY6kLi+mV6R+PheJRotGc2QH7mL//nRiwhQtsE tT0GfBayLH9LX1bZ1vgzMZbxSB7l1FZp6ohJHnpzy+6z8yhtCv/4CV8vujzFOmsFN1mJ M75w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6sG3AiyiM7RBR5syEPdqKTpBbcBuB1IEexi+k/rw2bU=; b=iy77VDhBGsRDLHZlLne5ER7NqEOFdwVW1Sx8Wm6Mgk+jCX5RHAa9BpY9VhEzxNUrRd egBQW+VyHBKYuYMiqFOZknI2WMa+qCOI6rP4+3H1aUr1PXGmEHo+FtKqlcxBuFjcXkhb AOLT/DdH09KXv9SfjkJOPrrwj3jlHHzC6wqS+0C0SfXoy+7YTPOXEmWK6f8sFUPhb7MD tnUfDveR5XTwC7rs3HJUtJPprSQdM/ieLMhIF6goSqZNZizCRFXSiBY7LJV3ZQLFLjfa JTR0gwrR0KvqnKgO1wMykbQJXnr57JiGlxoGDiJdBtP+IIECIPFkBeOGXhQdIU3bMuFQ 3+KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=N2wDv10m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vu8-20020a170907a64800b009314f2c4e80si860214ejc.873.2023.04.12.21.51.26; Wed, 12 Apr 2023 21:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=N2wDv10m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbjDMEl3 (ORCPT + 99 others); Thu, 13 Apr 2023 00:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjDMEl2 (ORCPT ); Thu, 13 Apr 2023 00:41:28 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C4446B9; Wed, 12 Apr 2023 21:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6sG3AiyiM7RBR5syEPdqKTpBbcBuB1IEexi+k/rw2bU=; b=N2wDv10mH1eRELcaGDIhhfrC/X PKXw8TloGBGgmaWkWPyJ7pnLJe9PN6dDwebeLQQvZBrkRstWL4H7RMJ8sojdrt2/6O2Jy7v042nvK dtybLlkGUhzy4xR+hDyV4gm14c+0j4dYc8FrzjIDPT8ozVC6l4ERwOhXJN1q2Ptda5TSgQRWW2IsB 57Nhy3k5PDsn8pamzEmWJ6DsfoK6/TTtY2AceKkN9SFMBun67gSyEIYQjUI6oNJBu8vpIMvTtIhKu ISOSTKarUReRQSlUuuC1O9RMlgEV6Ws4iDDCO5uMfXyQAf0dCXKcKoKwM6czVmFwCbebcq8QVs2Qo QKwTsrBw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pmolv-008Wc8-2g; Thu, 13 Apr 2023 04:41:23 +0000 Date: Thu, 13 Apr 2023 05:41:23 +0100 From: Al Viro To: David Howells Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Chuck Lever III , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH net-next v6 06/18] net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES Message-ID: <20230413044123.GB3390869@ZenIV> References: <20230411160902.4134381-1-dhowells@redhat.com> <20230411160902.4134381-7-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230411160902.4134381-7-dhowells@redhat.com> Sender: Al Viro X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 11, 2023 at 05:08:50PM +0100, David Howells wrote: > Add a function to handle MSG_SPLICE_PAGES being passed internally to > sendmsg(). Pages are spliced into the given socket buffer if possible and > copied in if not (ie. they're slab pages or have a zero refcount). That "ie." would better be "e.g." - that condition is *not* enough for tell the unsafe ones from the rest. sendpage_ok() would be better off called "might_be_ok_to_sendpage()". If it's false, we'd better not grab a reference to the page and expect the sucker to stay safe until the reference is dropped. However, AFAICS it might return true on a page that is not safe in that respect. What rules do you propose for sendpage users? "Pass whatever page reference you want, it'll do the right thing"? Anything short of that would better be documented as explicitly as possible...