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 0E05EC47088 for ; Wed, 30 Nov 2022 22:08:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 545B26B0082; Wed, 30 Nov 2022 17:08:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A4E06B0088; Wed, 30 Nov 2022 17:08:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBE736B0082; Wed, 30 Nov 2022 17:08:08 -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 9D1E66B0083 for ; Wed, 30 Nov 2022 17:08:08 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 782434083B for ; Wed, 30 Nov 2022 22:08:08 +0000 (UTC) X-FDA: 80191497456.05.8D820D5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 0EC054000D for ; Wed, 30 Nov 2022 22:08:07 +0000 (UTC) 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=hhgNIUCxZExeWU3Da4EdVgppfCYn/YsquALun7mh3kg=; b=ZKBe7wFXG7z39jmLufRfrrtk3S toKZbSE1NNOPrYUg5aTImDQH6lr5XFDR5g85kafW8f6h7lAm/8P+73n8jjfqOfDxohe7wqon1RS2k AB307UOidlx8/RfhmfW80tFW+FQS7Wm1lQOS24obFBOFBpTfpMAGUQUSCvP87KAjoUHJo7ZEIMsI8 XtJ9ijMI9Tg+MJ5xEQV1GzyBoru/fDhL3UheQy3dh6HYJGzTIbwO1p4G5za8PcDusgSToJ2I7ZwkT wSkAH3eczXRILCOnNeC8gl6dp+9d2PRgSuTIVJqH2qyomgoRmiWKDcpzyhnOBKjqzWjvIp0kMKphg LcLA4/8w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0VFN-00FLVe-PH; Wed, 30 Nov 2022 22:08:05 +0000 From: "Matthew Wilcox (Oracle)" To: Jesper Dangaard Brouer , Ilias Apalodimas Cc: "Matthew Wilcox (Oracle)" , netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 14/24] page_pool: Convert page_pool_recycle_in_cache() to netmem Date: Wed, 30 Nov 2022 22:07:53 +0000 Message-Id: <20221130220803.3657490-15-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221130220803.3657490-1-willy@infradead.org> References: <20221130220803.3657490-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669846088; a=rsa-sha256; cv=none; b=asHha0pQAyfVzaAUPEgk/SyB1kYPxwKYHbXpbQjiEUXTKysVzli6+xQ4C7KMigtLPG/vjL 80YpVH9fWihDxQr0yKyIRuhUPtt3Gt7ml1eZIRf87zZ7wYacfYDacuWvlul07V4rYErec7 wQFngCT3Fwzb0Rn6tZPf8k8f9dLcBjY= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZKBe7wFX; dmarc=none; spf=none (imf11.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=1669846088; 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=hhgNIUCxZExeWU3Da4EdVgppfCYn/YsquALun7mh3kg=; b=Ah8m9tQ3zcsW9vzouwkY+wl9vNlpdfQx89GbEwX3RzIFAZqsIYaty4DiNPTyNv6Y0pXZT+ MZG2779OV0tJ028D3hmGG6JNCIP6vSs2C2gSvPYv1zOrmgg9wmnRuPVXaaxP4Aqmjk1+CF VX4HdTY48fs8DxSpw3U8KL4SsB4sTwA= X-Rspamd-Queue-Id: 0EC054000D Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZKBe7wFX; dmarc=none; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: zst8o795siqe9ge9z1hhph811jpu371k X-HE-Tag: 1669846087-848586 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) --- 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 9ef65b383b40..b34d1695698a 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 */ -- 2.35.1