From: "Li,Rongqing" <lirongqing@baidu.com>
To: Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
"oss-drivers@corigine.com" <oss-drivers@corigine.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [PATCH][net-next] nfp: flower: use GFP_KERNEL in idr_preload
Date: Thu, 5 Feb 2026 07:48:56 +0000 [thread overview]
Message-ID: <3a6e0cf4cd0e445ebd344537f80a1aff@baidu.com> (raw)
In-Reply-To: <20260205055933.3939-1-lirongqing@baidu.com>
>
> From: Li RongQing <lirongqing@baidu.com>
>
> idr_preload() is called in a sleepable context before acquiring a spinlock. Change
> the allocation flag from GFP_ATOMIC to GFP_KERNEL to allow direct reclaim
> and improve allocation success rate under memory pressure.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> drivers/net/ethernet/netronome/nfp/flower/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c
> b/drivers/net/ethernet/netronome/nfp/flower/main.c
> index 83eaa5a..8f232c6 100644
> --- a/drivers/net/ethernet/netronome/nfp/flower/main.c
> +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c
> @@ -63,7 +63,7 @@ nfp_flower_get_internal_port_id(struct nfp_app *app,
> struct net_device *netdev)
> if (id > 0)
> return id;
>
> - idr_preload(GFP_ATOMIC);
> + idr_preload(GFP_KERNEL);
> spin_lock_bh(&priv->internal_ports.lock);
> id = idr_alloc(&priv->internal_ports.port_ids, netdev,
> NFP_MIN_INT_PORT_ID, NFP_MAX_INT_PORT_ID,
> GFP_ATOMIC);
> --
> 2.9.4
Sorry, please drop this patch,;
nfp_flower_get_internal_port_id() maybe be called in system_highpri_wq workqueue, so GFP_ATOMIC is right
[Li,Rongqing]
prev parent reply other threads:[~2026-02-05 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 5:59 [PATCH][net-next] nfp: flower: use GFP_KERNEL in idr_preload lirongqing
2026-02-05 7:48 ` Li,Rongqing [this message]
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=3a6e0cf4cd0e445ebd344537f80a1aff@baidu.com \
--to=lirongqing@baidu.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox