Skip to contentSkip to conversation

vxlan: vnifilter: Use GFP_KERNEL instead of GFP_ATOMIC

PATCH Applied Ido Schimmel 5 participants 5 messages Aug 21, 2023 – Aug 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxlan: vnifilter: Use GFP_KERNEL instead of GFP_ATOMIC

The function is not called from an atomic context so use GFP_KERNEL instead of GFP_ATOMIC. The allocation of the per-CPU stats is already performed with GFP_KERNEL.

Tested using test_vxlan_vnifiltering.sh with CONFIG_DEBUG_ATOMIC_SLEEP.

---
 drivers/net/vxlan/vxlan_vnifilter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vxlan/vxlan_vnifilter.c +1 -1
index c3ff30ab782e..9c59d0bf8c3d 100644
@@ -696,7 +696,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan,
 {
 	struct vxlan_vni_node *vninode;
 
-	vninode = kzalloc(sizeof(*vninode), GFP_ATOMIC);
+	vninode = kzalloc(sizeof(*vninode), GFP_KERNEL);
 	if (!vninode)
 		return NULL;
 	vninode->stats = netdev_alloc_pcpu_stats(struct vxlan_vni_stats_pcpu);
Signature · 1 line
2.40.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ido Schimmel

The function is not called from an atomic context so use GFP_KERNEL instead of GFP_ATOMIC. The allocation of the per-CPU stats is already performed with GFP_KERNEL.

Tested using test_vxlan_vnifiltering.sh with CONFIG_DEBUG_ATOMIC_SLEEP.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Ido Schimmel
Quoted 8 lines · Ido Schimmel

The function is not called from an atomic context so use GFP_KERNEL instead of GFP_ATOMIC. The allocation of the per-CPU stats is already performed with GFP_KERNEL.

Tested using test_vxlan_vnifiltering.sh with CONFIG_DEBUG_ATOMIC_SLEEP.

Quoted 25 lines
---
 drivers/net/vxlan/vxlan_vnifilter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vxlan/vxlan_vnifilter.c +1 -1
index c3ff30ab782e..9c59d0bf8c3d 100644
@@ -696,7 +696,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct
 vxlan_dev *vxlan,
 {
        struct vxlan_vni_node *vninode;
 
-       vninode = kzalloc(sizeof(*vninode), GFP_ATOMIC);
+       vninode = kzalloc(sizeof(*vninode), GFP_KERNEL);
        if (!vninode)
                return NULL;
        vninode->stats = netdev_alloc_pcpu_stats(struct

vxlan_vni_stats_pcpu);
--
2.40.1

Signature · 2 lines
Regards,
Kalesh A P
Reviewed-by on v1 1/1
#3 lore raw
In reply to Ido Schimmel
Quoted 16 lines · Ido Schimmel

The function is not called from an atomic context so use GFP_KERNEL instead of GFP_ATOMIC. The allocation of the per-CPU stats is already performed with GFP_KERNEL.

Tested using test_vxlan_vnifiltering.sh with CONFIG_DEBUG_ATOMIC_SLEEP.

---
  drivers/net/vxlan/vxlan_vnifilter.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vxlan/vxlan_vnifilter.c +0 -0
index c3ff30ab782e..9c59d0bf8c3d 100644

drivers/net/vxlan/vxlan_vnifilter.c static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan, · line 702

Quoted 8 lines
drivers/net/vxlan/vxlan_vnifilter.c +1 -1
@@ -696,7 +696,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan,
  {
  	struct vxlan_vni_node *vninode;
 
-	vninode = kzalloc(sizeof(*vninode), GFP_ATOMIC);
+	vninode = kzalloc(sizeof(*vninode), GFP_KERNEL);
  	if (!vninode)
  		return NULL;
  	vninode->stats = netdev_alloc_pcpu_stats(struct vxlan_vni_stats_pcpu);
#4 lore raw
In reply to Ido Schimmel
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 21 Aug 2023 17:19:23 +0300 you wrote:

The function is not called from an atomic context so use GFP_KERNEL instead of GFP_ATOMIC. The allocation of the per-CPU stats is already performed with GFP_KERNEL.

Tested using test_vxlan_vnifiltering.sh with CONFIG_DEBUG_ATOMIC_SLEEP.

[...]

Here is the summary with links:
- [net-next] vxlan: vnifilter: Use GFP_KERNEL instead of GFP_ATOMIC

    https://git.kernel.org/netdev/net-next/c/63c11dc2ca8b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html