netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep()
       [not found] <20230315181902.4177819-1-joel@joelfernandes.org>
@ 2023-03-15 18:18 ` Joel Fernandes (Google)
  2023-03-26 12:28   ` Joel Fernandes
  2023-03-15 18:18 ` [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep() Joel Fernandes (Google)
  2023-03-15 18:18 ` [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
  2 siblings, 1 reply; 9+ messages in thread
From: Joel Fernandes (Google) @ 2023-03-15 18:18 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Uladzislau Rezki (Sony), Paul E . McKenney, Joel Fernandes,
	netdev, linux-kernel

From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
of the single-argument forms, which can introduce functionality bugs in
atomic contexts and latency bugs in non-atomic contexts.

Cc: Eric Dumazet <edumazet@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 net/core/sysctl_net_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 74842b453407..782273bb93c2 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -177,7 +177,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write,
 			if (orig_sock_table) {
 				static_branch_dec(&rps_needed);
 				static_branch_dec(&rfs_needed);
-				kvfree_rcu(orig_sock_table);
+				kvfree_rcu_mightsleep(orig_sock_table);
 			}
 		}
 	}
@@ -215,7 +215,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
 				     lockdep_is_held(&flow_limit_update_mutex));
 			if (cur && !cpumask_test_cpu(i, mask)) {
 				RCU_INIT_POINTER(sd->flow_limit, NULL);
-				kfree_rcu(cur);
+				kfree_rcu_mightsleep(cur);
 			} else if (!cur && cpumask_test_cpu(i, mask)) {
 				cur = kzalloc_node(len, GFP_KERNEL,
 						   cpu_to_node(i));
-- 
2.40.0.rc1.284.g88254d51c5-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep()
       [not found] <20230315181902.4177819-1-joel@joelfernandes.org>
  2023-03-15 18:18 ` [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
@ 2023-03-15 18:18 ` Joel Fernandes (Google)
  2023-03-26 12:34   ` Joel Fernandes
  2023-03-15 18:18 ` [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
  2 siblings, 1 reply; 9+ messages in thread
From: Joel Fernandes (Google) @ 2023-03-15 18:18 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Boris Pismenny
  Cc: Uladzislau Rezki (Sony), Ariel Levkovich, Vlad Buslov,
	Paul E . McKenney, Joel Fernandes, netdev, linux-rdma,
	linux-kernel

From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
of the single-argument forms, which can introduce functionality bugs in
atomic contexts and latency bugs in non-atomic contexts.

Cc: Ariel Levkovich <lariel@nvidia.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c  | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
index ca834bbcb44f..8afcec0c5d3c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
@@ -242,7 +242,7 @@ mlx5e_int_port_remove(struct mlx5e_tc_int_port_priv *priv,
 		mlx5_del_flow_rules(int_port->rx_rule);
 	mapping_remove(ctx, int_port->mapping);
 	mlx5e_int_port_metadata_free(priv, int_port->match_metadata);
-	kfree_rcu(int_port);
+	kfree_rcu_mightsleep(int_port);
 	priv->num_ports--;
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
index 08d0929e8260..b811dad7370a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
@@ -670,7 +670,7 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx)
 
 	mlx5e_macsec_cleanup_sa(macsec, tx_sa, true);
 	mlx5_destroy_encryption_key(macsec->mdev, tx_sa->enc_key_id);
-	kfree_rcu(tx_sa);
+	kfree_rcu_mightsleep(tx_sa);
 	macsec_device->tx_sa[assoc_num] = NULL;
 
 out:
@@ -849,7 +849,7 @@ static void macsec_del_rxsc_ctx(struct mlx5e_macsec *macsec, struct mlx5e_macsec
 	xa_erase(&macsec->sc_xarray, rx_sc->sc_xarray_element->fs_id);
 	metadata_dst_free(rx_sc->md_dst);
 	kfree(rx_sc->sc_xarray_element);
-	kfree_rcu(rx_sc);
+	kfree_rcu_mightsleep(rx_sc);
 }
 
 static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx)
-- 
2.40.0.rc1.284.g88254d51c5-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep()
       [not found] <20230315181902.4177819-1-joel@joelfernandes.org>
  2023-03-15 18:18 ` [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
  2023-03-15 18:18 ` [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep() Joel Fernandes (Google)
@ 2023-03-15 18:18 ` Joel Fernandes (Google)
  2023-03-16 16:41   ` Stefan Schmidt
  2 siblings, 1 reply; 9+ messages in thread
From: Joel Fernandes (Google) @ 2023-03-15 18:18 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, Miquel Raynal, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, David Girault
  Cc: Joel Fernandes (Google), Paul E . McKenney, Alexander Aring,
	linux-wpan, netdev, linux-kernel

The k[v]free_rcu() macro's single-argument form is deprecated.
Therefore switch to the new k[v]free_rcu_mightsleep() variant. The goal
is to avoid accidental use of the single-argument forms, which can
introduce functionality bugs in atomic contexts and latency bugs in
non-atomic contexts.

The callers are holding a mutex so the context allows blocking. Hence
using the API with a single argument will be fine, but use its new name.

There is no functionality change with this patch.

Fixes: 57588c71177f ("mac802154: Handle passive scanning")
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 net/mac802154/scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c
index 9b0933a185eb..5c191bedd72c 100644
--- a/net/mac802154/scan.c
+++ b/net/mac802154/scan.c
@@ -52,7 +52,7 @@ static int mac802154_scan_cleanup_locked(struct ieee802154_local *local,
 	request = rcu_replace_pointer(local->scan_req, NULL, 1);
 	if (!request)
 		return 0;
-	kfree_rcu(request);
+	kvfree_rcu_mightsleep(request);
 
 	/* Advertize first, while we know the devices cannot be removed */
 	if (aborted)
@@ -403,7 +403,7 @@ int mac802154_stop_beacons_locked(struct ieee802154_local *local,
 	request = rcu_replace_pointer(local->beacon_req, NULL, 1);
 	if (!request)
 		return 0;
-	kfree_rcu(request);
+	kvfree_rcu_mightsleep(request);
 
 	nl802154_beaconing_done(wpan_dev);
 
-- 
2.40.0.rc1.284.g88254d51c5-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep()
  2023-03-15 18:18 ` [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
@ 2023-03-16 16:41   ` Stefan Schmidt
  2023-03-16 18:06     ` Joel Fernandes
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Schmidt @ 2023-03-16 16:41 UTC (permalink / raw)
  To: Joel Fernandes (Google), Alexander Aring, Miquel Raynal,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	David Girault
  Cc: Paul E . McKenney, Alexander Aring, linux-wpan, netdev,
	linux-kernel

Hello.

On 15.03.23 19:18, Joel Fernandes (Google) wrote:
> The k[v]free_rcu() macro's single-argument form is deprecated.
> Therefore switch to the new k[v]free_rcu_mightsleep() variant. The goal
> is to avoid accidental use of the single-argument forms, which can
> introduce functionality bugs in atomic contexts and latency bugs in
> non-atomic contexts.
> 
> The callers are holding a mutex so the context allows blocking. Hence
> using the API with a single argument will be fine, but use its new name.
> 
> There is no functionality change with this patch.
> 
> Fixes: 57588c71177f ("mac802154: Handle passive scanning")
> Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> ---
>   net/mac802154/scan.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c
> index 9b0933a185eb..5c191bedd72c 100644
> --- a/net/mac802154/scan.c
> +++ b/net/mac802154/scan.c
> @@ -52,7 +52,7 @@ static int mac802154_scan_cleanup_locked(struct ieee802154_local *local,
>   	request = rcu_replace_pointer(local->scan_req, NULL, 1);
>   	if (!request)
>   		return 0;
> -	kfree_rcu(request);
> +	kvfree_rcu_mightsleep(request);
>   
>   	/* Advertize first, while we know the devices cannot be removed */
>   	if (aborted)
> @@ -403,7 +403,7 @@ int mac802154_stop_beacons_locked(struct ieee802154_local *local,
>   	request = rcu_replace_pointer(local->beacon_req, NULL, 1);
>   	if (!request)
>   		return 0;
> -	kfree_rcu(request);
> +	kvfree_rcu_mightsleep(request);
>   
>   	nl802154_beaconing_done(wpan_dev);
>   

I just saw that there is a v2 of this patch. My ACK still stands as for v1.


Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep()
  2023-03-16 16:41   ` Stefan Schmidt
@ 2023-03-16 18:06     ` Joel Fernandes
  0 siblings, 0 replies; 9+ messages in thread
From: Joel Fernandes @ 2023-03-16 18:06 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Alexander Aring, Miquel Raynal, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, David Girault, Paul E . McKenney,
	Alexander Aring, linux-wpan, netdev, linux-kernel

On Thu, Mar 16, 2023 at 12:41 PM Stefan Schmidt
<stefan@datenfreihafen.org> wrote:
>
> Hello.
>
> On 15.03.23 19:18, Joel Fernandes (Google) wrote:
> > The k[v]free_rcu() macro's single-argument form is deprecated.
> > Therefore switch to the new k[v]free_rcu_mightsleep() variant. The goal
> > is to avoid accidental use of the single-argument forms, which can
> > introduce functionality bugs in atomic contexts and latency bugs in
> > non-atomic contexts.
> >
> > The callers are holding a mutex so the context allows blocking. Hence
> > using the API with a single argument will be fine, but use its new name.
> >
> > There is no functionality change with this patch.
> >
> > Fixes: 57588c71177f ("mac802154: Handle passive scanning")
> > Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> > ---
> >   net/mac802154/scan.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c
> > index 9b0933a185eb..5c191bedd72c 100644
> > --- a/net/mac802154/scan.c
> > +++ b/net/mac802154/scan.c
> > @@ -52,7 +52,7 @@ static int mac802154_scan_cleanup_locked(struct ieee802154_local *local,
> >       request = rcu_replace_pointer(local->scan_req, NULL, 1);
> >       if (!request)
> >               return 0;
> > -     kfree_rcu(request);
> > +     kvfree_rcu_mightsleep(request);
> >
> >       /* Advertize first, while we know the devices cannot be removed */
> >       if (aborted)
> > @@ -403,7 +403,7 @@ int mac802154_stop_beacons_locked(struct ieee802154_local *local,
> >       request = rcu_replace_pointer(local->beacon_req, NULL, 1);
> >       if (!request)
> >               return 0;
> > -     kfree_rcu(request);
> > +     kvfree_rcu_mightsleep(request);
> >
> >       nl802154_beaconing_done(wpan_dev);
> >
>
> I just saw that there is a v2 of this patch. My ACK still stands as for v1.
>
>
> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>

Thanks! Applied the ack and will be taking it via the RCU tree as we discussed.

 - Joel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep()
  2023-03-15 18:18 ` [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
@ 2023-03-26 12:28   ` Joel Fernandes
  2023-03-27 17:14     ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Fernandes @ 2023-03-26 12:28 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Uladzislau Rezki (Sony), Paul E . McKenney, netdev, linux-kernel

On Wed, Mar 15, 2023 at 2:19 PM Joel Fernandes (Google)
<joel@joelfernandes.org> wrote:
>
> From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
>
> The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
> deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
> kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
> of the single-argument forms, which can introduce functionality bugs in
> atomic contexts and latency bugs in non-atomic contexts.
>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: David S. Miller <davem@davemloft.net>

Could anyone from the networking side Ack this patch so we can take it for 6.4?

Eric or David?

 - Joel

> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> ---
>  net/core/sysctl_net_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> index 74842b453407..782273bb93c2 100644
> --- a/net/core/sysctl_net_core.c
> +++ b/net/core/sysctl_net_core.c
> @@ -177,7 +177,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write,
>                         if (orig_sock_table) {
>                                 static_branch_dec(&rps_needed);
>                                 static_branch_dec(&rfs_needed);
> -                               kvfree_rcu(orig_sock_table);
> +                               kvfree_rcu_mightsleep(orig_sock_table);
>                         }
>                 }
>         }
> @@ -215,7 +215,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
>                                      lockdep_is_held(&flow_limit_update_mutex));
>                         if (cur && !cpumask_test_cpu(i, mask)) {
>                                 RCU_INIT_POINTER(sd->flow_limit, NULL);
> -                               kfree_rcu(cur);
> +                               kfree_rcu_mightsleep(cur);
>                         } else if (!cur && cpumask_test_cpu(i, mask)) {
>                                 cur = kzalloc_node(len, GFP_KERNEL,
>                                                    cpu_to_node(i));
> --
> 2.40.0.rc1.284.g88254d51c5-goog
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep()
  2023-03-15 18:18 ` [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep() Joel Fernandes (Google)
@ 2023-03-26 12:34   ` Joel Fernandes
  2023-03-27 15:09     ` Saeed Mahameed
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Fernandes @ 2023-03-26 12:34 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Boris Pismenny
  Cc: Uladzislau Rezki (Sony), Ariel Levkovich, Vlad Buslov,
	Paul E . McKenney, netdev, linux-rdma, linux-kernel

On Wed, Mar 15, 2023 at 2:19 PM Joel Fernandes (Google)
<joel@joelfernandes.org> wrote:
>
> From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
>
> The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
> deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
> kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
> of the single-argument forms, which can introduce functionality bugs in
> atomic contexts and latency bugs in non-atomic contexts.

In a world where patches anxiously await their precious Ack, could
today be our lucky day on this one?

We need Acks to take this in for 6.4. David? Others?

 - Joel


>
> Cc: Ariel Levkovich <lariel@nvidia.com>
> Cc: Saeed Mahameed <saeedm@nvidia.com>
> Cc: Vlad Buslov <vladbu@nvidia.com>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c  | 2 +-
>  drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
> index ca834bbcb44f..8afcec0c5d3c 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
> @@ -242,7 +242,7 @@ mlx5e_int_port_remove(struct mlx5e_tc_int_port_priv *priv,
>                 mlx5_del_flow_rules(int_port->rx_rule);
>         mapping_remove(ctx, int_port->mapping);
>         mlx5e_int_port_metadata_free(priv, int_port->match_metadata);
> -       kfree_rcu(int_port);
> +       kfree_rcu_mightsleep(int_port);
>         priv->num_ports--;
>  }
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
> index 08d0929e8260..b811dad7370a 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
> @@ -670,7 +670,7 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx)
>
>         mlx5e_macsec_cleanup_sa(macsec, tx_sa, true);
>         mlx5_destroy_encryption_key(macsec->mdev, tx_sa->enc_key_id);
> -       kfree_rcu(tx_sa);
> +       kfree_rcu_mightsleep(tx_sa);
>         macsec_device->tx_sa[assoc_num] = NULL;
>
>  out:
> @@ -849,7 +849,7 @@ static void macsec_del_rxsc_ctx(struct mlx5e_macsec *macsec, struct mlx5e_macsec
>         xa_erase(&macsec->sc_xarray, rx_sc->sc_xarray_element->fs_id);
>         metadata_dst_free(rx_sc->md_dst);
>         kfree(rx_sc->sc_xarray_element);
> -       kfree_rcu(rx_sc);
> +       kfree_rcu_mightsleep(rx_sc);
>  }
>
>  static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx)
> --
> 2.40.0.rc1.284.g88254d51c5-goog
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep()
  2023-03-26 12:34   ` Joel Fernandes
@ 2023-03-27 15:09     ` Saeed Mahameed
  0 siblings, 0 replies; 9+ messages in thread
From: Saeed Mahameed @ 2023-03-27 15:09 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: Saeed Mahameed, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Boris Pismenny,
	Uladzislau Rezki (Sony), Ariel Levkovich, Vlad Buslov,
	Paul E . McKenney, netdev, linux-rdma, linux-kernel

On 26 Mar 08:34, Joel Fernandes wrote:
>On Wed, Mar 15, 2023 at 2:19 PM Joel Fernandes (Google)
><joel@joelfernandes.org> wrote:
>>
>> From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
>>
>> The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
>> deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
>> kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
>> of the single-argument forms, which can introduce functionality bugs in
>> atomic contexts and latency bugs in non-atomic contexts.
>
>In a world where patches anxiously await their precious Ack, could
>today be our lucky day on this one?
>
>We need Acks to take this in for 6.4. David? Others?
>

For mlx5 usually me, but since this is a larger series that is not mlx5
centric and targeting multiple tree, I really don't know which subsystem
you should be targeting.. for netdev submissions you need to specify the
targeted branch e.g. [PATCH v2 net-next 06/14] ... 


FWIW:

Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>


> - Joel
>
>
>>
>> Cc: Ariel Levkovich <lariel@nvidia.com>
>> Cc: Saeed Mahameed <saeedm@nvidia.com>
>> Cc: Vlad Buslov <vladbu@nvidia.com>
>> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
>> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>> ---
>>  drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c  | 2 +-
>>  drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 4 ++--
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
>> index ca834bbcb44f..8afcec0c5d3c 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
>> @@ -242,7 +242,7 @@ mlx5e_int_port_remove(struct mlx5e_tc_int_port_priv *priv,
>>                 mlx5_del_flow_rules(int_port->rx_rule);
>>         mapping_remove(ctx, int_port->mapping);
>>         mlx5e_int_port_metadata_free(priv, int_port->match_metadata);
>> -       kfree_rcu(int_port);
>> +       kfree_rcu_mightsleep(int_port);
>>         priv->num_ports--;
>>  }
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
>> index 08d0929e8260..b811dad7370a 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
>> @@ -670,7 +670,7 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx)
>>
>>         mlx5e_macsec_cleanup_sa(macsec, tx_sa, true);
>>         mlx5_destroy_encryption_key(macsec->mdev, tx_sa->enc_key_id);
>> -       kfree_rcu(tx_sa);
>> +       kfree_rcu_mightsleep(tx_sa);
>>         macsec_device->tx_sa[assoc_num] = NULL;
>>
>>  out:
>> @@ -849,7 +849,7 @@ static void macsec_del_rxsc_ctx(struct mlx5e_macsec *macsec, struct mlx5e_macsec
>>         xa_erase(&macsec->sc_xarray, rx_sc->sc_xarray_element->fs_id);
>>         metadata_dst_free(rx_sc->md_dst);
>>         kfree(rx_sc->sc_xarray_element);
>> -       kfree_rcu(rx_sc);
>> +       kfree_rcu_mightsleep(rx_sc);
>>  }
>>
>>  static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx)
>> --
>> 2.40.0.rc1.284.g88254d51c5-goog
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep()
  2023-03-26 12:28   ` Joel Fernandes
@ 2023-03-27 17:14     ` Jakub Kicinski
  0 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2023-03-27 17:14 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni,
	Uladzislau Rezki (Sony), Paul E . McKenney, netdev, linux-kernel

On Sun, 26 Mar 2023 08:28:45 -0400 Joel Fernandes wrote:
> > Cc: Eric Dumazet <edumazet@google.com>
> > Cc: David S. Miller <davem@davemloft.net>  
> 
> Could anyone from the networking side Ack this patch so we can take it for 6.4?
> 
> Eric or David?

Let me help you. Perhaps it's a data point against keeping maintainers 
in an alphabetical order :-)

Acked-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-27 17:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230315181902.4177819-1-joel@joelfernandes.org>
2023-03-15 18:18 ` [PATCH v2 05/14] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
2023-03-26 12:28   ` Joel Fernandes
2023-03-27 17:14     ` Jakub Kicinski
2023-03-15 18:18 ` [PATCH v2 06/14] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep() Joel Fernandes (Google)
2023-03-26 12:34   ` Joel Fernandes
2023-03-27 15:09     ` Saeed Mahameed
2023-03-15 18:18 ` [PATCH v2 12/14] mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep() Joel Fernandes (Google)
2023-03-16 16:41   ` Stefan Schmidt
2023-03-16 18:06     ` Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).