All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Manish Chopra <manishc@marvell.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Edward Cree <ecree.xilinx@gmail.com>,
	Sudarsana Kalluru <skalluru@marvell.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-net-drivers@amd.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] bnx2x: use kzalloc() to allocate mac filtering list
Date: Thu, 2 Jul 2026 17:35:34 +0300	[thread overview]
Message-ID: <akZ3NuRLZ4YjFGGv@kernel.org> (raw)
In-Reply-To: <02237688-9532-4fd0-8494-a7bb524ca4f2@intel.com>

On Thu, Jul 02, 2026 at 03:52:13PM +0200, Przemek Kitszel wrote:
> 
> > @@ -2713,8 +2714,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
> >   				total_elems = BNX2X_MCAST_BINS_NUM;
> >   		}
> >   		while (total_elems > 0) {
> > -			elem_group = (struct bnx2x_mcast_elem_group *)
> > -				     __get_free_page(GFP_ATOMIC | __GFP_ZERO);
> > +			elem_group = kzalloc(PAGE_SIZE, GFP_ATOMIC);
> 
> what is the current rule of thumb for kzalloc vs kvzalloc size under
> GFP_ATOMIC?

kvzalloc() with GFP_ATOMIC is kzalloc():

	/*
	 * vmalloc uses GFP_KERNEL for some internal allocations (e.g page tables)
	 * so the given set of flags has to be compatible.
	 */
	if ((flags & GFP_KERNEL) != GFP_KERNEL)
		return kmalloc_node(size, flags, node);

so it's only physically contiguous allocations.

 
> >   			if (!elem_group) {
> >   				bnx2x_free_groups(&new_cmd->group_head);
> >   				kfree(new_cmd);
> > 
> 

-- 
Sincerely yours,
Mike.

WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@kernel.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Manish Chopra <manishc@marvell.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Edward Cree <ecree.xilinx@gmail.com>,
	Sudarsana Kalluru <skalluru@marvell.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-net-drivers@amd.com,
	netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH 1/4] bnx2x: use kzalloc() to allocate mac filtering list
Date: Thu, 2 Jul 2026 17:35:34 +0300	[thread overview]
Message-ID: <akZ3NuRLZ4YjFGGv@kernel.org> (raw)
In-Reply-To: <02237688-9532-4fd0-8494-a7bb524ca4f2@intel.com>

On Thu, Jul 02, 2026 at 03:52:13PM +0200, Przemek Kitszel wrote:
> 
> > @@ -2713,8 +2714,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
> >   				total_elems = BNX2X_MCAST_BINS_NUM;
> >   		}
> >   		while (total_elems > 0) {
> > -			elem_group = (struct bnx2x_mcast_elem_group *)
> > -				     __get_free_page(GFP_ATOMIC | __GFP_ZERO);
> > +			elem_group = kzalloc(PAGE_SIZE, GFP_ATOMIC);
> 
> what is the current rule of thumb for kzalloc vs kvzalloc size under
> GFP_ATOMIC?

kvzalloc() with GFP_ATOMIC is kzalloc():

	/*
	 * vmalloc uses GFP_KERNEL for some internal allocations (e.g page tables)
	 * so the given set of flags has to be compatible.
	 */
	if ((flags & GFP_KERNEL) != GFP_KERNEL)
		return kmalloc_node(size, flags, node);

so it's only physically contiguous allocations.

 
> >   			if (!elem_group) {
> >   				bnx2x_free_groups(&new_cmd->group_head);
> >   				kfree(new_cmd);
> > 
> 

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2026-07-02 14:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 13:57 [PATCH 0/4] drivers/net/ethernet: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
2026-07-01 13:57 ` [Intel-wired-lan] " Mike Rapoport (Microsoft)
2026-07-01 13:57 ` [PATCH 1/4] bnx2x: use kzalloc() to allocate mac filtering list Mike Rapoport (Microsoft)
2026-07-01 13:57   ` [Intel-wired-lan] " Mike Rapoport (Microsoft)
2026-07-02 13:52   ` Przemek Kitszel
2026-07-02 13:52     ` Przemek Kitszel
2026-07-02 14:35     ` Mike Rapoport [this message]
2026-07-02 14:35       ` [Intel-wired-lan] " Mike Rapoport
2026-07-01 13:57 ` [PATCH 2/4] ice: use kzalloc() to allocate staging buffer for reading from GNSS Mike Rapoport (Microsoft)
2026-07-01 13:57   ` [Intel-wired-lan] " Mike Rapoport (Microsoft)
2026-07-02 13:49   ` Przemek Kitszel
2026-07-02 13:49     ` Przemek Kitszel
2026-07-02 14:40     ` Mike Rapoport
2026-07-02 14:40       ` [Intel-wired-lan] " Mike Rapoport
2026-07-03  9:34       ` Przemek Kitszel
2026-07-01 13:57 ` [PATCH 3/4] sfc/siena: use kmalloc() to allocate logging buffer Mike Rapoport (Microsoft)
2026-07-01 13:57   ` [Intel-wired-lan] " Mike Rapoport (Microsoft)
2026-07-01 17:01   ` Edward Cree
2026-07-01 17:01     ` [Intel-wired-lan] " Edward Cree
2026-07-01 13:57 ` [Intel-wired-lan] [PATCH 4/4] sfc: " Mike Rapoport (Microsoft)
2026-07-01 13:57   ` Mike Rapoport (Microsoft)
2026-07-01 16:59   ` Edward Cree
2026-07-01 16:59     ` [Intel-wired-lan] " Edward Cree

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=akZ3NuRLZ4YjFGGv@kernel.org \
    --to=rppt@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-net-drivers@amd.com \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=skalluru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.