Received: by 10.223.164.202 with SMTP id h10csp321156wrb; Thu, 9 Nov 2017 06:55:17 -0800 (PST) X-Google-Smtp-Source: ABhQp+S90kBeCCoJmrHOhaPQKSBWUGns92kHF1izetfNomlOMmJV/AjbxiIxMnipMae37AR2zOPL X-Received: by 10.159.218.73 with SMTP id x9mr698544plv.259.1510239317452; Thu, 09 Nov 2017 06:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510239317; cv=none; d=google.com; s=arc-20160816; b=Ut1qL+K7UGb2kSEsISkhJQHaqvpuqlZZD/4b/ecqckuBtbbIypHK3H6SoQviqP6C7C heRglTP1iWmXA+azGy4VMJ/3oDeHzNBAIrW4m4TspAdcfq8OCVu4PxBBb6LuxIg51N9H e1zuCGR0RheMr6zUswNabd8fGQs0eRfaCVGn8dANeojgDyegA2P2kYA4vV3jnHUNraJH /Km2qrXcYUWvl/udQ193B12q+gABmXLEdbF/Y1/Wm4hvINWTHf1xZg8MkkE8+oF7sRl3 RMmQHMr7wlVQ0iAnkYeEpgsNiS7nxFhlIPwv/OEKRXVMSTXVIauReosQdWrF1RNilh61 3zkg== 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:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=+DZjOsHzA8h/CoUiW93lV38uZWnP1Wr0TS4QrUHz/WM=; b=NlAxB+sMxILuU4gAR4Tk+Zd/4QgG16/wKuce5t0L+/u2xeVcTJTERgT75hU9yTm5eF JdZtk5YIxI/FWE/A+/bBOwKS7gDtxeFvDtr73XW1XniMhmDIOuTmM9AvGFc/j3tnyrO5 Azr5ZF91xlkE4JTnCl0XpcptPGSajkn06On6JSZFRZrk/7VVSXZNzpeFb+06uaOCzC7n 2w7hgbxiy/xInKUOkQCbvoilwenN0A1Q8L1bBLsDPVGcXTCshDoUnPt0MCyy5Mh2JUe7 4k6zVa8i7OPQ7FAS9TvBmLW8CRh+C+C3fN8f7mfzAsT0TRCxAnEGkcb0IA5psx+3bzcS CwmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fx3sQS0O; 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 44si6661504pla.164.2017.11.09.06.55.05; Thu, 09 Nov 2017 06:55:17 -0800 (PST) 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=fx3sQS0O; 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 S1752903AbdKIOyT (ORCPT + 80 others); Thu, 9 Nov 2017 09:54:19 -0500 Received: from mail-ve1eur01on0093.outbound.protection.outlook.com ([104.47.1.93]:56240 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751003AbdKIOyQ (ORCPT ); Thu, 9 Nov 2017 09:54:16 -0500 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=+DZjOsHzA8h/CoUiW93lV38uZWnP1Wr0TS4QrUHz/WM=; b=fx3sQS0OGnZwwIB2VMlJ1OkDyPk7bueub/cL72kTJPj06m51c43MfyrdsGCfkdEujKo7d0Gr/z5fyNAtHVfhgTF6bnv2X3GTaNyKZ+gBeQ5qDDNtnWpyFzSTXvmkobHwqDEsnpHIjn6IqkfzBhaVDeU/Fn98hLCjMs3ugyfCSj8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ptikhomirov@virtuozzo.com; Received: from [172.16.24.163] (195.214.232.6) by DB5PR08MB0968.eurprd08.prod.outlook.com (2603:10a6:0:13::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 9 Nov 2017 14:54:12 +0000 Subject: Re: [PATCH] scsi/eh: fix hang adding ehandler wakeups after decrementing host_busy To: Stuart Hayes Cc: "James E . J . Bottomley" , "Martin K . Petersen" , Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Konstantin Khorenko , devel@openvz.org References: <20170905125424.15412-1-ptikhomirov@virtuozzo.com> From: Pavel Tikhomirov Message-ID: <496d6c6e-565b-9ebb-59b4-d4b17e0d9a62@virtuozzo.com> Date: Thu, 9 Nov 2017 17:54:09 +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: AM5P189CA0033.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::46) To DB5PR08MB0968.eurprd08.prod.outlook.com (2603:10a6:0:13::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f10556b7-0d10-414d-184e-08d52781be09 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249);SRVR:DB5PR08MB0968;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DSfxed75hTBVo0Mo9JdBFJ7bbXkl6Yh8lFQSehI88TRxDoaS90bML3+vGW4IBNcAwmeUvRqd3OcE50c9NFeR2ksTDw63ISWe0ysl4njR2nShDXbQdX7JQ7JSFxyMhRl8Hf1z8lqlfKnyuKg60okFkOM38FOnKLtoDNxEipOKmwFy6u3iZ9WVZc18Qnsv3wCL5uavWF/lw7H8vnkiwfAmwVNzxloQSbgLVD2ZdlYZpW4dzo3pREestxXegVUBMAPZQQyb1OwYVz2btjnB24sRcBbFr5kLA4pX50SpFgvOeZIqKu6pk=;4:yHWpr7r6EuyNdrlBMc2Y+SYLEWwAZAhFYFF5/IHY5dAE+uvztJgd4+17wmvey/R+S6CAZ3k4M9lL4mXxzzZGD6wgk/c6rXDGUJT1ywpG8/J4+Yen4WKdDvNmSbSM0uzm93/FincgCwlimk+RDzE4JwbJGxKZz00IWVdqP+saE5LUZaja4iGmS8s3QZKF9tEVo+HHKjTqCiqzKkbL/IiQ2MFo2S53Rmmws848RHyO9L+NGqQu+ec+h/YjT4ALHwYItZZeurtePKHXjDcXwdhQrw== 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)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(3231021)(10201501046)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DB5PR08MB0968;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DB5PR08MB0968; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(346002)(376002)(24454002)(199003)(189002)(6246003)(5660300001)(36756003)(65826007)(107886003)(478600001)(50466002)(31686004)(58126008)(305945005)(6486002)(77096006)(230700001)(97736004)(6306002)(54906003)(229853002)(2906002)(4326008)(39060400002)(54356999)(76176999)(81166006)(65806001)(101416001)(105586002)(8676002)(7736002)(53936002)(3846002)(65956001)(86362001)(68736007)(106356001)(81156014)(6116002)(66066001)(64126003)(8936002)(2950100002)(6666003)(25786009)(6916009)(316002)(16526018)(83506002)(67846002)(23676003)(50986999)(53546010)(189998001)(33646002)(16576012)(47776003)(31696002)(3714002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR08MB0968;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?MTtEQjVQUjA4TUIwOTY4OzIzOlBZc3pUNnpzYzBCYlF3TGo5UVN6MklJTllj?= =?utf-8?B?eElTWERKc25wZTB1dm1Gd0EyWVlnT0ZpdDUwSWR6YzB5cG8rOGRwcXZVVy8r?= =?utf-8?B?Zm9KbVU1NlVINkg5U25mL3pwaGFCM0hIRmZyR0psMGxiYWFmY2Vmd2pMcmNY?= =?utf-8?B?YlNBaGZ3NGVzc0c5SGlvQnBxY21tMjRwTCsvTXE3aVc2eTVoVjZabG50elFQ?= =?utf-8?B?NVVpREdyemtXVkhjTkhrQS9SOGtjZWQ4OHRKeFpXSU1FZmpmd3c1ZHplV1Bh?= =?utf-8?B?akJhV0hiMFMya1ZjR3NrRko0cytkeHpSYnhTOG9iNnU5VGgrdmliRmxLVW96?= =?utf-8?B?RGtIM3BSWXpUVGlNSGJWQm04eHJNTUtYVGV4bEpPM2lHUEs4OU1hR05rK0Nz?= =?utf-8?B?QjBJNjVXekRHWEdmcXQrWHI5ZmN1YWtub1VqQVdMYVhBTHBUbWZoeXluVkhm?= =?utf-8?B?ZWNYSENjdWF1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n9cFG/4k=;5:ApHCO2fL4qaTyqlRVR03WHhGe/5zUssYiqgAo/czFSnKgqZTXwfBTMn0r68a/8txCkkTLU4u2+o/Fb35BMw7MS9ybNhls+Xj6AiUb98sjO/dA1Cf1leQjeBte7/izoi0re8CbEzlu0S84OWgm3lLovf1WxzoVvrWKTQ29QfQO18=;24:rj7IkaZzHOzo5S1KuhDC+iRqq3fnm87rZ1rgAdbgMb2xJJ81S00cvs1qHp8pv4rOL+7q51OfYzl11csm6gY7+Skz6z0CQRz9nUSMH3p9C74=;7:ViaqnWePyYCOygPOIEZtUWoZw+Oc8O+ziyUHo6W1UFMeTngrCxCK39DtWsVYJz9Df64wue0g/POrw6YYhSu9H4tGJC/aQgLa8rvrlWWO7Xay27nMH/sKw1O9QNAoUA4Rh4kAKigAZ3X7R17ShBp3mnu9C3vinsY/3AYIBj2O0FO9HxGJGn9VDGId5QiOp3E3oVx8TUcR8scES3m52uYbbADm1hJMlA5IU4btaomGdNAGz4mRKfoHKXKgtZRZhIzP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0968;20:cOAznF5meFdLk83vaWoMRhuGNcib2Tu/F8OhccqYeCSmZ7Dpzj1tmcuVrlG6Mn2chPn5AZ1vbRYK9NXAkP4Eiy8N1mwiHpVnj7DKzzSPm5T3UsEC7povq4ewXlfSsltTYUu4fsi8DXczwWiGXO23bxMquy6pRl/rLG12l96bxXc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 14:54:12.8449 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f10556b7-0d10-414d-184e-08d52781be09 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB0968 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Are there any issues with this patch (https://patchwork.kernel.org/patch/9938919/) that Pavel Tikhomirov submitted back in September? I am willing to help if there's anything I can do to help get it accepted. Hi, Stuart, I asked James Bottomley about the patch status offlist and it seems that the problem is - patch lacks testing and review. I would highly appreciate review from your side and anyone who wants to participate! And if you can confirm that the patch solves the problem on your environment with no side effects please add "Tested-by:" tag also. Thanks, Pavel 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 1581762101445422647@xxx Fri Oct 20 07:51:30 +0000 2017 X-GM-THRID: 1577704452897311330 X-Gmail-Labels: Inbox,Category Forums