From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5EFDC61CE8 for ; Sat, 19 Jan 2019 10:03:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78B722086A for ; Sat, 19 Jan 2019 10:03:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="T4QElVC7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727728AbfASKDH (ORCPT ); Sat, 19 Jan 2019 05:03:07 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:57174 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbfASKDH (ORCPT ); Sat, 19 Jan 2019 05:03:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=97hiamFTeq//kHC7e8ZxGYpD11s05cJpSIgzAU8K3oU=; b=T4QElVC7neLuJe2ul0HFlNG27 wQo/rfrVayk8K3H7RQPwU0hFeGpn4fHlr57Xbn1GsSce9n8hODfJTg6MYeFQQWOw/YALDcmsWFoqx DvN4dF1wNo6BPYc8oNRwoUGyxTQhKFLlDQ/bj+BOEWXbbtEYDvRn5pMNNUxiDe7Kb1RXb5q5fV1sL JH8Ca2bscDiw0uet/5WEbYzoxfmXSQywspbUzNXbVL2zWrcsT+xfgvDfVRFY5jcF/1mq/k2hBVbxV 9cPv549O4TjNkwLbw4IwSG3t39e2RHEyCTAbxqQ9XEH+s8XuMDu3HsXtTK1ztKyZfB2/XyeTX/uV+ eUlrotWJQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gknSy-0006Md-Me; Sat, 19 Jan 2019 10:03:04 +0000 Date: Sat, 19 Jan 2019 02:03:04 -0800 From: Christoph Hellwig To: Bart Van Assche Cc: Jason Gunthorpe , Doug Ledford , linux-rdma@vger.kernel.org, Sergey Gorenko , Max Gurtovoy , Laurence Oberman , stable@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [PATCH 1/2] RDMA/srp: Avoid calling mutex_lock() from inside scsi_queue_rq() Message-ID: <20190119100304.GB24246@infradead.org> References: <20190117002717.84686-1-bvanassche@acm.org> <20190117002717.84686-2-bvanassche@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190117002717.84686-2-bvanassche@acm.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Jan 16, 2019 at 04:27:16PM -0800, Bart Van Assche wrote: > In scsi-mq mode it is not allowed to sleep inside srp_queuecommand() > since the flag BLK_MQ_F_BLOCKING has not been set. Since setting the > request queue flag BLK_MQ_F_BLOCKING would slow down the hot path, make > srp_queuecommand() skip the mutex_lock() and mutex_unlock() calls when > called from inside scsi_queue_rq() from the SCSI EH thread. > > This patch avoids that the following appears in the kernel log: I think we need to get rid of the taking a sleeping lock in ->queuecomand entirely. These checks are way to fragile.