Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp829910pxf; Thu, 18 Mar 2021 12:35:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLZYvcb35BqE7eL4kEbNDI0lRCZwSELIUgfa0Om3AKgzlG/KqUKO3OAUzWxxLGv6fbme+D X-Received: by 2002:a17:906:f210:: with SMTP id gt16mr217305ejb.206.1616096101475; Thu, 18 Mar 2021 12:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616096101; cv=none; d=google.com; s=arc-20160816; b=Nt1xWuN5xW9lJm+iG+qVSJqXJyRD9K1wBRKaDvFAtg3Zwlx0rhzKSAX/J6JMucdu6b 81yCTPNzpCEk4Lv/O2GiTcYHylLS6U8OJUpcBE8o08kOfmuejnPwjcodkULkbcNRn46d SomkmzxNfpPFdk5ImVNu4hbZYRRlDnMFvoBI/IdEjEdGtn2eUeqUtHjAf7ULPAGZymyR h8GhQAKqxM7+qmnnbRigf+em+S+Ny22y2pDQd1HHAZdJaZZuC0nAuam5eVmXyaipiwJd sOJzOmK3OG+hvR4j4NpZURi6J8qWZk8PQUs79//Ovszgkr78JsxJbjULH2s5s1t/I/vC HAyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vF60li03DLVeGdeABiyKCpKx18oxi8Zc2f6uqd8W8yg=; b=MKf9o/5CcYlMr++fvitjJYpLHcDw4YuvF9fA4QLGCVwUtNXpYfgX53yYXuwqokGqAt I3lh6TapL6taC6emDZ6YO/STr65mq4dj4GmL7C01L8X4NLq41E9B1b8O3/NiYoBjnMOB RnFOW58JfuISkElgVtpjrcp2EKGwXX7osM2WFLulKd6WARKccU3Y0b1/zgAe4YZhF6cJ ZxamfrGIBco5Qx0sgb1EsNJovim6n0teZs2Zaf0G5wN0f5N0t6WGCBKNwHzN7dSHBgAx //ZfePmwfssi8hEEzz/UF0Ia4iKrdfZJVKcVFWM6cCHy9evFqJyHghEET7SuJnvYmuJ7 Prvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co11si2183408edb.280.2021.03.18.12.34.37; Thu, 18 Mar 2021 12:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232654AbhCRTdn (ORCPT + 99 others); Thu, 18 Mar 2021 15:33:43 -0400 Received: from mail-pl1-f178.google.com ([209.85.214.178]:44832 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbhCRTdT (ORCPT ); Thu, 18 Mar 2021 15:33:19 -0400 Received: by mail-pl1-f178.google.com with SMTP id q11so1814347pld.11; Thu, 18 Mar 2021 12:33:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vF60li03DLVeGdeABiyKCpKx18oxi8Zc2f6uqd8W8yg=; b=NVhG6puBq9ML23QI4KIUNrN2VetdX7hLAnNHBxrZNTT6/KlorZMY03Sp55K+upBaji +2+t0l1V6gfIKgBuX516W2IS7OEzfzP/Luv4aJjvSNb7f21qNvd9C/DKFMJe/zrcWsp9 QS453rQbLarJYk80UU2Kbioqrx9gHrPI7TgAA96sJUexZ2huHfYIEBSs8t6s07MX1rmH 7ntonw/Xx6kW1Q+upDSH/I1s0v16+eTV3+bqAI+Yo8o74pE75yFejkCD5dSC9aaT23WA A12kDlYO4WIrizxCCrP50+ev8l1eziU7Q1SfGPHkUan3HeUiKAqDPGfgdOuKP/0TdTTm IGMw== X-Gm-Message-State: AOAM530hquAgACli7932nzYdK/+1YOsYb5+JnW1BS+NKb6OsDcDsIE88 m2nN6ssG+jCFe4wPr3nHqs8= X-Received: by 2002:a17:902:a606:b029:e6:4c7e:1cba with SMTP id u6-20020a170902a606b02900e64c7e1cbamr10802226plq.46.1616095998733; Thu, 18 Mar 2021 12:33:18 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id w188sm3207891pfw.177.2021.03.18.12.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 12:33:17 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 0508E40244; Thu, 18 Mar 2021 19:33:17 +0000 (UTC) Date: Thu, 18 Mar 2021 19:33:16 +0000 From: Luis Chamberlain To: linux-block@vger.kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, hare@suse.de, mcgrof@kernel.org Subject: Re: blktests: block/009 next-20210304 failure rate average of 1/448 Message-ID: <20210318193316.GS13911@42.do-not-panic.com> References: <20210316174645.GI4332@42.do-not-panic.com> <20210316184739.GJ4332@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210316184739.GJ4332@42.do-not-panic.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 06:47:39PM +0000, Luis Chamberlain wrote: > On Tue, Mar 16, 2021 at 05:46:45PM +0000, Luis Chamberlain wrote: > > I've managed to reproduce blktests block/009 failures with kdevops [0] > > on linux-next tag next-20210304 with a current failure rate average of > > 1/448 (3 counted failures so far). > > Confirmed on next-20210316 with current failure rate at 1/1008 Just in case this was a scsi_debug issue instead (I am covering that prospect on another bug just for scsi_debug korg#212337 [0]) I tried a userspace solution based on what I have observed I still can reproduce this block/009 failure. The failure rate is much lower though, I have it now at 1/1705 but alas it is still failing. [0] https://bugzilla.kernel.org/show_bug.cgi?id=212337 The patch below demonstrates the exra settle work for scsi_debug attempted, and with it, this is still failing. So either the settle work needs *more* effort, or this is a real issue. diff --git a/common/scsi_debug b/common/scsi_debug index b48cdc9..ecdbcc6 100644 --- a/common/scsi_debug +++ b/common/scsi_debug @@ -8,13 +8,42 @@ _have_scsi_debug() { _have_modules scsi_debug } +# As per korg#212337 [0] we must do more work in userspace to settle +# scsi_debug devices a bit more carefully. + +# [0] https://bugzilla.kernel.org/show_bug.cgi?id=212337 +_settle_scsi_debug_device() { + SCSI_DEBUG_MAX_WAIT=10 + SCSI_DEBUG_COUNT_WAIT_LOOP=0 + while true ; do + if [[ -b $1 ]]; then + SCSI_DEBUG_LSOF_COUNT=$(lsof $1 | wc -l) + if [[ $SCSI_DEBUG_LSOF_COUNT -ne 0 ]]; then + sleep 1; + else + break + fi + else + # Let device come up + sleep 1 + + let SCSI_DEBUG_COUNT_WAIT_LOOP=$SCSI_DEBUG_COUNT_WAIT_LOOP+1 + if [[ $SCSI_DEBUG_COUNT_WAIT_LOOP -ge $SCSI_DEBUG_MAX_WAIT ]]; then + break + fi + fi + done +} + _init_scsi_debug() { if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then return 1 fi - udevadm settle + # Allow dependencies to load + sleep 1 + local host_sysfs host target_sysfs target SCSI_DEBUG_HOSTS=() SCSI_DEBUG_TARGETS=() @@ -43,6 +72,10 @@ _init_scsi_debug() { return 1 fi + for i in $SCSI_DEBUG_DEVICES ; do + _settle_scsi_debug_device /dev/$i + done + return 0 }