Received: by 10.192.165.148 with SMTP id m20csp2928487imm; Sun, 22 Apr 2018 19:33:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/1ihr4E5Unyff7+QB1gVvZSwGG7iDRPKBz5t7jSpG+TsIsFEX6foVkuPewlaVfIs197IcT X-Received: by 2002:a17:902:5597:: with SMTP id g23-v6mr5802241pli.347.1524450817116; Sun, 22 Apr 2018 19:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524450817; cv=none; d=google.com; s=arc-20160816; b=oj8XjBxcrulVNY0/VfuGqqs2zzkv8mh3ZUAq/SrKotTVSASs0Cg11PEO4hwYTwjN39 OQ90A6t8kTvjEad8kwGh0kYPK0s8gZwwtGo1Kb7SH+euPgqV49gxJlMVmu61BmPYdOrH 7xhVHpfTRxSu4cGawcDAAA41Q/327cVX3LY+GJjDAoNPdxYgFcrqaX606OHY1DZe0/OP QlusEAZscjvJfbjFoZrOKfLNU80cEmY7gtz4epOfoHPUf93HbT2u6ACJ84ul7lcM8eZ2 t6FnzKbCzBm4dXxLPn8TRioEplDkApbbAo2Uad5BQs7M6yALBwnI9FSk9vCOGxBTWKG9 ITCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=zZAP97T0GfDC1wwxfGJ5XDobup7d0Q586DN7qqKthG8=; b=ICIScZUMvSS51NOhvCVtcdoh3Uz/z6BsMgwcnpBHtd6GqgCGS1YRIInE++VyijRR5F I320q2X/PKAlRUfnRieTsCKMjxCbfcyJLznB9otD3EZLyByYMY/OmEXMsz5wC83ulahA T1yfPMzi94CUO8BnixsbPHkOXNVPpk0U+0OIj9KAt6LW3Wfd8x+sgbk7+ZnN13Aac54g wyQT73Zdl89qVuIcFSNqUHxzvr9Ytr7MwPWVQONFRG0SgeZIzWgpQrn3zvyh04gmwhto tx024kMVqoBvgBH13uHqK0ZTuVrdN2FEgfaxdNh/8vIsyk8dsHxNAtvbYcD7H91sgZEf Z/rQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a36-v6si10856518pla.73.2018.04.22.19.33.23; Sun, 22 Apr 2018 19:33:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753886AbeDWCcI (ORCPT + 99 others); Sun, 22 Apr 2018 22:32:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52464 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753967AbeDWCbX (ORCPT ); Sun, 22 Apr 2018 22:31:23 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3N2T1IW042432 for ; Sun, 22 Apr 2018 22:31:23 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hh39j5nqc-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 22 Apr 2018 22:31:22 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 22 Apr 2018 22:31:22 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 22 Apr 2018 22:31:16 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3N2VETG53805308; Mon, 23 Apr 2018 02:31:15 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57EFEB2046; Sun, 22 Apr 2018 23:33:18 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.149.45]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 22792B2058; Sun, 22 Apr 2018 23:33:18 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 9CE8716C91D0; Sun, 22 Apr 2018 19:32:28 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel.opensrc@gmail.com, Nitzan Carmi , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 12/22] nvme: Avoid flush dependency in delete controller flow Date: Sun, 22 Apr 2018 19:32:17 -0700 X-Mailer: git-send-email 2.5.2 In-Reply-To: <20180423023150.GA21533@linux.vnet.ibm.com> References: <20180423023150.GA21533@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18042302-0036-0000-0000-000002E8AF7D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008903; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01021888; UDB=6.00521536; IPR=6.00801123; MB=3.00020719; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-23 02:31:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042302-0037-0000-0000-00004414FD96 Message-Id: <1524450747-22778-12-git-send-email-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804230025 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nitzan Carmi The nvme_delete_ctrl() function queues a work item on a MEM_RECLAIM queue (nvme_delete_wq), which eventually calls cleanup_srcu_struct(), which in turn flushes a delayed work from an !MEM_RECLAIM queue. This is unsafe as we might trigger deadlocks under severe memory pressure. Since we don't ever invoke call_srcu(), it is safe to use the shiny new _quiesced() version of srcu cleanup, thus avoiding that flush dependency. This commit makes that change. Signed-off-by: Nitzan Carmi Signed-off-by: Paul E. McKenney Reviewed-by: Max Gurtovoy --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9df4f71e58ca..c3cea8a29843 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -349,7 +349,7 @@ static void nvme_free_ns_head(struct kref *ref) nvme_mpath_remove_disk(head); ida_simple_remove(&head->subsys->ns_ida, head->instance); list_del_init(&head->entry); - cleanup_srcu_struct(&head->srcu); + cleanup_srcu_struct_quiesced(&head->srcu); kfree(head); } -- 2.5.2