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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67BA2C43327 for ; Tue, 30 Jun 2026 11:00:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 59D9D6B00D9; Tue, 30 Jun 2026 07:00:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 574E36B00DB; Tue, 30 Jun 2026 07:00:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B3226B00DC; Tue, 30 Jun 2026 07:00:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1D2456B00D9 for ; Tue, 30 Jun 2026 07:00:06 -0400 (EDT) Received: from smtpin15.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8372616806A for ; Tue, 30 Jun 2026 11:00:05 +0000 (UTC) X-FDA: 84936284370.15.5E75111 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf04.hostedemail.com (Postfix) with ESMTP id C0B9140004 for ; Tue, 30 Jun 2026 11:00:03 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=ZMVGaWI9; spf=pass (imf04.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1782817203; b=5gKRISWZGqU8UIgCH0QGfzmU1W+OulU42qDYS8GrMXF89rA1Y02Jjuker0a0vCWczBg7ej TaRMuj2d45kUkHhUNWKWVWI7cxNTJT39cReGgobYK5+98RKFWQpNOd0SJgl3n8Ey+crNh1 LZhcRBrdzOjkn+c10fM4X59VLzavSrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1782817203; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qVNG6A0QrvVc3Q5VGETu2ZNN6OFwwV/HGShrasBWJk4=; b=jAk5K5wS2Yoqk7jpUb0gcq/6EatBzzqjB40Ac+0hvWjI0GVYD+n/79S7Up8tUStbYQW7NR ++csL6ac4J5p7NfdcgNZg93eQwHP5nCRF5KSUzrMMy/0/8GofMOFoma1vb0LhH69Xxf8mv Yx4GILsspKilPSOFONlxyxYZNcKebrM= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=ZMVGaWI9; spf=pass (imf04.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1412840E06; Tue, 30 Jun 2026 11:00:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A1A51F000E9; Tue, 30 Jun 2026 10:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782817203; bh=qVNG6A0QrvVc3Q5VGETu2ZNN6OFwwV/HGShrasBWJk4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ZMVGaWI9VL4Ex4gSsvHRdpL8r28sBJeHwMEuL7+lauPlew2FTdOEsgs2ATl1+atca 5LYGcr4dixAyl65dQrx1zaB/Glfflj9NCXAqVLtCfj8sE2er5nqspknawJYfva0Chv vKRhkeVapVUnpfeuyh4J75IHXPeUUpy5UPveQh5Llp1phBnJX8oYOScCnmkcIBSI6q EkJvpcSINDcZQKSJ/otkSjIulmeOQfuTzYU9nqou8/TxgPQebt/GjHstOjzw9cPTO7 WUMbUxdHMl15cDSi+gs3tI/IEI0Ne+cwtcQB5Ilb6oLY2SCNlfdksJjYyFL7tCxlDT rQgDawk1deirQ== From: "Mike Rapoport (Microsoft)" Date: Tue, 30 Jun 2026 13:59:26 +0300 Subject: [PATCH net-next 7/8] sfc: use kmalloc() to allocate logging buffer MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260630-b4-drivers-net-v1-7-672162a91f37@kernel.org> References: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> In-Reply-To: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Brian Norris , Edward Cree , Francesco Dolcini , Manish Chopra , Mike Rapoport , Przemek Kitszel , Sudarsana Kalluru , Tony Nguyen , b43-dev@lists.infradead.org, intel-wired-lan@lists.osuosl.org, libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-net-drivers@amd.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.15.2 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C0B9140004 X-Stat-Signature: 8p4ksw715sjm7ma89ceggx71s6gky4pd X-HE-Tag: 1782817203-680140 X-HE-Meta: U2FsdGVkX1/wP0mgfZGBprRROdpTOuQWUfql1CkJDxX20Sz1wq8oar8qpMcN2pocrOnPfMvjC9hlk4ixPtMC4RkK78lXVkUkKb8nI8Cijngtgh05fIw68x6fUqdb/KuS3lXEtG3nVWE+OgXgyLuFPBMyzltkec6OZLvJA6oNgXrDi1ydFiUEQg02euSOeD1asBz1XpKYqqQdOnqdAPpEnPlaM67GqjWZikxwk1Oy9eYBET2tk71b0dZjuxOLr+znINheXvOiG8qdJ7ay1W7wMtEdNlr+hwb1MJj1jXG6SmtdtKaWi6Ttv4ewdRwhoIaEPAE8FPpkJfU1UTqpp8KOaBHyjFbU5ePJtLV7UQ19g3zVKnEmVyl2gYws2/VBM72bL9h62iv7JsiY1MWGksWeDcer54hz8V7rY9ViAC8molLelT/JsxnWkgBIY59Hrs9EEkw2IKUfRVrs8IrLyU5uyJ0D5zPzff3NyHSAHA57TspSifJ/d7ZXMa+E4rr48ZsAsMeXV0nLmSz8qXveMUx1fkGeeBRViAbDEeu2fkom1MP4kbauHLadGoclCD97YXJdcTLen6Vdpy3ZV9Eg4bqsNeFmiWdp63daodgx01MSMxrP8f7jmuntFXAr2dcbycpgHQph63nAwMG6Pb86O6ysGDE9qP5Vp+9bxoygyblWBt5O4G7OYy3fN1gH5RUeOn2gMxDj9YIgWEoC7H0bvHf9Ta+iKzU2e2DWBhecJLAXzrCYIjKQghfHVBBNLU4TCSgStm8DX8U5+zKvdJ+wXljr2VanST1+vDsu5PnEiMacbt/Cv5LGcYQmVIZLT5cKEiD85x81f64hv4JuThdKxsZVv3RrFipmMrJ3dOLEdhCQRWtGaVdYYKXRTSEAgfOPqcCOmB0Es0+5B/+eDuurURjsUygnECdfEfzyAJP/NS0oGH3YAnq8OrZY2BkyGLJwIAZ5wIQcDSJwh6CmerR/9mr dXIGRVeP MGxTeHfYS7hNuUBe4OFakUy522JJVZxVflxHPuq+ErqMXt6HmkCMnCmMWpyzbCc47Uq07lBOYaALagu8LW5oF9l9ncDBG8VPWR5XVuUvoTDf+rFNqv0KsdExKyF7oZpAYjNxjSa2rGja9sYhiSXOt694cUZW7Y/Vq0ui9uqCMrmyskRL95VWl3M0M28P2WSonOY/zAWrHBtf7y8cx8r988tO49rPeQRfjPkxMnAqEfxhssJAQJVyMRVX/j1vwrlsTWYEUtUm36gG5hEQGMIKJzXjSy+M8F26Bir852xQu0mk6l48iK4bf1urcDfXPnJBebe+IG54Djj3TzAJgG+EOf/1efEmHHhiDPpfzsxNz5M31a+uHkkG529Hf63Oiwf52eT32 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: efx_mcdi_init() allocates a logging buffer for MCDI firmware communication diagnostics. This buffer can be allocated with kmalloc() as there's nothing special about it to go directly to the page allocator. kmalloc() provides a better API that does not require ugly casts and kfree() does not need to know the size of the freed object. Performance difference between kmalloc() and __get_free_pages() is not measurable as both allocators take an object/page from a per-CPU list for fast path allocations. For the slow path the performance is anyway determined by the amount of reclaim involved rather than by what allocator is used. Replace use of __get_free_page() with kmalloc() and free_page() with kfree(). Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Signed-off-by: Mike Rapoport (Microsoft) --- drivers/net/ethernet/sfc/mcdi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index e65db9b70724..b806d3d90c42 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "net_driver.h" #include "nic.h" #include "io.h" @@ -71,7 +72,7 @@ int efx_mcdi_init(struct efx_nic *efx) mcdi->efx = efx; #ifdef CONFIG_SFC_MCDI_LOGGING /* consuming code assumes buffer is page-sized */ - mcdi->logging_buffer = (char *)__get_free_page(GFP_KERNEL); + mcdi->logging_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!mcdi->logging_buffer) goto fail1; mcdi->logging_enabled = mcdi_logging_default; @@ -112,7 +113,7 @@ int efx_mcdi_init(struct efx_nic *efx) return 0; fail2: #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)mcdi->logging_buffer); + kfree(mcdi->logging_buffer); fail1: #endif kfree(efx->mcdi); @@ -138,7 +139,7 @@ void efx_mcdi_fini(struct efx_nic *efx) return; #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)efx->mcdi->iface.logging_buffer); + kfree(efx->mcdi->iface.logging_buffer); #endif kfree(efx->mcdi); -- 2.53.0 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1416C43458 for ; Tue, 30 Jun 2026 11:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=51VgQYHeQf0Zn7dmgEzlzJa9Re3MwyJ2/rq7t+UiUgc=; b=zQATKEmIU7UnD+ PbclIa2eywRKh6KCJj10Lthx2e4t1t8Fy+mQQxmCH6kzeHniro8jmVyeK5VRfdY8UJTGKQjlxCqIG tWjMqCzZ5lUBhv8Fhr1NytlOYfWHPsvxPy9JZ7HL8tOXfsFfO67tFofNYDSs80ddXQLxngyo+7ZYp giwAXyttMOfDSJTN05/Io1FqLfANvqr9/n8xO1MBmWVDwaRGlyXKUruo0HTH+2LnXMR0PCMZtnCmv ODH0MpPd2AnieKHs/3gezzylmV7f/df7XRB/37Bpg0d6LGkLA0NImkesT+95KFVCDbsbZNwQ6xXFz PImEl0XdMOVUFXD93F3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weWCD-0000000Gkli-2kqL; Tue, 30 Jun 2026 11:00:05 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1weWCB-0000000Gkhg-1HpD; Tue, 30 Jun 2026 11:00:03 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1412840E06; Tue, 30 Jun 2026 11:00:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A1A51F000E9; Tue, 30 Jun 2026 10:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782817203; bh=qVNG6A0QrvVc3Q5VGETu2ZNN6OFwwV/HGShrasBWJk4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ZMVGaWI9VL4Ex4gSsvHRdpL8r28sBJeHwMEuL7+lauPlew2FTdOEsgs2ATl1+atca 5LYGcr4dixAyl65dQrx1zaB/Glfflj9NCXAqVLtCfj8sE2er5nqspknawJYfva0Chv vKRhkeVapVUnpfeuyh4J75IHXPeUUpy5UPveQh5Llp1phBnJX8oYOScCnmkcIBSI6q EkJvpcSINDcZQKSJ/otkSjIulmeOQfuTzYU9nqou8/TxgPQebt/GjHstOjzw9cPTO7 WUMbUxdHMl15cDSi+gs3tI/IEI0Ne+cwtcQB5Ilb6oLY2SCNlfdksJjYyFL7tCxlDT rQgDawk1deirQ== From: "Mike Rapoport (Microsoft)" Date: Tue, 30 Jun 2026 13:59:26 +0300 Subject: [PATCH net-next 7/8] sfc: use kmalloc() to allocate logging buffer MIME-Version: 1.0 Message-Id: <20260630-b4-drivers-net-v1-7-672162a91f37@kernel.org> References: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> In-Reply-To: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Brian Norris , Edward Cree , Francesco Dolcini , Manish Chopra , Mike Rapoport , Przemek Kitszel , Sudarsana Kalluru , Tony Nguyen , b43-dev@lists.infradead.org, intel-wired-lan@lists.osuosl.org, libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-net-drivers@amd.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.15.2 X-BeenThere: b43-dev@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: b43/b43legacy Linux driver discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "b43-dev" Errors-To: b43-dev-bounces+b43-dev=archiver.kernel.org@lists.infradead.org efx_mcdi_init() allocates a logging buffer for MCDI firmware communication diagnostics. This buffer can be allocated with kmalloc() as there's nothing special about it to go directly to the page allocator. kmalloc() provides a better API that does not require ugly casts and kfree() does not need to know the size of the freed object. Performance difference between kmalloc() and __get_free_pages() is not measurable as both allocators take an object/page from a per-CPU list for fast path allocations. For the slow path the performance is anyway determined by the amount of reclaim involved rather than by what allocator is used. Replace use of __get_free_page() with kmalloc() and free_page() with kfree(). Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Signed-off-by: Mike Rapoport (Microsoft) --- drivers/net/ethernet/sfc/mcdi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index e65db9b70724..b806d3d90c42 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "net_driver.h" #include "nic.h" #include "io.h" @@ -71,7 +72,7 @@ int efx_mcdi_init(struct efx_nic *efx) mcdi->efx = efx; #ifdef CONFIG_SFC_MCDI_LOGGING /* consuming code assumes buffer is page-sized */ - mcdi->logging_buffer = (char *)__get_free_page(GFP_KERNEL); + mcdi->logging_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!mcdi->logging_buffer) goto fail1; mcdi->logging_enabled = mcdi_logging_default; @@ -112,7 +113,7 @@ int efx_mcdi_init(struct efx_nic *efx) return 0; fail2: #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)mcdi->logging_buffer); + kfree(mcdi->logging_buffer); fail1: #endif kfree(efx->mcdi); @@ -138,7 +139,7 @@ void efx_mcdi_fini(struct efx_nic *efx) return; #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)efx->mcdi->iface.logging_buffer); + kfree(efx->mcdi->iface.logging_buffer); #endif kfree(efx->mcdi); -- 2.53.0 _______________________________________________ b43-dev mailing list b43-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/b43-dev 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDD99C44503 for ; Tue, 30 Jun 2026 15:19:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A4A3161064; Tue, 30 Jun 2026 15:19:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PZdkk2H0Cg2S; Tue, 30 Jun 2026 15:19:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org CF1716107A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1782832753; bh=qVNG6A0QrvVc3Q5VGETu2ZNN6OFwwV/HGShrasBWJk4=; h=From:Date:References:In-Reply-To:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=4vkOpdEppXI53ctRGw6/3YpM1R/CE5kS1taNfgNsLaMKakZ8yzTqwsQjhc8u7QlAk D76xGY3CXxfqVbDHRqcHmBKBVPCl8DlavSGn5lC4++s4XcyW6OVfVERErD4O0PDni8 I3hELKK7dYKaP/3jlDmqr5YJWoKcPNtxD7gweIAU2AuPS4vsf4NW+k7SvmMBtoJ5Xl BmQWQ4bKQKJIc0AKFwwRBIaGliosR18mDNh02BCCfQA1xn1dqJqzm2b5g56tkjViDW IFXCgBEZ76vxa5CouZ9IND2A6kRwMc995NxSxZwZ7B7VrmvthMyLb/jj3/XoZaYX+V nokEV3x5hZlCw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id CF1716107A; Tue, 30 Jun 2026 15:19:13 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id D1EB21338 for ; Tue, 30 Jun 2026 11:00:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id CF56C40FAF for ; Tue, 30 Jun 2026 11:00:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VYk5fIu_P3eB for ; Tue, 30 Jun 2026 11:00:04 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.252.31; helo=sea.source.kernel.org; envelope-from=rppt@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org E4DCD40207 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E4DCD40207 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by smtp2.osuosl.org (Postfix) with ESMTPS id E4DCD40207 for ; Tue, 30 Jun 2026 11:00:03 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1412840E06; Tue, 30 Jun 2026 11:00:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A1A51F000E9; Tue, 30 Jun 2026 10:59:58 +0000 (UTC) From: "Mike Rapoport (Microsoft)" Date: Tue, 30 Jun 2026 13:59:26 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260630-b4-drivers-net-v1-7-672162a91f37@kernel.org> References: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> In-Reply-To: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Brian Norris , Edward Cree , Francesco Dolcini , Manish Chopra , Mike Rapoport , Przemek Kitszel , Sudarsana Kalluru , Tony Nguyen , b43-dev@lists.infradead.org, intel-wired-lan@lists.osuosl.org, libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-net-drivers@amd.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.15.2 X-Mailman-Approved-At: Tue, 30 Jun 2026 15:19:08 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782817203; bh=qVNG6A0QrvVc3Q5VGETu2ZNN6OFwwV/HGShrasBWJk4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ZMVGaWI9VL4Ex4gSsvHRdpL8r28sBJeHwMEuL7+lauPlew2FTdOEsgs2ATl1+atca 5LYGcr4dixAyl65dQrx1zaB/Glfflj9NCXAqVLtCfj8sE2er5nqspknawJYfva0Chv vKRhkeVapVUnpfeuyh4J75IHXPeUUpy5UPveQh5Llp1phBnJX8oYOScCnmkcIBSI6q EkJvpcSINDcZQKSJ/otkSjIulmeOQfuTzYU9nqou8/TxgPQebt/GjHstOjzw9cPTO7 WUMbUxdHMl15cDSi+gs3tI/IEI0Ne+cwtcQB5Ilb6oLY2SCNlfdksJjYyFL7tCxlDT rQgDawk1deirQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZMVGaWI9 Subject: [Intel-wired-lan] [PATCH net-next 7/8] sfc: use kmalloc() to allocate logging buffer X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" efx_mcdi_init() allocates a logging buffer for MCDI firmware communication diagnostics. This buffer can be allocated with kmalloc() as there's nothing special about it to go directly to the page allocator. kmalloc() provides a better API that does not require ugly casts and kfree() does not need to know the size of the freed object. Performance difference between kmalloc() and __get_free_pages() is not measurable as both allocators take an object/page from a per-CPU list for fast path allocations. For the slow path the performance is anyway determined by the amount of reclaim involved rather than by what allocator is used. Replace use of __get_free_page() with kmalloc() and free_page() with kfree(). Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Signed-off-by: Mike Rapoport (Microsoft) --- drivers/net/ethernet/sfc/mcdi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index e65db9b70724..b806d3d90c42 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "net_driver.h" #include "nic.h" #include "io.h" @@ -71,7 +72,7 @@ int efx_mcdi_init(struct efx_nic *efx) mcdi->efx = efx; #ifdef CONFIG_SFC_MCDI_LOGGING /* consuming code assumes buffer is page-sized */ - mcdi->logging_buffer = (char *)__get_free_page(GFP_KERNEL); + mcdi->logging_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!mcdi->logging_buffer) goto fail1; mcdi->logging_enabled = mcdi_logging_default; @@ -112,7 +113,7 @@ int efx_mcdi_init(struct efx_nic *efx) return 0; fail2: #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)mcdi->logging_buffer); + kfree(mcdi->logging_buffer); fail1: #endif kfree(efx->mcdi); @@ -138,7 +139,7 @@ void efx_mcdi_fini(struct efx_nic *efx) return; #ifdef CONFIG_SFC_MCDI_LOGGING - free_page((unsigned long)efx->mcdi->iface.logging_buffer); + kfree(efx->mcdi->iface.logging_buffer); #endif kfree(efx->mcdi); -- 2.53.0