From patchwork Thu Jan 5 21:46:23 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: 13090546 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 A132CC3DA7A for ; Thu, 5 Jan 2023 21:46:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49DFD8E0009; Thu, 5 Jan 2023 16:46:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EE588E0008; Thu, 5 Jan 2023 16:46:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FD3E8E0003; Thu, 5 Jan 2023 16:46:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 62BA38E0001 for ; Thu, 5 Jan 2023 16:46:34 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 34AFA40B7B for ; Thu, 5 Jan 2023 21:46:34 +0000 (UTC) X-FDA: 80322079908.10.9882892 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 08C9440010 for ; Thu, 5 Jan 2023 21:46:30 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Mo74Isxg; 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=1672955192; 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=NvXYimBhkC9d0f/zXB3DUmNEVicwJZ07XethqUojHGM=; b=gI7fkVWUp832NZQmCstqlfJAi3DPVIlDWLOb4q6zE3HkulrERZ5STsIJKrxV/Z9fRZTC2F ysLDLQ/ZBuE2NAgbpiDN5B3zLBFFr7NOi0NraFfsArwIu+1BayZLuK1QQXwU9BmoUgGEYI vWfxWBfpa8PG8OMkN/EFanrxaIISXkU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Mo74Isxg; 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=1672955192; a=rsa-sha256; cv=none; b=AiXu9C7sEAElJ1jtatdIJSkKPDvAqB1W/OFm4yb38BglgYV5UG9FqBoVmQz2Q9swBPHPVC 3NvIn8a11luw7khRuQwPDuNYVpKIR7++77FvDfR53/ct6Y/Lj8mH10gPOZf4xgKXNShXaG 9mS7doo4Y3eF7LvEiyl07MHoJfFeLiw= 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=NvXYimBhkC9d0f/zXB3DUmNEVicwJZ07XethqUojHGM=; b=Mo74Isxg6Sr4vltDjX+oAMDu17 H1OVN76kk1HywCbMBHQflKlZsd+tUK4n/HqaF/M9lPHOkTN+8C/TZz5dZF5MTR9MgYetwAN66rCpm pb+VgH7d2XmUpG+43YCbBpbMFI6AQ5lb+IjGdUFxrhfroGpJT4Q3TAPp8nhtDCFdILRC0/Jm6fvUY OPUrxv5D5ERSLg7zZKYAf+FhYnhVwhrbDBEabzmubIgf71OkWALdIEua2sdwgbky2ySCng5KX6dnl vJezFvIqgSnKJ1hNdZmvjeS478Gz6VwoWsa5qAXAetAPaR7834+TSyGohv7bDpeKqgMXUVBLwh4km gB/Q8YlQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDY4I-00GWnt-Q5; Thu, 05 Jan 2023 21:46:34 +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 Subject: [PATCH v2 16/24] page_pool: Use netmem in page_pool_drain_frag() Date: Thu, 5 Jan 2023 21:46:23 +0000 Message-Id: <20230105214631.3939268-17-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230105214631.3939268-1-willy@infradead.org> References: <20230105214631.3939268-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 08C9440010 X-Stat-Signature: 85ptkjywmwdoj5t97mx73fcfu94c8cra X-HE-Tag: 1672955190-354207 X-HE-Meta: U2FsdGVkX1/1On72pF/gnrTrsdAi7Gz8RziY29AQDg6Sooa25XwYtRkbXi2sosWjc19tZKGWRCnOE2BCOZauLcB6FyCRuwL1A42nVG6Ty7VhC4byRANcdHRCX4lHBju8tn5yFYaR82r2/KSyLYcqhjORA7Fx5s2r+lYb85EaqyqzzLwq0KfbiyWvUAwAkctYAlhOMXzoajHPvQdMBup58neQu3hUNR8v/1BFlcy3krtZ/lPD0A75fyXzlc/LOL9LGlSwOoJT8rFsc4CibHtxZb5iIqHSXwcGFhfNrIxQWZZvVxDOXra3DURo1wiHYKpfsacgwXePO9lf+h+mVKQhfAlf6PYKtDj7wotVWLRi13UlRML5+OlgYnioLSHYDf3a3uYn8FGGq92pO6Mgw6EqAFpZ6HyabVNfngdN9EgKhB+AKc7qilygAOO3mluSS6asKC9hAgxmgl4ee8lKLWLcUZtm+OGG6LGGyd2z4LciCYx6Cieyyle0H2RQrwfHtgSe6t4h+KSVNbhF0VzOTA9HuBkB6GemXrzEoVhNl/4M45O+WbxYLhvdfPiQRITuq8aSFQLioesoPjj18DWV4izlEYjj2WnxYMQ7VJhj+kuDnz8qHh0fPMEPEJA2dCeVVVaeehBvC2/rolLPLMznH2gIXZlKVYGCqLpdzmbRxGGbBTVFgcys85Ig73qFHnFdDm4HLKNlVYDW/dAqkOWm4jvtd5wcF1fdxvoUWzSNZm8yAqDzwEESEoGyUVIgaUHitOp+R3jL6z5DeieUvCSa0diUoCSekvKmEEcO7EGhR2VMV/WE+UfNIO5Db0C4/ZPmW2DQjb1RaqPfVEa00aaXvIS0JBfxMhTUR4Eh3HDnhbfp/8HXAG4Gdvx4rgQzuH6kI6XP3G3ZxBI7IBHAppzB36J0xRT6YHMorj6mgNVvyXoBje7VibnGJHCL6Q== 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 --- 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; }