diff mbox

Seeing WARN_ON in ib_dealloc_pd from ipoib in kernel 4.3-rc1-debug

Message ID alpine.DEB.2.20.1510111848560.10812@east.gentwo.org (mailing list archive)
State Accepted
Headers show

Commit Message

Christoph Lameter (Ampere) Oct. 11, 2015, 11:49 p.m. UTC
On Sun, 11 Oct 2015, Sagi Grimberg wrote:

> Is someone looking at this? It really should be fixed before 4.3
> final...

The following fixup patch is needed:



Subject: ipoib: For sendonly join free the multicast group on leave

When we leave the multicast group on expiration of a neighbor we
do not free the mcast structure. This results in a memory leak.

Signed-off-by: Christoph Lameter <cl@linux.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sagi Grimberg Oct. 12, 2015, 7:53 a.m. UTC | #1
> The following fixup patch is needed:
>
>
>
> Subject: ipoib: For sendonly join free the multicast group on leave
>
> When we leave the multicast group on expiration of a neighbor we
> do not free the mcast structure. This results in a memory leak.
>
> Signed-off-by: Christoph Lameter <cl@linux.com>
>
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib.h
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib.h
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib.h
> @@ -495,6 +495,7 @@ void ipoib_dev_cleanup(struct net_device
>   void ipoib_mcast_join_task(struct work_struct *work);
>   void ipoib_mcast_carrier_on_task(struct work_struct *work);
>   void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
> +void ipoib_mcast_free(struct ipoib_mcast *mc);
>
>   void ipoib_mcast_restart_task(struct work_struct *work);
>   int ipoib_mcast_start_thread(struct net_device *dev);
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -1207,8 +1207,10 @@ static void __ipoib_reap_neigh(struct ip
>
>   out_unlock:
>   	spin_unlock_irqrestore(&priv->lock, flags);
> -	list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
> +	list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
>   		ipoib_mcast_leave(dev, mcast);
> +		ipoib_mcast_free(mcast);
> +	}
>   }
>
>   static void ipoib_reap_neigh(struct work_struct *work)
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> @@ -106,7 +106,7 @@ static void __ipoib_mcast_schedule_join_
>   		queue_delayed_work(priv->wq, &priv->mcast_task, 0);
>   }
>
> -static void ipoib_mcast_free(struct ipoib_mcast *mcast)
> +void ipoib_mcast_free(struct ipoib_mcast *mcast)
>   {
>   	struct net_device *dev = mcast->dev;
>   	int tx_dropped = 0;
>


Hey Christoph,

Thanks for the quick patch. When you re-spin this as
a proper patch you can add my:

Tested-by: Sagi Grimberg <sagig@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Oct. 12, 2015, 12:35 p.m. UTC | #2
On 10/11/2015 07:49 PM, Christoph Lameter wrote:
> On Sun, 11 Oct 2015, Sagi Grimberg wrote:
> 
>> Is someone looking at this? It really should be fixed before 4.3
>> final...
> 
> The following fixup patch is needed:

Thanks Christoph.  I figured the issue had to have come from the new
code, but I hadn't had a chance to track it down yet.

> 
> 
> Subject: ipoib: For sendonly join free the multicast group on leave
> 
> When we leave the multicast group on expiration of a neighbor we
> do not free the mcast structure. This results in a memory leak.
> 
> Signed-off-by: Christoph Lameter <cl@linux.com>
> 
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib.h
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib.h
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib.h
> @@ -495,6 +495,7 @@ void ipoib_dev_cleanup(struct net_device
>  void ipoib_mcast_join_task(struct work_struct *work);
>  void ipoib_mcast_carrier_on_task(struct work_struct *work);
>  void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
> +void ipoib_mcast_free(struct ipoib_mcast *mc);
> 
>  void ipoib_mcast_restart_task(struct work_struct *work);
>  int ipoib_mcast_start_thread(struct net_device *dev);
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -1207,8 +1207,10 @@ static void __ipoib_reap_neigh(struct ip
> 
>  out_unlock:
>  	spin_unlock_irqrestore(&priv->lock, flags);
> -	list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
> +	list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
>  		ipoib_mcast_leave(dev, mcast);
> +		ipoib_mcast_free(mcast);
> +	}
>  }
> 
>  static void ipoib_reap_neigh(struct work_struct *work)
> Index: linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> ===================================================================
> --- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> +++ linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
> @@ -106,7 +106,7 @@ static void __ipoib_mcast_schedule_join_
>  		queue_delayed_work(priv->wq, &priv->mcast_task, 0);
>  }
> 
> -static void ipoib_mcast_free(struct ipoib_mcast *mcast)
> +void ipoib_mcast_free(struct ipoib_mcast *mcast)
>  {
>  	struct net_device *dev = mcast->dev;
>  	int tx_dropped = 0;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
diff mbox

Patch

Index: linux/drivers/infiniband/ulp/ipoib/ipoib.h
===================================================================
--- linux.orig/drivers/infiniband/ulp/ipoib/ipoib.h
+++ linux/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -495,6 +495,7 @@  void ipoib_dev_cleanup(struct net_device
 void ipoib_mcast_join_task(struct work_struct *work);
 void ipoib_mcast_carrier_on_task(struct work_struct *work);
 void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
+void ipoib_mcast_free(struct ipoib_mcast *mc);

 void ipoib_mcast_restart_task(struct work_struct *work);
 int ipoib_mcast_start_thread(struct net_device *dev);
Index: linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ linux/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1207,8 +1207,10 @@  static void __ipoib_reap_neigh(struct ip

 out_unlock:
 	spin_unlock_irqrestore(&priv->lock, flags);
-	list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
+	list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
 		ipoib_mcast_leave(dev, mcast);
+		ipoib_mcast_free(mcast);
+	}
 }

 static void ipoib_reap_neigh(struct work_struct *work)
Index: linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- linux.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ linux/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -106,7 +106,7 @@  static void __ipoib_mcast_schedule_join_
 		queue_delayed_work(priv->wq, &priv->mcast_task, 0);
 }

-static void ipoib_mcast_free(struct ipoib_mcast *mcast)
+void ipoib_mcast_free(struct ipoib_mcast *mcast)
 {
 	struct net_device *dev = mcast->dev;
 	int tx_dropped = 0;