Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1205178imm; Sun, 2 Sep 2018 13:43:53 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/ZsEYtaHaBiuLdUVnxsDKu2mcec/ZMshXsNf98+JM3kB9P+uoJYgWYwDkyB6NJBMbqv/J X-Received: by 2002:a17:902:b60b:: with SMTP id b11-v6mr24274040pls.301.1535921033220; Sun, 02 Sep 2018 13:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535921033; cv=none; d=google.com; s=arc-20160816; b=WZakXl9YcUkJlYc9WqG9HH1JFYPg0zH94e+pc9ZbVwtOBtXS+NWonouECUlPXGDZYq hUWV455YfK5mj8S0VDKc+qDoS7DojOXAXj2DoojttBoOBy2h4eBtk6WoFzqw+qXHsUFb 7GL4uGlzMOC6ThNWa6XLvNgOmrgY0l8JxWfoQNi8EevATXjjsWepJILa43VhsBS3FR2w 9xP1tbk/rq3YsR7ADMEnxAivdHcqdDqr2P+b/iUt3ZLwrgXlv9orkBZHNCm56iB3RJJw 4eU5+JRDlOLpqj3VKOKymaS8AEv5pocYRWmUs+pbrXQtDw9dfXjAj6vEnSsioQTEqXdd gZDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Kq+jt5n5gDAGAHCmHd3b6Ss0kzC3LhEgsBkl7v4x1nI=; b=jhqaTWAZaS+lBvlGW1DdlfS7CQuu+tuPY5m5/oq2lxo8XDx4NRC+L9BjizbSBMYwa0 Va5pjsKWu6DiGMJQ2K0vUla0KBds2kLi0Ju9oCHWPS+ql3y8mFX5KuYtYtouCyK0st6a KTZCe/vv+a6V3T7QpxKEvOKywY8Z+DtE9DVSRzQn0Y9obyuh0dvQfLvTUb4+/6XqUXCX ErsPUv58QsQOldFcIw+Aw+DvzJuc3fJkdxTbu2pTbN2Xjyg+7jwgVkJM0AzbVohoDZbB PKZh9q7Dk9t135bVwMl1M8o0n8HlFzq3qmy151pKpk26j7Clmz3u3zGhmvhLow3vuTVs 8/RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=czWMnFGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r205-v6si12498879pgr.634.2018.09.02.13.43.37; Sun, 02 Sep 2018 13:43:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=czWMnFGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727222AbeICAta (ORCPT + 99 others); Sun, 2 Sep 2018 20:49:30 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33139 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727175AbeICAta (ORCPT ); Sun, 2 Sep 2018 20:49:30 -0400 Received: by mail-pf1-f196.google.com with SMTP id d4-v6so7754851pfn.0 for ; Sun, 02 Sep 2018 13:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Kq+jt5n5gDAGAHCmHd3b6Ss0kzC3LhEgsBkl7v4x1nI=; b=czWMnFGgLIDSP3423fIr4i5ntB56pqZDkQQav6XF96EjelcNoAD9awkJTsc4GMNnZu 7sUPQgyc7kfwICzkBpvGD3XyYOzbV83lR7w2MU84PbSMn0ElMhvdzlFHTsSNxLdkAa3E vBPKiZFM3zqwOF9GinzZ4aA56G8B+Ff1/nR0Pt2ZcdF6hhNdwLHOh7ODkqppjOCFOxkZ nXf80D2hfVlfEPUcLurMHHKuEXyZzb/gFrbUyHAMT3ShrKacqTPZvCA77x85ow+R4qCr Q8Cug+Sh7dMc40ALmiQgJvFHBtw5LZqRo+PAfevznjM5OobzZmuffASmMVa/3Jqduu7N dc5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Kq+jt5n5gDAGAHCmHd3b6Ss0kzC3LhEgsBkl7v4x1nI=; b=q27CN72QJMwh6M5C5n83LTCDPAxc1Jv8Pmxo3NVHhFvbKIZp/NDTHdXRGhDv+FipRh YqmFj2F7f0bxmUL/vtEWMmDwJCX0R1tAwVP7rwAuPKRQfLP1O+xV8GA89B7RYnjO6LPT Id4q7hfKAVhiZXxLVIZZxLqkN1hKn/S4NtwOi5flFJk7Ic9pChYyVV5+HJfbBsCkur/L f0cLOaazuzPAjied8Gt3gt/Vo8pmuAFkR+Cv4HI9mDOF8Ux+HzRVpvovJAM2K7HIadSn U95JlsotTLBBLvG38nmufEdjpoxXcfHHpp3U+0IwshSv9Ega+d/eM1JAozngOXvpj0Re 4v+Q== X-Gm-Message-State: APzg51BiLeKlWzurIvfvsjZo5Y/w0jzkdH9iaKQZYrGcRPnPPPlisLnx 8ZqLJfTWur0H4HiZ/z8hBwNQ0g== X-Received: by 2002:a63:2bc9:: with SMTP id r192-v6mr3496087pgr.386.1535920350943; Sun, 02 Sep 2018 13:32:30 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id m15-v6sm28638567pfk.149.2018.09.02.13.32.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Sep 2018 13:32:30 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1fwZ2r-0004TG-D1; Sun, 02 Sep 2018 14:32:29 -0600 Date: Sun, 2 Sep 2018 14:32:29 -0600 From: Jason Gunthorpe To: Jia-Ju Bai Cc: dledford@redhat.com, leon@kernel.org, ira.weiny@intel.com, pravin.shedge4linux@gmail.com, hal@mellanox.com, parav@mellanox.com, haakon.bugge@oracle.com, bart.vanassche@sandisk.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] infiniband: core: mad: Fix a sleep-in-atomic-context bug in ib_mad_recv_done() Message-ID: <20180902203229.GA13946@ziepe.ca> References: <20180901120659.32509-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180901120659.32509-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 01, 2018 at 08:06:59PM +0800, Jia-Ju Bai wrote: > The driver may sleep with holding a spinlock. > > The function call paths (from bottom to top) in Linux-4.16 are: > > [FUNC] alloc_mad_private(GFP_KERNEL) > drivers/infiniband/core/mad.c, 2264: > alloc_mad_private in ib_mad_recv_done > drivers/infiniband/core/cq.c, 45: > [FUNC_PTR]ib_mad_recv_done in __ib_process_cq > drivers/infiniband/core/cq.c, 77: > __ib_process_cq in ib_process_cq_direct > drivers/infiniband/ulp/srp/ib_srp.c, 2010: > ib_process_cq_direct in __srp_get_tx_iu > drivers/infiniband/ulp/srp/ib_srp.c, 2353: > __srp_get_tx_iu in srp_queuecommand > drivers/infiniband/ulp/srp/ib_srp.c, 2352: > _raw_spin_lock_irqsave in srp_queuecommand > > [FUNC] alloc_mad_private(GFP_KERNEL) > drivers/infiniband/core/mad.c, 2264: > alloc_mad_private in ib_mad_recv_done > drivers/infiniband/core/cq.c, 45: > [FUNC_PTR]ib_mad_recv_done in __ib_process_cq > drivers/infiniband/core/cq.c, 77: > __ib_process_cq in ib_process_cq_direct This trace doesn't seem right, the CQ used by SRP will never have ib_mad_recv_done as a function pointer. Jason