From patchwork Thu Jan 5 21:46:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13090566 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 AED4AC4708E for ; Thu, 5 Jan 2023 21:47:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DFCD94000D; Thu, 5 Jan 2023 16:47:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 766C0940007; Thu, 5 Jan 2023 16:47:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6307F94000D; Thu, 5 Jan 2023 16:47:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 49F65940007 for ; Thu, 5 Jan 2023 16:47:00 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2642280780 for ; Thu, 5 Jan 2023 21:47:00 +0000 (UTC) X-FDA: 80322081000.29.2D5A7D2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id A0EC8C000E for ; Thu, 5 Jan 2023 21:46:58 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="v5z/fr3P"; dmarc=none; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672955218; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6uhBgyX+WOyze+nX1i+x8P3OR4HsIe/Xfex6UDdj364=; b=0BBMlDKFxuERYzFCQO+KU7BMHGxXRJW6PpTxW/YwsxRcM/G9+fAF5ebxc34+lfA4EKWE+R zhuXb9KbTGSFsXx9uMZ/LNFY9mJ264YhVmRlv7SfwHGQ6eLuuWygx3coi2O0cGFn2Zd0DZ 4MCuM4FLGMG2FN8gg+2b9gSncCHxfrM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="v5z/fr3P"; dmarc=none; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672955218; a=rsa-sha256; cv=none; b=gXcxrb12CjC27bcU+OPghTtRM1XRABrbXGxyKD1sihgeeZGMlUzseXVTkd1li8kH9qBEJ2 O8fjlTCsZQeWCUt/A0PYE93oTbkxVOyDVhM5yzg/IO9v1rNcHWsc5dnfUnljizjKwmmuum iq5wH16j25H6er+1Sj4/bWroOjmQqkM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=6uhBgyX+WOyze+nX1i+x8P3OR4HsIe/Xfex6UDdj364=; b=v5z/fr3PVZGh697DbXoplcl2Z/ BZG57SwPmhuMZpINsUVHfbg4HwLTZkzxCUpekfNQSflEsjNiIBTurjWjNONBZ77UiCfo5z++2YbZO Jd3vzyVOHp7fae4KvEtSTHMuHXm6y3+OIjuYkrYXdzRsQTsrogD6JmfC10Rq5CJ5oWOhA3lwbawhJ K0LqZiP37FtCFstnvEamkO/10fCCEi4mGnvYgwHkraaDlC802vgN6D5r4zaxDMC3tEkpWSYUkfXLR PcmDscpmvVMEfJ0R9yb5o6gJIT2s0mf6WNS8TgCdT5ILvN8N5VbL//vZ81IE4hSWYeQijoHEbmbgd 8TyBMPLg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDY4H-00GWn5-NJ; Thu, 05 Jan 2023 21:46:33 +0000 From: "Matthew Wilcox (Oracle)" To: Jesper Dangaard Brouer , Ilias Apalodimas Cc: "Matthew Wilcox (Oracle)" , netdev@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt Subject: [PATCH v2 06/24] page_pool: Convert page_pool_return_page() to page_pool_return_netmem() Date: Thu, 5 Jan 2023 21:46:13 +0000 Message-Id: <20230105214631.3939268-7-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230105214631.3939268-1-willy@infradead.org> References: <20230105214631.3939268-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: A0EC8C000E X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: par1wx7pkkpbf6t8ydxr44nx6jifbdbw X-HE-Tag: 1672955218-845209 X-HE-Meta: U2FsdGVkX1+g3VfUk2PfPMqa1U8Yx1Hi2xePOZgGshzdYRdELT4Nl/8n26l5oZ6uKt/hll3eqxUAg16nFWV+ZhPsQJIROVXzBQ2JMqI51o6WcinN4cdT5ifa8h1B9a2mlH/h3d5Hi/Kw1M8O4R5CGBB132LuccIiRg9X2PWaYieEZjXIk4VD84zj8f3EQv6Qx9vRjw84ditdUNbs9Wx9GYxuo9JoNAX1DB+cIhoW4ruOXtJse6lZPaPeZCSF2jBo5anrcbcRLcqDwuZhay/xGR3AAgkGCtbdUYiDKlVdNtynr696GL7LVE/zMcgfYsW/vHIjzmoCgB7SPxOmQxYQWiEADZ1ZQDaOOKMSzXE4DrS1Iqli6PtO7WQLbdT0XQg4B6a+oyUlrXE1cOgngAS++JJeLET7jMM90zfxrttrCOgmFVgQXZL0ogVNdVJCU2Y9qnWh6iHydOyh3YeA0C6YRNqSqqSyOMlnu8MCCxSXd0YO/bGMtLogMpwa7O+oZ80XpznV8Sb7Z/wdvAUxocD3oGafo/G8SBaEWIn26VQAoiKn8u7GjDpNyJyEt/5MSgqND1Dkrs59cPngFBptlT2C2pL+jOO9MOceGvSJleqMWT5316FpgM/xQEA6nvv/Xyk9kZksEvcCshQ6TWMrd0jcvcqBGEBs/6bBQVi1JtkH2NVlT2C4HUvt4JnzxLocS9YIfumdR0Nwt9vJuBE9T+/HzYz5wo9MhMfHAZED79HCWNjWqehn/kJ7d8To1mohkJ+K899KHO3YNKTGqweQSeWGWI+FOAPwxSvlCaeOxHz5UdpKs91+QXltPDyYNrKXABDbZ5ov6wtij/h2N1J+IEKNhjdfWo8gQp0fsqHQkJBOlTwh/5qEmHb5jPMSEnXFZEuq3nwHiIpUdyLbP54FX5v92jBGLn37ecXv6rhSUmllseWXuZQAOPxP6g== 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: Removes a call to compound_head(), saving 464 bytes of kernel text as page_pool_return_page() is inlined seven times. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas --- net/core/page_pool.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 4e985502c569..b606952773a6 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -220,7 +220,13 @@ struct page_pool *page_pool_create(const struct page_pool_params *params) } EXPORT_SYMBOL(page_pool_create); -static void page_pool_return_page(struct page_pool *pool, struct page *page); +static void page_pool_return_netmem(struct page_pool *pool, struct netmem *nm); + +static inline +void page_pool_return_page(struct page_pool *pool, struct page *page) +{ + page_pool_return_netmem(pool, page_netmem(page)); +} noinline static struct page *page_pool_refill_alloc_cache(struct page_pool *pool) @@ -499,11 +505,11 @@ void page_pool_release_netmem(struct page_pool *pool, struct netmem *nmem) EXPORT_SYMBOL(page_pool_release_netmem); /* Return a page to the page allocator, cleaning up our state */ -static void page_pool_return_page(struct page_pool *pool, struct page *page) +static void page_pool_return_netmem(struct page_pool *pool, struct netmem *nmem) { - page_pool_release_page(pool, page); + page_pool_release_netmem(pool, nmem); - put_page(page); + netmem_put(nmem); /* An optimization would be to call __free_pages(page, pool->p.order) * knowing page is not part of page-cache (thus avoiding a * __page_cache_release() call).