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 47E4CC5479D for ; Fri, 6 Jan 2023 16:53:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76CDB8E0002; Fri, 6 Jan 2023 11:53:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71B948E0001; Fri, 6 Jan 2023 11:53:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60A1E8E0002; Fri, 6 Jan 2023 11:53:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 507968E0001 for ; Fri, 6 Jan 2023 11:53:05 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 22EC4120910 for ; Fri, 6 Jan 2023 16:53:05 +0000 (UTC) X-FDA: 80324969130.22.E91CEE7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id EF607A0012 for ; Fri, 6 Jan 2023 16:53:01 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lnA9B+VT; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673023983; a=rsa-sha256; cv=none; b=7vufL7hfhpMrMC8YxeshybvWi3OOjJBBt0GZ2mHZ7KyvX2h9Iv5xVEpXOFAdAQhrBdJRfL levLf/ZgBlq8FFvbvjHm3zIFjEWTifUDZqoogMvJ+AJrCD+aMYrMSI5O/wsWSVRMLNO9rA MMnZVuZk03Gjs6mgpE0r1tqTmzzaOSA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lnA9B+VT; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673023983; 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=38Qf+Z+DyorIl/jTzxoGVQ9eElw18urL37eoCfexcdM=; b=e4PnU3ibFsBJYB9Hq/v6u3gjl9oEg+MlRU0zroU1SUmZ6Xx5bzoXH8M52XHOSlTJafruXG /lA+BmnGseHAAPM65k3mXvftYQnl2mJWkN5flaR1LG0WdeLC9PiZnb/QaVYHDDQQOHu4Z1 2EfvQcvMuEOZPGGXCInPhgrH3kFLXjI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=38Qf+Z+DyorIl/jTzxoGVQ9eElw18urL37eoCfexcdM=; b=lnA9B+VTkEH5jaZmYs+khnGSy+ QfMtquLQzWeq+ROuukq0CYuaeESWRSM/DVBGtD0PyioFqb1CV4iGUfEw61EzVwnUawYGzGR+v22hZ NMsbYxvpkPv3n9xH4U9YGI5UkveibE+Qv4R36oWEMzOskOMsnuDIQlCxVvw2/nndw1kuNrI8fg45C WmO9karVv14eHbr/2kMltsuRr2yyuzQiDVu+w/h8QWaGoqFpQ1KdcN/5XUWMoefkWrd3gF6Xolc+t sHwraoDfwVHPasvEtGoi2fcm6BZ6Zo2fW325KiptW70JKLJeVxacSD+r/XNESzmsXIpkwK8D0XiAr 334jJNLA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDpxk-00HKNw-D2; Fri, 06 Jan 2023 16:53:00 +0000 Date: Fri, 6 Jan 2023 16:53:00 +0000 From: Matthew Wilcox To: Jesper Dangaard Brouer Cc: Jesper Dangaard Brouer , Ilias Apalodimas , brouer@redhat.com, netdev@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt Subject: Re: [PATCH v2 17/24] page_pool: Convert page_pool_return_skb_page() to use netmem Message-ID: References: <20230105214631.3939268-1-willy@infradead.org> <20230105214631.3939268-18-willy@infradead.org> <1545f7e7-3c2c-435a-b597-0824decf571c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1545f7e7-3c2c-435a-b597-0824decf571c@redhat.com> X-Rspam-User: X-Rspamd-Queue-Id: EF607A0012 X-Rspamd-Server: rspam01 X-Stat-Signature: 8dadb85xqdbj1p18soufq98ubom8rjjy X-HE-Tag: 1673023981-387948 X-HE-Meta: U2FsdGVkX1/EZqzctFUpQ/4+KvCeRnUgIApPAIMe2OVDgc4JYXDwjXXtkmBds5UlphSza2ZNbyjDGKrJQ8vGCg9emuZlCgQy+IiCaQ1iimuzQ5eJYOpn5oWGmCm8UYuM2HK/78HBwvSiFp2vhRyHRgrTvaX0DbfrB66KnRmPyS5l8pmQvTUkjJ7JTA4W6UCLndkHZ33FPDj66ETq9N+YNyd1M+IYtLBYdAklCduVPQWPc1WbH6p2C34mgDwoauIduTtrUbG4MbQXH46UamKHwtIsuS7jFjshsuxys8HwsQYPrQ3kOgwIYyA8WflvrIVFb5TH9CQqfLBXs8CveMcgk/djpArCAGgPZYNAZXR/EDrBVCO9g2O816UIjJud6rRRWlAs7c2+bFjE0f9kFbkX/daczm7kCdiqJtW5A5Scl/zrqI+WRuh+Mkb/vven2pYuU4jk49g0eIOi/XvJdav13Hc5jXI+fJ3TVuFgPVh829bchrvpK22Qy6A6TtzSdr2XaPsoAVx2119vpQbEwezMmiAk/5sVKJWx5zTuLJ3wiLojVIQCElNU9f+BLGyeRrqg//KW5jWoP+CR0uP+jTuwTYZxP9LL8kMzipolfT1xotfSARRuClk+m46iK77Ioo525Oy4mfGDwGC+oy0iLHU86AqVx0luBgbitC515XBm+dRHuy5FiZZKb2ghG5GmsnUpgYJYVDx5f2aVzOOnpG1NaPu2maeTD71dwyGb40yNH3+/kbGWwfRZ01W3I9r8eig10WIb0tOZLxiKsSSpm8Cv+0xNxp/MNWqO1zcAXcSU9Zm0xnS3NWpWyFlRYshVQiao4A6S7aUhQLy0J8fwnpebPKa8WxLXlP0cGGzRTnA3z+OgceQZtJBesYc79OHW5Asp+3xFIehVzIbuUDVbPu6tgQ== 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: On Fri, Jan 06, 2023 at 04:49:12PM +0100, Jesper Dangaard Brouer wrote: > On 05/01/2023 22.46, Matthew Wilcox (Oracle) wrote: > > This function accesses the pagepool members of struct page directly, > > so it needs to become netmem. Add page_pool_put_full_netmem() and > > page_pool_recycle_netmem(). > > > > Signed-off-by: Matthew Wilcox (Oracle) > > --- > > include/net/page_pool.h | 14 +++++++++++++- > > net/core/page_pool.c | 13 ++++++------- > > 2 files changed, 19 insertions(+), 8 deletions(-) > > > > diff --git a/include/net/page_pool.h b/include/net/page_pool.h > > index fbb653c9f1da..126c04315929 100644 > > --- a/include/net/page_pool.h > > +++ b/include/net/page_pool.h > > @@ -464,10 +464,16 @@ static inline void page_pool_put_page(struct page_pool *pool, > > } > > /* Same as above but will try to sync the entire area pool->max_len */ > > +static inline void page_pool_put_full_netmem(struct page_pool *pool, > > + struct netmem *nmem, bool allow_direct) > > +{ > > + page_pool_put_netmem(pool, nmem, -1, allow_direct); > > +} > > + > > static inline void page_pool_put_full_page(struct page_pool *pool, > > struct page *page, bool allow_direct) > > { > > - page_pool_put_page(pool, page, -1, allow_direct); > > + page_pool_put_full_netmem(pool, page_netmem(page), allow_direct); > > } > > /* Same as above but the caller must guarantee safe context. e.g NAPI */ > > @@ -477,6 +483,12 @@ static inline void page_pool_recycle_direct(struct page_pool *pool, > > page_pool_put_full_page(pool, page, true); > > } > > +static inline void page_pool_recycle_netmem(struct page_pool *pool, > > + struct netmem *nmem) > > +{ > > + page_pool_put_full_netmem(pool, nmem, true); > ^^^^ > > It is not clear in what context page_pool_recycle_netmem() will be used, > but I think the 'true' (allow_direct=true) might be wrong here. > > It is only in limited special cases (RX-NAPI context) we can allow > direct return to the RX-alloc-cache. Mmm. It's a c'n'p of the previous function: static inline void page_pool_recycle_direct(struct page_pool *pool, struct page *page) { page_pool_put_full_page(pool, page, true); } so perhaps it's just badly named?