From patchwork Mon Mar 18 16:55:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 10858109 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0B8F6C2 for ; Mon, 18 Mar 2019 16:55:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98E0F28FAB for ; Mon, 18 Mar 2019 16:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 895EA28FDC; Mon, 18 Mar 2019 16:55:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7ACF528FAB for ; Mon, 18 Mar 2019 16:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbfCRQzK (ORCPT ); Mon, 18 Mar 2019 12:55:10 -0400 Received: from mga06.intel.com ([134.134.136.31]:29037 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfCRQzK (ORCPT ); Mon, 18 Mar 2019 12:55:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 09:55:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,494,1544515200"; d="scan'208";a="128003754" Received: from scymds01.sc.intel.com ([10.82.194.37]) by orsmga006.jf.intel.com with ESMTP; 18 Mar 2019 09:55:09 -0700 Received: from scvm10.sc.intel.com (scvm10.sc.intel.com [10.82.195.27]) by scymds01.sc.intel.com with ESMTP id x2IGt9fl020790; Mon, 18 Mar 2019 09:55:09 -0700 Received: from scvm10.sc.intel.com (localhost [127.0.0.1]) by scvm10.sc.intel.com with ESMTP id x2IGt93C025195; Mon, 18 Mar 2019 09:55:09 -0700 Subject: [PATCH for-rc 1/5] IB/hfi1: Fix WQ_MEM_RECLAIM warning From: Dennis Dalessandro To: jgg@ziepe.ca, dledford@redhat.com Cc: linux-rdma@vger.kernel.org, "Michael J. Ruhl" , Mike Marciniszyn Date: Mon, 18 Mar 2019 09:55:09 -0700 Message-ID: <20190318165501.23550.24989.stgit@scvm10.sc.intel.com> In-Reply-To: <20190318165205.23550.97894.stgit@scvm10.sc.intel.com> References: <20190318165205.23550.97894.stgit@scvm10.sc.intel.com> User-Agent: StGit/0.17.1-18-g2e886-dirty MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mike Marciniszyn The work_item cancels that occur when a QP is destroyed can elicit the following trace: [ 708.997199] workqueue: WQ_MEM_RECLAIM ipoib_wq:ipoib_cm_tx_reap [ib_ipoib] is flushing !WQ_MEM_RECLAIM hfi0_0:_hfi1_do_send [hfi1] [ 708.997209] WARNING: CPU: 7 PID: 1403 at kernel/workqueue.c:2486 check_flush_dependency+0xb1/0x100 [ 709.227743] Call Trace: [ 709.230852] __flush_work.isra.29+0x8c/0x1a0 [ 709.235779] ? __switch_to_asm+0x40/0x70 [ 709.240335] __cancel_work_timer+0x103/0x190 [ 709.245253] ? schedule+0x32/0x80 [ 709.249216] iowait_cancel_work+0x15/0x30 [hfi1] [ 709.254475] rvt_reset_qp+0x1f8/0x3e0 [rdmavt] [ 709.259554] rvt_destroy_qp+0x65/0x1f0 [rdmavt] [ 709.264703] ? _cond_resched+0x15/0x30 [ 709.269081] ib_destroy_qp+0xe9/0x230 [ib_core] [ 709.274223] ipoib_cm_tx_reap+0x21c/0x560 [ib_ipoib] [ 709.279799] process_one_work+0x171/0x370 [ 709.284425] worker_thread+0x49/0x3f0 [ 709.288695] kthread+0xf8/0x130 [ 709.292450] ? max_active_store+0x80/0x80 [ 709.297050] ? kthread_bind+0x10/0x10 [ 709.301293] ret_from_fork+0x35/0x40 [ 709.305441] ---[ end trace f0e973737146499b ]--- Since QP destruction frees memory, hfi1_wq should have the WQ_MEM_RECLAIM. Fixes: 0a226edd203f ("staging/rdma/hfi1: Use parallel workqueue for SDMA engines") Reviewed-by: Michael J. Ruhl Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/init.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 7841a0a..3cd6f07 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -800,7 +800,8 @@ static int create_workqueues(struct hfi1_devdata *dd) ppd->hfi1_wq = alloc_workqueue( "hfi%d_%d", - WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE, + WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE | + WQ_MEM_RECLAIM, HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES, dd->unit, pidx); if (!ppd->hfi1_wq)