From patchwork Wed Jan 11 04:22:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13095991 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 DFC29C54EBC for ; Wed, 11 Jan 2023 04:22:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7ECD900007; Tue, 10 Jan 2023 23:22:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A31BC900003; Tue, 10 Jan 2023 23:22:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 833AC900007; Tue, 10 Jan 2023 23:22:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6E812900003 for ; Tue, 10 Jan 2023 23:22:22 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4B667A02E8 for ; Wed, 11 Jan 2023 04:22:22 +0000 (UTC) X-FDA: 80341221324.04.2A5E875 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id D3ABD40003 for ; Wed, 11 Jan 2023 04:22:20 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GqjYjjRm; spf=none (imf17.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=1673410940; 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=LIpyWsE1egW3rdNDJQSSceevtlMG1hljGa+CXueNLKg=; b=hoD2XXz5eOTGOMx6WxqqYWCO881McO8cHlvEs/++2GwGS1AJvv4jPMK1QuYKa+J4IggEbw lYH/KUJYBB5TzyepU6JJXoDDBEJUkIXdUUzqeqjdfSDPVoRvQ+zU2Caeewmx0kWeNtmQ/y qy+Txm+88u51PuEs2Dx2Iz67mnkVtkU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GqjYjjRm; spf=none (imf17.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=1673410940; a=rsa-sha256; cv=none; b=TGFaOCM2NJ74hUI4S6UCBlypBh29c/WK4C2c2mrQSasQqz4VIHkmqpFggCML+C9oWT8lVg pStSdA3H0DprEJmLTFUVIVuvh2MwISfIc9aGSLpZMR+LtZR8aWWH7/OceuplTOHhZXq4KW YKXymU6CWU1iHdl3qfqHik61Et7YSt0= 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=LIpyWsE1egW3rdNDJQSSceevtlMG1hljGa+CXueNLKg=; b=GqjYjjRm0EkP5JDIoTGdWf1KIB UAU1GPViWTyvFI0LpZMp1stJI3JSjksXOHpc4mRJjHrzyUj4rzyECDM4UrxrrtkO++UiyRp8w9HQ+ OkeX1ts0qLFGqFqkbILsSa+BI56pD0xEKCIrZ0NoMqvZNmuBxdXZ3HEfgQPo6wWgCHk++r341Q2Bg sh8QAh6PDCH1etDN5JvznbegdC/2l5POOzLNZlAJyklPE1pRNjWAJNgTy/+DVXaKwRwozHBaK1bi6 DbY2rpOTKxenAoeRl+N78UHMTdzEiyNohLRjwJVb22bZnrF6hZs736NYKLzAiXMsSdWHAyW1VBswU WicYJQyg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFScz-003ny8-9G; Wed, 11 Jan 2023 04:22:17 +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 14/26] page_pool: Convert page_pool_recycle_in_cache() to netmem Date: Wed, 11 Jan 2023 04:22:02 +0000 Message-Id: <20230111042214.907030-15-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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D3ABD40003 X-Stat-Signature: 4m36of3mfkbqwncnemwgec6grxgutam9 X-Rspam-User: X-HE-Tag: 1673410940-191102 X-HE-Meta: U2FsdGVkX18vzUSNeKrmAQsYyLgQ6jmN6//hGo0CZoEajrrCivxKlKn6wupq1id14vhhp2pzInHjkAMD7kQ5T1McFHnEwK2tPEPFQMWul9aeCtJNUomur9OWZbSSinqZlW2jwAE7QqO/QwTuhCzXCcTxENIFmTRtTj2xlPdIAzD7gdfrLKq9bEu6c82vpgPDJxgVHJ2ZxxjUz5jw7BAQgTt30n58YPnsGsh0h3FikjTDFxabDBeWjKM46JXREdKYPb1QObwSlkGqcSaK/DAyRZ4t6D0txfEqsjHwC01e8UeK44X9LAxkaiAy5xJKa/HOFeeWViijzdWSxSFVdh9QxHfpafgXX9LmfghvUKie2VSpLuUreDAgCdva7TzOfmbT+eGEzFDMwCDpYifaovdXGJDhrkj/BSeuKr6CFBseQfKwMVdsaKtVFjfHUUR7qJQg1RpmRj2pT5hQsUlPm8iPDSV1KZlOdguHOFB2WWS4S7lsEX8ERhuQFf2G7wqIdbefxK2y4Hw9kDp3v0LGkXVZJKX9mu5AHTJy25Vh5IgZBfDTEtzY8nVJx3UyeIsX9g5Cl0pbngOSNu/nx4mS3s/Bvrb4WOBHyfjEjbfGF/RIkV+kso6oOC6UWOL1mTysCVJIfewEFWJ258itn+VyCoSwLErl1pG9py2EEqrmQt8OrwREc9p8EGNVol/YCV0QPXB1owwZYLTpmOVWZdlPbFwSqgrQRM/Zw5VQq4mPtfzcZBm7JBHn8kkJ7hYhIFVIdg67HsfE67iKtt8EFx3n1qdqB31/mawH1sdmuoW05dzXBdFFrfjzP3yPykcQLHEYOHnZ7YkHYpa5yxk6bHYi6Ie7Q6+9b3rpueqQO8o4X6iG9+t9b7051RfOzeoOWTFdEVSFA1f/CswqxJsLfzDfDkDWT4M/PUlRLtEzXk4tAeaYY2Nn82TN/dSwdQ== 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 few casts. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Reviewed-by: Jesse Brandeburg --- net/core/page_pool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 3fa03baa80ee..b925a4dcb09b 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -538,7 +538,7 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, * * Caller must provide appropriate safe context. */ -static bool page_pool_recycle_in_cache(struct page *page, +static bool page_pool_recycle_in_cache(struct netmem *nmem, struct page_pool *pool) { if (unlikely(pool->alloc.count == PP_ALLOC_CACHE_SIZE)) { @@ -547,7 +547,7 @@ static bool page_pool_recycle_in_cache(struct page *page, } /* Caller MUST have verified/know (page_ref_count(page) == 1) */ - pool->alloc.cache[pool->alloc.count++] = page_netmem(page); + pool->alloc.cache[pool->alloc.count++] = nmem; recycle_stat_inc(pool, cached); return true; } @@ -580,7 +580,7 @@ __page_pool_put_netmem(struct page_pool *pool, struct netmem *nmem, dma_sync_size); if (allow_direct && in_serving_softirq() && - page_pool_recycle_in_cache(netmem_page(nmem), pool)) + page_pool_recycle_in_cache(nmem, pool)) return NULL; /* Page found as candidate for recycling */