From patchwork Sun Oct 11 23:49:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 7371781 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7986DBEEA4 for ; Sun, 11 Oct 2015 23:49:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B0482092E for ; Sun, 11 Oct 2015 23:49:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52B5F2092C for ; Sun, 11 Oct 2015 23:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751493AbbJKXtp (ORCPT ); Sun, 11 Oct 2015 19:49:45 -0400 Received: from resqmta-ch2-05v.sys.comcast.net ([69.252.207.37]:49356 "EHLO resqmta-ch2-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751261AbbJKXto (ORCPT ); Sun, 11 Oct 2015 19:49:44 -0400 Received: from resomta-ch2-15v.sys.comcast.net ([69.252.207.111]) by resqmta-ch2-05v.sys.comcast.net with comcast id TzpW1r0042Qkjl901zpkFk; Sun, 11 Oct 2015 23:49:44 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-15v.sys.comcast.net with comcast id Tzpj1r0021PgSZ601zpjdy; Sun, 11 Oct 2015 23:49:44 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 01DAE10F5; Sun, 11 Oct 2015 18:49:42 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id F3716399; Sun, 11 Oct 2015 18:49:42 -0500 (CDT) Date: Sun, 11 Oct 2015 18:49:42 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Sagi Grimberg cc: Doug Ledford , "linux-rdma@vger.kernel.org" , Jason Gunthorpe , Erez Shitrit Subject: Re: Seeing WARN_ON in ib_dealloc_pd from ipoib in kernel 4.3-rc1-debug In-Reply-To: <561A8591.4020608@dev.mellanox.co.il> Message-ID: References: <56153F71.2010801@dev.mellanox.co.il> <5615442D.2020007@redhat.com> <561A8591.4020608@dev.mellanox.co.il> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1444607384; bh=0Oqj33fnMpU30FS7o5fg0Q9We+e0ouENRSA8daPvRZQ=; h=Received:Received:Received:Received:Date:From:To:Subject: Message-ID:Content-Type; b=uB8lcyMqQVSPRsjdfR2vhc5so+X+f9rwFJsGzHDvSrZnKjimxByw+XgPAnmilQFdP 94WYRWvk+KBXiMmAq0it7eCh/8LBOwKOL5k6oqqmVlauWxeYF37bNDbnBxlcMWJGJX 7Us4rbnudzXxXztoO9Z3HxApwvAPxkmPPaxUxGtTweC+I/m34GoXIXZuKDi7HaVzwc yLjEiBFYcJeVOOpodG9AJ8wXV1fpPxUTcJzTY3ttVrdOz7p/VUHZLUHTw7ltTJvkGP Ll0pAtytgKtV6sAvJLDuBd9RgJ5TPRQXOeKrvD8wKysO1gFb72NkPt3JROV8VDTLU/ M4wNj9egehWuA== Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Sagi Grimberg --- 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 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;