From owner-freebsd-fs@freebsd.org Sat Nov 25 16:25:06 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BD92DEA369 for ; Sat, 25 Nov 2017 16:25:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0E626517D for ; Sat, 25 Nov 2017 16:25:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id g73so32152947ioj.8 for ; Sat, 25 Nov 2017 08:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=INwbRnB4Pq35fT3wBMoGQsVmSwWa8Uzwez6+ZA+Wong=; b=o4Lmv1sLgXpR/W5FxIK2W45MqgEm3eW1Q5ufZLaYxdVob4ZMzks09gm/T4uP9N9Czp CIHLWgrcFtzMHk72QQ30gTLcb7ueVSnkl93kNn9yZ2SiivsEjgC4hZ+Wd1xdGYVwPt69 Bxa9DOJWxg0j9GZK0CuG1hXsqoepbmoFe3tW9Os9vcifNd74bt1jhLuESf4WAYLmZq4t iGVRmCO+CDylOKHMKdtfxC6brOQpXAwYYgE+7CmtDg1WF3dAqOKduG47bgQroIouiM9+ 7Xv11ziBUg9z51DMiF9yVBGvAXXp2xqr3QCeRv0kPRTBGC8q/VWbv80T1JOh8gOU2BGl X59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=INwbRnB4Pq35fT3wBMoGQsVmSwWa8Uzwez6+ZA+Wong=; b=aTSKjLksQ5vHkhUo00gK1W0iTQu0EX8o2vz7h/JBYJtqfOSW4Kz57jajdn7XtmZ/ls UtVY9fbfWum8CCY0j4I7JcNal6pHT/YB4uENHI1kIP14Xtn3JGNoNaEl0sq1WdXbxSW6 eUzNa/MfpJ+/VtsC0Nz37d9OwRa8p1hcYkzmsfcU8Xb3EW7QyQPsl088HOToLMkfypT6 XSSRlkeK7AWRXHUtehcxQDVnseGvB73WNFNrJqhvb/pQyNM5v7w+Lg/wgzV7DHRSiucu aAg47NK4Sv10tW7jlf0pyGI9bUgsxxs9/XF0kLsWUKCJH+xIZfY+UwWOhElZNWOlCPa0 HX1Q== X-Gm-Message-State: AJaThX6blUDrZbR7SIhgiUGXkHFtREatn/P+o5h6G4NEp2T2H1rn+KXz FZzlZT4DKt/b6/DiiYabPEXjvtKRqFjl51VvZqo+0A== X-Google-Smtp-Source: AGs4zMZe+RePIe6UOmoCphMhiNYDZUz/+iu/mFebQM7KQ1V+YUeenNjnfy6CxK0Ko06+ny1hO6AXLOlxM8WMxivNo20= X-Received: by 10.107.81.24 with SMTP id f24mr35218615iob.63.1511627105118; Sat, 25 Nov 2017 08:25:05 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 25 Nov 2017 08:25:04 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:9579:bb73:7b7f:aadd] In-Reply-To: References: <391f2cc7-0036-06ec-b6c9-e56681114eeb@FreeBSD.org> <64f37301-a3d8-5ac4-a25f-4f6e4254ffe9@FreeBSD.org> <39E8D9C4-6BF3-4844-85AD-3568A6D16E64@samsco.org> From: Warner Losh Date: Sat, 25 Nov 2017 09:25:04 -0700 X-Google-Sender-Auth: dkGLRA2lZh9ar81kx7rluRa6pgo Message-ID: Subject: Re: add BIO_NORETRY flag, implement support in ata_da, use in ZFS vdev_geom To: Andriy Gapon Cc: Scott Long , FreeBSD FS , freebsd-geom@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2017 16:25:06 -0000 On Fri, Nov 24, 2017 at 10:17 AM, Andriy Gapon wrote: > On 24/11/2017 16:57, Scott Long wrote: > > > > > >> On Nov 24, 2017, at 6:34 AM, Andriy Gapon wrote: > >> > >> On 24/11/2017 15:08, Warner Losh wrote: > >>> > >>> > >>> On Fri, Nov 24, 2017 at 3:30 AM, Andriy Gapon >>> > wrote: > >>> > >>> > >>> https://reviews.freebsd.org/D13224 D13224> > >>> > >>> Anyone interested is welcome to join the review. > >>> > >>> > >>> I think it's a really bad idea. It introduces a 'one-size-fits-all' > notion of > >>> QoS that seems misguided. It conflates a shorter timeout with don't > retry. And > >>> why is retrying bad? It seems more a notion of 'fail fast' or so othe= r > concept. > >>> There's so many other ways you'd want to use it. And it uses the same > return > >>> code (EIO) to mean something new. It's generally meant 'The lower > layers have > >>> retried this, and it failed, do not submit it again as it will not > succeed' with > >>> 'I gave it a half-assed attempt, and that failed, but resubmission > might work'. > >>> This breaks a number of assumptions in the BUF/BIO layer as well as > parts of CAM > >>> even more than they are broken now. > >>> > >>> So let's step back a bit: what problem is it trying to solve? > >> > >> A simple example. I have a mirror, I issue a read to one of its > members. Let's > >> assume there is some trouble with that particular block on that > particular disk. > >> The disk may spend a lot of time trying to read it and would still > fail. With > >> the current defaults I would wait 5x that time to finally get the erro= r > back. > >> Then I go to another mirror member and get my data from there. > > > > There are many RAID stacks that already solve this problem by having a > policy > > of always reading all disk members for every transaction, and throwing > away the > > sub-transactions that arrive late. It=E2=80=99s not a policy that is a= lways > desired, but it > > serves a useful purpose for low-latency needs. > > That's another possible and useful strategy. > > >> IMO, this is not optimal. I'd rather pass BIO_NORETRY to the first > read, get > >> the error back sooner and try the other disk sooner. Only if I know > that there > >> are no other copies to try, then I would use the normal read with all > the retrying. > >> > > > > I agree with Warner that what you are proposing is not correct. It > weakens the > > contract between the disk layer and the upper layers, making it less > clear who is > > responsible for retries and less clear what =E2=80=9CEIO=E2=80=9D means= . That contract > is already > > weak due to poor design decisions in VFS-BIO and GEOM, and Warner and I > > are working on a plan to fix that. > > Well... I do realize now that there is some problem in this area, both > you and > Warner mentioned it. But knowing that it exists is not the same as > knowing what > it is :-) > I understand that it could be rather complex and not easy to describe in = a > short > email... > > But then, this flag is optional, it's off by default and no one is forced > to > used it. If it's used only by ZFS, then it would not be horrible. > Except that it isn't the same flag as what Solaris has (its B_FAILFAST does something different: it isn't about limiting retries but about failing ALL the queued I/O for a unit, not just trying one retry), and the problems that it solves are quite rare. And if you return a different errno, then the EIO contract is still fulfilled. > Unless it makes things very hard for the infrastructure. > But I am circling back to not knowing what problem(s) you and Warner are > planning to fix. > The middle layers of the I/O system are a bit fragile in the face of I/O errors. We're fixing that. Of course, you still haven't articulated why this approach would be better, nor show any numbers as to how it makes things better. Warner