From owner-svn-src-all@FreeBSD.ORG Mon Feb 2 20:48:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65941551; Mon, 2 Feb 2015 20:48:04 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6BF89B; Mon, 2 Feb 2015 20:48:03 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id gf13so44933791lab.8; Mon, 02 Feb 2015 12:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=K22RmGNiZBZgmvktYBf0wIQugxiG3tYp8gjZtNn6TmM=; b=l8HFrVD25IgTlyQPAmH9d369PrJxxgq1KZ+sejD5SR1DsjRjNZdSh+W0UPwxju0JAa 4+u8hF6FdSRbuPzSYtREWhwLemAyW0ozPuzUc3whSnqzu92dqqhfHJLcb5ls5/64LMij u66foaA0bGu1eLy6BHbpCh9oAilbgc6Ua/S0Al3Pi/tOhibqj3aQ2v01uboE3s9qrp5W 6QEU4rgEtKI6tbytrVkdwid+4nQng6VptNnqrP+OWp3J4V++WSQebmWbJzU37nI+ssI7 oH5wAIDzfXmwNw20qe+fB9NNd7RjY/ukLKgCXsriXUlmYD5h3TKx1uWqI9UQ+MReWI1p pDlg== X-Received: by 10.152.198.200 with SMTP id je8mr21079205lac.93.1422910081970; Mon, 02 Feb 2015 12:48:01 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id c1sm4609350lah.45.2015.02.02.12.47.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 12:48:01 -0800 (PST) Sender: Alexander Motin Message-ID: <54CFE27E.8050602@FreeBSD.org> Date: Mon, 02 Feb 2015 22:47:58 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278111 - in head/sys/cam: . scsi References: <201502022023.t12KN6ir069698@svn.freebsd.org> <54CFDDFF.7060708@freebsd.org> In-Reply-To: <54CFDDFF.7060708@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 20:48:04 -0000 On 02.02.2015 22:28, Nathan Whitehorn wrote: > You may want to look at PR 195479 on this topic. Does this also turn off > the infinite console spam? This patch was supposed to only workaround issues I see when storage has a problem. In that case hiding messages is a bad idea, because admin should see that something goes wrong. So I didn't hide them. I don't know why would VMware report BUSY status regularly for disks under load, as mentioned in that PR. My patch should partially help in that case by avoiding errors reported to applications. But still each error like that freezes the device operation for one second before retry, so real cause still must be fixed or performance will heavily suffer. > On 02/02/15 12:23, Alexander Motin wrote: >> Author: mav >> Date: Mon Feb 2 20:23:05 2015 >> New Revision: 278111 >> URL: https://svnweb.freebsd.org/changeset/base/278111 >> >> Log: >> Retry indefinitely on SCSI BUSY status from VMware disks and CDs. >> >> VMware returns BUSY status when storage has transient connectivity >> issues. >> It is often better to wait and let VM admin fix the problem then >> crash. >> >> Discussed with: ken >> MFC after: 1 week >> >> Modified: >> head/sys/cam/cam.h >> head/sys/cam/cam_periph.c >> head/sys/cam/scsi/scsi_cd.c >> head/sys/cam/scsi/scsi_da.c >> >> Modified: head/sys/cam/cam.h >> ============================================================================== >> >> --- head/sys/cam/cam.h Mon Feb 2 20:18:47 2015 (r278110) >> +++ head/sys/cam/cam.h Mon Feb 2 20:23:05 2015 (r278111) >> @@ -121,7 +121,8 @@ enum { >> SF_QUIET_IR = 0x04, /* Be quiet about Illegal Request >> reponses */ >> SF_PRINT_ALWAYS = 0x08, /* Always print error status. */ >> SF_NO_RECOVERY = 0x10, /* Don't do active error >> recovery. */ >> - SF_NO_RETRY = 0x20 /* Don't do any retries. */ >> + SF_NO_RETRY = 0x20, /* Don't do any retries. */ >> + SF_RETRY_BUSY = 0x40 /* Retry BUSY status. */ >> }; >> >> /* CAM Status field values */ >> >> Modified: head/sys/cam/cam_periph.c >> ============================================================================== >> >> --- head/sys/cam/cam_periph.c Mon Feb 2 20:18:47 2015 (r278110) >> +++ head/sys/cam/cam_periph.c Mon Feb 2 20:23:05 2015 (r278111) >> @@ -1359,8 +1359,8 @@ camperiphscsistatuserror(union ccb *ccb, >> * Restart the queue after either another >> * command completes or a 1 second timeout. >> */ >> - if (ccb->ccb_h.retry_count > 0) { >> - ccb->ccb_h.retry_count--; >> + if ((sense_flags & SF_RETRY_BUSY) != 0 || >> + (ccb->ccb_h.retry_count--) > 0) { >> error = ERESTART; >> *relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT >> | RELSIM_RELEASE_AFTER_CMDCMPLT; >> >> Modified: head/sys/cam/scsi/scsi_cd.c >> ============================================================================== >> >> --- head/sys/cam/scsi/scsi_cd.c Mon Feb 2 20:18:47 2015 (r278110) >> +++ head/sys/cam/scsi/scsi_cd.c Mon Feb 2 20:23:05 2015 (r278111) >> @@ -87,14 +87,16 @@ typedef enum { >> CD_Q_NONE = 0x00, >> CD_Q_NO_TOUCH = 0x01, >> CD_Q_BCD_TRACKS = 0x02, >> - CD_Q_10_BYTE_ONLY = 0x10 >> + CD_Q_10_BYTE_ONLY = 0x10, >> + CD_Q_RETRY_BUSY = 0x40 >> } cd_quirks; >> >> #define CD_Q_BIT_STRING \ >> "\020" \ >> "\001NO_TOUCH" \ >> "\002BCD_TRACKS" \ >> - "\00510_BYTE_ONLY" >> + "\00510_BYTE_ONLY" \ >> + "\007RETRY_BUSY" >> >> typedef enum { >> CD_FLAG_INVALID = 0x0001, >> @@ -189,6 +191,14 @@ static struct cd_quirk_entry cd_quirk_ta >> { >> { T_CDROM, SIP_MEDIA_REMOVABLE, "CHINON", "CD-ROM >> CDS-535","*"}, >> /* quirks */ CD_Q_BCD_TRACKS >> + }, >> + { >> + /* >> + * VMware returns BUSY status when storage has transient >> + * connectivity problems, so better wait. >> + */ >> + {T_CDROM, SIP_MEDIA_REMOVABLE, "NECVMWar", "VMware IDE >> CDR10", "*"}, >> + /*quirks*/ CD_Q_RETRY_BUSY >> } >> }; >> >> @@ -2581,6 +2591,9 @@ cderror(union ccb *ccb, u_int32_t cam_fl >> * don't treat UAs as errors. >> */ >> sense_flags |= SF_RETRY_UA; >> + >> + if (softc->quirks & CD_Q_RETRY_BUSY) >> + sense_flags |= SF_RETRY_BUSY; >> return (cam_periph_error(ccb, cam_flags, sense_flags, >> &softc->saved_ccb)); >> } >> >> Modified: head/sys/cam/scsi/scsi_da.c >> ============================================================================== >> >> --- head/sys/cam/scsi/scsi_da.c Mon Feb 2 20:18:47 2015 (r278110) >> +++ head/sys/cam/scsi/scsi_da.c Mon Feb 2 20:23:05 2015 (r278111) >> @@ -101,7 +101,8 @@ typedef enum { >> DA_Q_NO_PREVENT = 0x04, >> DA_Q_4K = 0x08, >> DA_Q_NO_RC16 = 0x10, >> - DA_Q_NO_UNMAP = 0x20 >> + DA_Q_NO_UNMAP = 0x20, >> + DA_Q_RETRY_BUSY = 0x40 >> } da_quirks; >> >> #define DA_Q_BIT_STRING \ >> @@ -110,7 +111,9 @@ typedef enum { >> "\002NO_6_BYTE" \ >> "\003NO_PREVENT" \ >> "\0044K" \ >> - "\005NO_RC16" >> + "\005NO_RC16" \ >> + "\006NO_UNMAP" \ >> + "\007RETRY_BUSY" >> >> typedef enum { >> DA_CCB_PROBE_RC = 0x01, >> @@ -359,6 +362,14 @@ static struct da_quirk_entry da_quirk_ta >> {T_DIRECT, SIP_MEDIA_FIXED, "STEC", "*", "*"}, >> /*quirks*/ DA_Q_NO_UNMAP >> }, >> + { >> + /* >> + * VMware returns BUSY status when storage has transient >> + * connectivity problems, so better wait. >> + */ >> + {T_DIRECT, SIP_MEDIA_FIXED, "VMware", "Virtual disk", "*"}, >> + /*quirks*/ DA_Q_RETRY_BUSY >> + }, >> /* USB mass storage devices supported by umass(4) */ >> { >> /* >> @@ -3630,6 +3641,9 @@ daerror(union ccb *ccb, u_int32_t cam_fl >> * don't treat UAs as errors. >> */ >> sense_flags |= SF_RETRY_UA; >> + >> + if (softc->quirks & DA_Q_RETRY_BUSY) >> + sense_flags |= SF_RETRY_BUSY; >> return(cam_periph_error(ccb, cam_flags, sense_flags, >> &softc->saved_ccb)); >> } >> > -- Alexander Motin