From patchwork Wed Jan 11 04:21:59 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: 13095988 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 2804FC5479D for ; Wed, 11 Jan 2023 04:22:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2746900002; Tue, 10 Jan 2023 23:22:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A052B8E000C; Tue, 10 Jan 2023 23:22:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ECE58E0009; Tue, 10 Jan 2023 23:22:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2B31E8E0008 for ; Tue, 10 Jan 2023 23:22:15 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F14B340457 for ; Wed, 11 Jan 2023 04:22:14 +0000 (UTC) X-FDA: 80341220988.12.16A9578 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 829211C0009 for ; Wed, 11 Jan 2023 04:22:13 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EUgLfOht; dmarc=none; spf=none (imf21.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=1673410933; 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=rcz4ILIU0y+s+VzEhxoTryrk4XlkMDYpJ2m+mT7d/Ps=; b=Ket+8qfsTuKNufgETe4o4TfYz1T2rI+liBdtIVRcNUaZqROTa+X7JM2yUQ/9iGhwBkrlC4 PDw5Bug5NWRCraCluoZQd8ZRuO40NKtDfbzXbFJ2sJiRcKmkpLhO9z33ECwsRnklHPHEoR 7ovMaXUeCdaKqvV7KR/oFwKGPEbZ5MI= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EUgLfOht; dmarc=none; spf=none (imf21.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=1673410933; a=rsa-sha256; cv=none; b=qvz2X38irP7Anqn/15lQRTev4aifBtlWX8pkhlL3Q9wo79+PWIsipttssUjReo0JFf7bRs ZV5xbV2U1T0lz2X3wQk0Ndgm7IzxvvQcakvLkkT4kEakE2gcgbTvCKTxAZRm7MhjLD0n/e H+8d1mDJafy72xn9z5jU+byPa5WNCVs= 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=rcz4ILIU0y+s+VzEhxoTryrk4XlkMDYpJ2m+mT7d/Ps=; b=EUgLfOhtF2Ji1vKd2kCpKbkGL8 LsLmFriJbXWCq8uAJGKzj7c3sod/O5HFYHMvO6WAvZn3T1wc4KAs+XbM6gZrxv1t8cQVcV+6K1Wes 9hNEDSCSFDvY4td4q3imcYF9Yy58ZUd3ODMJu4dDSGecxLl6BX9CHuBFoVe/Sp14xrYrfkORLvKav XBQNfLe2qUNtETVU/GkBQSpQ2zNxt0r+0FT3s7sc1kO1mwzv8XrLeFsTAXqtdptoRl0WPWEnbI0eN v0JS4BtcZ1Mz32S9AyNwzvoPDLlboEnpirvMCzt/SmOD/xKVA3XDT+5GvdvMttalJku8ZE2C4rF3O 6vVUUX6A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFScz-003ny2-1J; 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 11/26] page_pool: Convert page_pool_empty_ring() to use netmem Date: Wed, 11 Jan 2023 04:21:59 +0000 Message-Id: <20230111042214.907030-12-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-Queue-Id: 829211C0009 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: c98f41neaf5g7jdqgb7s6brybc1aecyu X-HE-Tag: 1673410933-917228 X-HE-Meta: U2FsdGVkX1/d4ZlC2ufL1L6baG56E7OuVAhEvywmbQc+LUR6ztbi/Q00ZaWZ4B7hSN/V8gGwDhlai7rYRO1hW+MgimLI2QTCUSCbCEwsd1BzQYAF8M+IBGvvUdSrIdg2OyXGEtFV6EbT7cUjEbDm2+jTcwC4H07mqCYCL58BwYm8LYOH/FRahh8zpyhfcwHzl2gOAqH2+aGTz7KIrsvMin+AZAzbdpNuGqX2J+uBiGOZ4Bg2Z1qayr+eb0lgXeVfkmzzHTjDC3Yh6PDKyD4hW6AXreuBcVJ3mXvPIzj5tON7sfD2e1/cdcAmKx2R1xcuvju5mgi4+7XTLYB0lRYf/uwnCGz04l/I3dKMfbyNoEvflTnU9iZ56tVgYknU0Q3YLTQ2iZXpB0asjKt9y2ZaeUxZnN7liqcBSzxlP9q4mmMXVeMPDqoMa2Wajh9YgMjsC+OjiLqgxmBK8JM/4N8a3/r+n+NQcA8bksL57CYpD/1eLZ5EGNeB0rwRcTCtophYiCc5zSuci/Ows+KQ977HykYqR3ihzIDof4uReOoiLlfCr3789GV8VyR4lYorhYPDROXsLHSgAEzwC2k3QNpfv5ioDTz5Om64OxCBpYAZ/O3YCHfP4qZYZw7eAkpBNAwU1AiENtld3wTOzYUQwjRuoWINulFYPI66Hmfi57Nps+0zlnOUaTYfhCspotZZuBxF+2kHaZ+6KINULTKLpWKtsu3qwbVaM4AinSd7AMFxAK0jlNc9bIR2xQiKBzAGGpeUXrSftFyLD08P4fUYX6IbolHq3RGiSIXaSQeevkwvXsU9qOHyvlTQCSimJM6idx+XG88KfrnupJfHk6agZyjYxRC7mXb/ofWHhWUR+OeGLV1TbPH2a06rcKLAITYq/S2vkmr68UsRFZrb+y6gokCgUmFg7D5CwQpzXDWC2DMKmpycxVkSbfjh7g== 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: Retrieve a netmem from the ptr_ring instead of a page. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Reviewed-by: Jesse Brandeburg --- net/core/page_pool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index e727a74504c2..0212244e07e7 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -755,16 +755,16 @@ EXPORT_SYMBOL(page_pool_alloc_frag); static void page_pool_empty_ring(struct page_pool *pool) { - struct page *page; + struct netmem *nmem; /* Empty recycle ring */ - while ((page = ptr_ring_consume_bh(&pool->ring))) { + while ((nmem = ptr_ring_consume_bh(&pool->ring)) != NULL) { /* Verify the refcnt invariant of cached pages */ - if (!(page_ref_count(page) == 1)) + if (netmem_ref_count(nmem) != 1) pr_crit("%s() page_pool refcnt %d violation\n", - __func__, page_ref_count(page)); + __func__, netmem_ref_count(nmem)); - page_pool_return_page(pool, page); + page_pool_return_netmem(pool, nmem); } }