From patchwork Wed Jan 11 04:21:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13095982 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 EE84FC46467 for ; Wed, 11 Jan 2023 04:22:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE68B8E0001; Tue, 10 Jan 2023 23:22:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B0D038E0008; Tue, 10 Jan 2023 23:22:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FC7C8E0003; Tue, 10 Jan 2023 23:22:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 23F6C8E0009 for ; Tue, 10 Jan 2023 23:22:14 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E2E87AEAC1 for ; Wed, 11 Jan 2023 04:22:13 +0000 (UTC) X-FDA: 80341220946.22.2345D8B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 7231E140002 for ; Wed, 11 Jan 2023 04:22:12 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EXnjQTT8; spf=none (imf23.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=1673410932; a=rsa-sha256; cv=none; b=FBcG8l267k7IiCyAm7BTVQYY98I8NlwUB7Mk76qfKcGTTRFYcvRxj2V4kooe4ovDX9WOWU 2/rnyz9QB6WGrvmhocllQ0Zt4fgZF1Oceagb71hSvwE5cscmVChvkCvQFwpQnRyfExlgWK 9qyB1H9UFJIlRwcIBlrAbkmDP/etO4Q= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EXnjQTT8; spf=none (imf23.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=1673410932; 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=aQIazIavYV+NBVdSEy/Z4Zzxu1F3nzX6W09JzMIlN/w=; b=F2//QSQTTt/4LszBJYkgK/aMcuCDJgdtOtrxuSfU2auLypRXYNOX1MwieD23R3Qfbo4om3 N7idoVaFeBde8jcwkkg0uN/H2+frP1aMBYj0aq40cdZbrp0ZuA9RhXYfCVZAe/Ovw5bNoB GL5n5QATnCJiopQyrIQMHoDlv2t8T4w= 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=aQIazIavYV+NBVdSEy/Z4Zzxu1F3nzX6W09JzMIlN/w=; b=EXnjQTT8iPOAy0YpF8azvGs419 hmzpyj3005xEdLAGG2Ra74mk2bN22rfEB0y9WJF+CKPCz4olluQWe1VmCZ4onG6rIBHShFcCGqSCR LYyukeNkxBIcC1zBnXghIgtN7Kj4gC9kqYDqJq8czJo8r2l6Jz1W37CkkKcG9FAAJ9XzVdFajQP4l rAzqtqjz3AnaZcx4hEnHw6sX2coXtOsgEtsv/kSQP/bo2opvOr/yLKCNtwQGynDGWR6ej97S/SW7Y J/u7U6FvNIAKDWmO3+gPDGGMoa9JzU4VrdgNs0cNFTDqlF325t6HwGIUBnbIkgmi8A+mvkS+8y0sv hvedGfPg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFScy-003nxs-Lr; Wed, 11 Jan 2023 04:22:16 +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 , Jesper Dangaard Brouer , Jesse Brandeburg Subject: [PATCH v3 06/26] page_pool: Convert page_pool_return_page() to page_pool_return_netmem() Date: Wed, 11 Jan 2023 04:21:54 +0000 Message-Id: <20230111042214.907030-7-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230111042214.907030-1-willy@infradead.org> References: <20230111042214.907030-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7231E140002 X-Stat-Signature: 8ir167ki8idcsckoh97gq9jjnkh83ab4 X-HE-Tag: 1673410932-451961 X-HE-Meta: U2FsdGVkX18MmxMZkMHfrd4ajLKdOrXnt/DHcnW7pnoF2h41STlFqpFZvFt8PTvnYPbUKGS39T79FY82r9Ar6pqI/DkbBMfxcNIqgMC5Ltkfv5XwVk9qJnT8i/phYEPq9+f1GqlbnBscUTpsmGGgBbIoYdf2He7yFdvtmy4gQbMy6sY5bPZP2Jvu2LMxaVqiPHlgi6k2LoUMmLHJ51dVXgVM5Vvry7/bf9ysZXatbyv6lExYk1Si4EJordOGj5zFc6T1ZxEqfx6fTvLRZQ7kTB1sb7Vb3lshsanB5s3A4XWiyp0QWvIPNbehAXiPT2uC7m3zSn6aUl85eQsqsuyAZKMagQewma4LpQAvsSJwORg/wMBBcG8CthvfO47Vz+G65cp+solFNO+TWfKiN2lzP9/tharaeCGdpf5Q1u1KZo3O356wDheyWPDYgwZCVSDyvPKw1WSuSibGW0UlTB3nPKU7vgXJl+qbKRKE99eOlOGMXX4X+SykW0zHj5GMBBJ5kXwZqSoGWLWohfMMlh0/FwIyIFKLPfyIPL7gYwvMql3zT81LPKCyiggkROqnyz8h1Wsb4yHaUoXjBDElhS8qdu8W6AU477iXG/xe/htXIRL6PzjkJxnZk1Eo7oCQYoVx8JFpOklmmRz5obpaPKXVpy4YiKudPODdbb2G4gq8geGplrJApygTJGSkeu/oca1BdXkesxikur0ej1iwDDJ/x1+CFvo44hgI+UroQ1Ys3sfAE9095lD1P8aZ7MkDPOAh1VAMrEHhu0l8fsfhpvN+a77/N1IeCiUgBkvH1xMHVPVgX6v5CWN5uXDpOuOp2lIr3xYWBvOzj82Fs+mTOAVRVGy5rX1ahhWduoLdiA3fAWbrMg4G8jI4L3+wOuWKVUgbwISIRv6xjAzCnPjwd4hdW/JpFrdE08jvtmB9xJAo00Ozk3acAPCutA== 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 Reviewed-by: Jesse Brandeburg --- 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).