From patchwork Wed Jan 11 04:22:04 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: 13095981 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 9D86AC5479D for ; Wed, 11 Jan 2023 04:22:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C53568E000B; Tue, 10 Jan 2023 23:22:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 91C388E0007; 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 4B0F6900003; 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 1D8598E0008 for ; Tue, 10 Jan 2023 23:22:14 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id F1E5B14035C for ; Wed, 11 Jan 2023 04:22:13 +0000 (UTC) X-FDA: 80341220946.20.6114B88 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 8558940008 for ; Wed, 11 Jan 2023 04:22:11 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZDskqu3z; 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; 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=XRtyI2AR8pOTz2SSpH+3UHWp1L/rvdwrom4dzGOvnRw=; b=hiia9V63oNO6lcGZvq83yjKtYLzfhhuU3E2jkqUz9o9DI3jZmabEKg2MF/AuS5Wu46JVIL UeKwOBiSFM5pCaUGkfccyKZCpwqQBt9boVkutKvpE9cwJlXGZok2Z8gTyFKCOziXrqCz32 irmoAO7ec6Ho9KqPe+owIJjFqFKhX2E= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZDskqu3z; 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; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673410932; a=rsa-sha256; cv=none; b=fYG8lSqOCOCUi4J+JX8Ed/PxDyQ17khb+FaDoddK0qk5FxoNMaOTVMIMBfNC54mTnwapoS Jtbof9EiJKbgrqJQjUCyW8mly3xUzRYLxyrA0dFYluqWlXSPdqjl4P7i8OKEz+kZvoYWC7 w81ic9xZ84qukZxctF2Q27fEFrRTU0I= 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=XRtyI2AR8pOTz2SSpH+3UHWp1L/rvdwrom4dzGOvnRw=; b=ZDskqu3zfZn3VgAYmF+JbJqtI0 94mnjg38S92TQGUUiTpG6inMfSkjNqVAYKkDQFrzJ12zJzn0vG9MwI0hHaeBDxqXozHbbv5AZmy5S 8t8LjVDAc47qXM2Oh9QcKYFLG7P7pfNKPf+tVtYEmjRQA07lzx1C9GIq+KAV7jOPScMWkIpwPLFSb y1Zq7qKFlnZbZVZYROP3p1pgntgjy9D3eYUIDrZutNjHBMuP3lkupvE2LdqnxMMkQ1ymOXXXryMIV LkTVYeU7lbllQf2h9b9+j9+Uhp7Zup2SF5Ymr70IFQIMBhK4amiHpj6qDPsm+Pl6HfGFDeHK6o5Hh 0jqE3kPQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFScz-003nyE-Eq; 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 16/26] page_pool: Use netmem in page_pool_drain_frag() Date: Wed, 11 Jan 2023 04:22:04 +0000 Message-Id: <20230111042214.907030-17-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: 8558940008 X-Stat-Signature: c85stjkn9d4t16bj73zkuukh4c5hyu6t X-Rspam-User: X-HE-Tag: 1673410931-313767 X-HE-Meta: U2FsdGVkX197E3pX2QSMJ8g+k0OKfyWsrnuoYH8B64BTjBywrjQAYuzc5vTf+2ehpsy/8igtAmj2+CJZa2vmC9plMUSfjo+s2B2Vu31zZbWXNNAahHoBIqYi5Dr+d1n00J+2kwqTT18IUsIe9a3j5aacA/oUEN7RgPbC2Ee29jdeTcB9wErPQZL1bfxxckcr6A1eeYpWmvGh8FVHf4gbnl8g4KdAdXsSj8i29WtmeF1JpzqNj1yRMcUvPWglPSsFj6zSNQxQfWB/gzOBREcjZKvT7C9P1wawFWdGn9HncENeEJP/Z164ruP4dmuOTxlXwg25a3A8vp8F6hjA5SlbGBy/dqz5xmRd2NRWeZ5oxOlLsP6gUbemGQpGhc5sR6UYw4SOMVnD6mQY2AOYgnqLC4JQw+XXjqU+jzCFJWJEYz0zcLQQJeb2FQ1KZAWO6NZi7rjrR0Uk63fzsH4O9EBicQ59hEQ/UH6wbtoNlDyU+VS4UqD4tjjw++bKaM753VNCWs7pIWeexiAu1y9MFJtdsENF8jReD4RF/5lL/lFwiDVjCgh6uL1LpT6EKa+tkck87zolYOcR/qhv1u8KFYXPUbNLp06/oeChGq+Hrx6kSeDSkZd+0uhnCkY7sv+8x7WEGLKc6uOYfR4k4+UAiuaXpolLoQOVNo/kgxInZ+CUGHrbjJNb1KZYM8edQcYzkLxkqf3ZxJxwFkHpaBkMg2FGWV2RBVvojnLhBP6/Qoo2YthBo+OKJ6tsd4995BodrZu8VZj67T5aJfWv8g3uSaCvzCT8hlO542Zo9nzT21eRXOg/hQYDGR6h3hH0L2Jl9D1cLG/mhhHxTLB+Co8jmHcSW5KJLQgmgpBVXRWjoXX6sE4cWtqV4dy8qB70T1eSKrc3jryWD0VckOCEY3IcxpeqJPb1foTDiRLpIzDdXIWgEyPoXuJaAn7PHw== 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: We're not quite ready to change the API of page_pool_drain_frag(), but we can remove the use of several wrappers by using the netmem throughout. 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 c495e3a16e83..cd469a9970e7 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -672,17 +672,17 @@ static struct page *page_pool_drain_frag(struct page_pool *pool, long drain_count = BIAS_MAX - pool->frag_users; /* Some user is still using the page frag */ - if (likely(page_pool_defrag_page(page, drain_count))) + if (likely(page_pool_defrag_netmem(nmem, drain_count))) return NULL; - if (page_ref_count(page) == 1 && !page_is_pfmemalloc(page)) { + if (netmem_ref_count(nmem) == 1 && !netmem_is_pfmemalloc(nmem)) { if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV) page_pool_dma_sync_for_device(pool, nmem, -1); return page; } - page_pool_return_page(pool, page); + page_pool_return_netmem(pool, nmem); return NULL; }