Received: by 10.223.164.221 with SMTP id h29csp3385355wrb; Wed, 4 Oct 2017 00:19:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA9a0WByF7dvodqih6q6N+52/ERFwmSmdegAjbFM8HO8ZgztjYY+SgWNuZG1Krdnm8jlwMw X-Received: by 10.84.235.72 with SMTP id g8mr18378181plt.86.1507101563333; Wed, 04 Oct 2017 00:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507101563; cv=none; d=google.com; s=arc-20160816; b=ed+MUACm8fSexUXuJ2qWmBu4G+Wkeucr7nNP+sV8qVAUDoBNiE1XKiY48Bl8zaMvEa QvqUJZ9CuGYK6uYLQXr9BLWPFxXf3BIy+J7PnXjkCr+ywQn1mk+NvcTZcJPA6R5+FQdN u0++4Grpj22loPpV5kYXWsbGNDT+jslHPkWRbLDWr0ThMS5vhyjYHf5tXmgZHFrxc8sn 3HpTT+4E6aQS6fHoE64wlxv9pW1XI+sGfyrpEa/b0/b3/XrOxJSbgOQMXnC7n6UCTY8B 1VJSEC/yYS331aZmAllHDBJgzB+/8RvwzR4OF7+sC6L3YrpQ2W62GKf49c0S0xqk3QDs lUtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature:arc-authentication-results; bh=bxtH7dstsGe08TBmdR4VNWp19oOwjqivRgz/i0qaPRI=; b=c1aVohZd+K2hOHDoCzZ1nRObfOKz6CRq1Uh92DrDVOTIgDN++ec2LoYbT1uE5ceomN yEAuqfv3R3C/adwXbY99jG3Fgj9b6ENIBnGu7rXqnE2+8t0ds2Y3ujLJDU4Dobr5P3ip 3wsFnUGU80KlKrzPWXpgwdmBuXlD0VFl9rQqDQFEMZpmK5YAKfqnd536KDI2B2OqxoQp tlzSuKvx532cuXxkkKREK8r5nHdowgWJ8lolq5Z3uijOxL0RPpVN8WPW7S2dk7IRRaVY 6tQ7RpFRZ76y4EFxPVb87XGh/rTaGREs8+THDI25gZKAimYBzmPsadLmTgQ2N0R9b3ID krUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=CihSxTXQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si8514338plt.194.2017.10.04.00.19.09; Wed, 04 Oct 2017 00:19:23 -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=@virtuozzo.com header.s=selector1 header.b=CihSxTXQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbdJDHSa (ORCPT + 99 others); Wed, 4 Oct 2017 03:18:30 -0400 Received: from mail-he1eur01on0127.outbound.protection.outlook.com ([104.47.0.127]:61243 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751156AbdJDHS1 (ORCPT ); Wed, 4 Oct 2017 03:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bxtH7dstsGe08TBmdR4VNWp19oOwjqivRgz/i0qaPRI=; b=CihSxTXQfLDgG1x7M8wJ6ZnvwP5IspMfMP/nE4DtbOo5kmtjPxKL59LTljA1daHeqqVafDkZpUAcJ903rXgFd95ED2mEijblitn/nyccx75AkbIAj6YjlLVF0F4EE4Nqehj1dqU5GHjnwb23+qLvp7kYRnEp6A1EJAAsE3VsHEk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ptikhomirov@virtuozzo.com; Received: from [172.16.24.163] (195.214.232.6) by HE1PR08MB0970.eurprd08.prod.outlook.com (2a01:111:e400:c523::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 4 Oct 2017 07:18:22 +0000 From: Pavel Tikhomirov Subject: Re: [PATCH] scsi/eh: fix hang adding ehandler wakeups after decrementing host_busy To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Konstantin Khorenko , devel@openvz.org References: <20170905125424.15412-1-ptikhomirov@virtuozzo.com> Message-ID: <6d2ebf68-4fcf-6584-4351-262d75a95fa2@virtuozzo.com> Date: Wed, 4 Oct 2017 10:18:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170905125424.15412-1-ptikhomirov@virtuozzo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5P189CA0009.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::22) To HE1PR08MB0970.eurprd08.prod.outlook.com (2a01:111:e400:c523::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8a7ec91-d25e-433b-4afe-08d50af818f5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:HE1PR08MB0970; X-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V0liEuBO/4LBMqA2Mq10JhFrr8oS1Ka4L0m+662mtJy56Q+aTNtlj40U6dLBW6YYM8UrzdGiwTkwmWz9aCfFXlEhuD5FUudMzeG7j9EeXgzoyBgvAk0h/ToWQjSRNUCw6h/CDPkTlAsTBMahvx11ytwirlzmrT1sGZvUCD6MX/Frbwd/F/PMeZrhTJT5Dy2TBUN90Rambkz8aAxNwtHC/WL6EPo8nMkxkK9j+LcvIP9FD5tpipQznsF46G24q9zlt/OTC2O9yns9vbjdVMwHATp8OIo9EeBxEf5lLb0A/UzSx60QIDOdt37KlE=;4:GKbCvkmg8SIN6aOvpYOb9VQsazQZ9kj5bBzw1/PljacEQdqHkvT+nwFWHUJktv1SMkPGidNtuD4u0i1cWS4J6OHHKi5/w5RVNtGQmB9EOJ27FQZ4N8/z3X1+wUF5wJtsfUmi4B3Xf3iWuc2W4uxTEtAT7gZCWsePnxHW4s+Kanc8XY3Mhb2guvfB04Q9zElqggUA3UUAmgaPGMiPyhgm3H4irxv9O/S/w/bqSM8Z/6BExx56OGFGoC64E7Y6cM1I X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(20161123555025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR08MB0970;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR08MB0970; X-Forefront-PRVS: 0450A714CB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(376002)(346002)(377454003)(24454002)(199003)(189002)(58126008)(5660300001)(316002)(64126003)(86362001)(31696002)(189998001)(230700001)(33646002)(3846002)(6116002)(106356001)(16526018)(50466002)(81156014)(65826007)(36756003)(68736007)(105586002)(107886003)(54906003)(23676002)(54356999)(76176999)(16576012)(110136005)(50986999)(83506001)(478600001)(25786009)(31686004)(77096006)(4326008)(8676002)(53936002)(229853002)(97736004)(6666003)(305945005)(65956001)(66066001)(6246003)(65806001)(7736002)(2950100002)(2906002)(101416001)(8936002)(6486002)(53546010)(81166006)(47776003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR08MB0970;H:[172.16.24.163];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4TUIwOTcwOzIzOmVEbzI3UzJSVXVneEUrcGUyVXMyZ1ZMckRF?= =?utf-8?B?ajhibE5OR2w1Mm1FN3RDNktTVmYxRWJQVTM3dDhvV0VlN1I2M2pnTXNOL2F6?= =?utf-8?B?TG5kcjcvTWFlMWZ1WlFBOUZuL2p6MDBVckoxQkRyTjM1S1hveHJBaGZ4RTZ2?= =?utf-8?B?bGhwTmdjSERjYmZGMWtPTUxmdmcvZXY2RWJtZDdxM1d3ZTBabFdvZ2QwMWNJ?= =?utf-8?B?dTNtTi9tazlsaEN2ZUZtZzF0a3F4THJNY255RmNVc0M0cTFWeURIdCtVeko1?= =?utf-8?B?dGVXbGJyL0t1R0tOZzE3N2puYVoxNzIvMVRTeFhhSm8wUWF1VmVRQUlqTG84?= =?utf-8?B?OFZ5U28ya1BmMFRHa3g1VGdvcDNaNlE1QnFyd1dPYzdFd2trMHp4VEFBM1Rj?= =?utf-8?B?SHBNWXdkdnorNWVZVHNpSzkvY1NXMjR5aUo5WXNJRWxOZFRyLzY3OHVGSjNE?= =?utf-8?B?SkpWelhrQ2dSOVNod2dwa2tVQmlBdXRmODhmaW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x48eVe7dveDYPJXrOv4mzsxXell38CgUZmJCCcDiePnA==;24:vcRtifmV5bp2LL1tdmHsJqdHjyeJwbiyG5jEhEy/7DqBF/fYBTOR6zG8IGGLnfcIUQQAxuVSeSrH2zYwwtIZJXlr/4uAz2bIN6WY9LgYKNg=;7:zGJF0hR3oq1X+rkE7LGKTgKwMdm/kjdDFRVd5Pdae9Ps79FqOOaV4G7R0qrJnCjykhXSgCcuvU8nHxrASeNps/VH5VsiFsVxB6UMCoL4+q1FblwLNIaiGHXLqn64Atd65AZWuSizABxiPMtF82lGmfrIo1/Eu5yfrJT2Mjtz1V2r/Kjip5fEzVHtIoBqPpojqi6MiMgaC3+CDhXm6C/1l6yGVtJXhZYNKyuqwsU9x7c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0970;20:7XvJWCpRDoU5JCuO8tSYgjjGab3GfO6OJ+JSE3ncCJGvMA69GqtiNlICegoShYxG04AG3rm4zJuy4lMcf+CshYGcntO34lPf7IEjxw38jPEh5E6MF3eVhtR2aDZrAU+8aF+/lEOnky/NVcJTX5G7TZanu12L7mgLWuVGVMB/6u8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2017 07:18:22.2501 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0970 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi. Please tell if there is something I can do to help the patch get processed? It is on the list without reply for almost a month. On 09/05/2017 03:54 PM, Pavel Tikhomirov wrote: > We have a problem on several our nodes with scsi EH. Imagine such an > order of execution of two threads: > > CPU1 scsi_eh_scmd_add CPU2 scsi_host_queue_ready > /* shost->host_busy == 1 initialy */ > > if (shost->shost_state == SHOST_RECOVERY) > /* does not get here */ > return 0; > > lock(shost->host_lock); > shost->shost_state = SHOST_RECOVERY; > > busy = shost->host_busy++; > /* host->can_queue == 1 initialy, busy == 1 > * - go to starved label */ > lock(shost->host_lock) /* wait */ > > shost->host_failed++; > /* shost->host_busy == 2, shost->host_failed == 1 */ > call scsi_eh_wakeup(shost) { > if (host_busy == host_failed) { > /* does not get here */ > wake_up_process(shost->ehandler) > } > } > unlock(shost->host_lock) > > /* acquire lock */ > shost->host_busy--; > > Finaly we do not wakeup scsi_error_handler and all other commands > coming will hang as we are in never ending recovery state as there > is no one left to wakeup handler. > > So scsi disc in these host becomes unresponsive and all bio on node > hangs. (We trigger these problem when scsi cmnds to DVD drive timeout.) > > Main idea of the fix is to try to do wake up every time we decrement > host_busy or increment host_failed(the latter is already OK). > > Now the very *last* one of busy threads getting host_lock after > decrementing host_busy will see all write operations on host's > shost_state, host_busy and host_failed completed thanks to implied > memory barriers on spin_lock/unlock, so at the time of busy==failed > we will trigger wakeup in at least one thread. (Thats why putting > recovery and failed checks under lock) > > Signed-off-by: Pavel Tikhomirov > --- > drivers/scsi/scsi_lib.c | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index f6097b89d5d3..6c99221d60aa 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -320,12 +320,11 @@ void scsi_device_unbusy(struct scsi_device *sdev) > if (starget->can_queue > 0) > atomic_dec(&starget->target_busy); > > + spin_lock_irqsave(shost->host_lock, flags); > if (unlikely(scsi_host_in_recovery(shost) && > - (shost->host_failed || shost->host_eh_scheduled))) { > - spin_lock_irqsave(shost->host_lock, flags); > + (shost->host_failed || shost->host_eh_scheduled))) > scsi_eh_wakeup(shost); > - spin_unlock_irqrestore(shost->host_lock, flags); > - } > + spin_unlock_irqrestore(shost->host_lock, flags); > > atomic_dec(&sdev->device_busy); > } > @@ -1503,6 +1502,13 @@ static inline int scsi_host_queue_ready(struct request_queue *q, > spin_unlock_irq(shost->host_lock); > out_dec: > atomic_dec(&shost->host_busy); > + > + spin_lock_irq(shost->host_lock); > + if (unlikely(scsi_host_in_recovery(shost) && > + (shost->host_failed || shost->host_eh_scheduled))) > + scsi_eh_wakeup(shost); > + spin_unlock_irq(shost->host_lock); > + > return 0; > } > > @@ -1964,6 +1970,13 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, > > out_dec_host_busy: > atomic_dec(&shost->host_busy); > + > + spin_lock_irq(shost->host_lock); > + if (unlikely(scsi_host_in_recovery(shost) && > + (shost->host_failed || shost->host_eh_scheduled))) > + scsi_eh_wakeup(shost); > + spin_unlock_irq(shost->host_lock); > + > out_dec_target_busy: > if (scsi_target(sdev)->can_queue > 0) > atomic_dec(&scsi_target(sdev)->target_busy); > -- Best regards, Tikhomirov Pavel Software Developer, Virtuozzo. From 1577704452897311330@xxx Tue Sep 05 12:56:55 +0000 2017 X-GM-THRID: 1577704452897311330 X-Gmail-Labels: Inbox,Category Forums