From owner-freebsd-fs@freebsd.org Sat Nov 25 16:58:38 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 49CC2DEADA2; Sat, 25 Nov 2017 16:58:38 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 EF135662E9; Sat, 25 Nov 2017 16:58:37 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f43.google.com with SMTP id g35so28372631lfi.13; Sat, 25 Nov 2017 08:58:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sNmBbqSvUdx+P0oBQz+HZ0eKlahQ3p0XcaiUMbppq94=; b=ZbYvg6jV7ktmRiS8wYCaHCHERogGTOY8Npky+qYT3+jp5cvvlWMDTohvMf13T44Fdv k856mLl06msqEevycDCZqvaFy0z5P3D6LMuQ2Rn7DVPWeGsye+F4EWW6zh3Y7gxBsger JFKzBWv/XiRArbdOYW5TR8jZK1Lx1D5qXkXR76XQ58heVIThtOfG7cUcC5zx/5TQeIwQ cp4kxE1gfRKxSKmH/RSi+9hnLBUtUa/xjZEWYEwIFnLTo7pv+BDKliFtJ1YR/B+RCb9j dzz236S/DUb0Eq3E4iKj0A33npuswtiw1G1Gs4F+6Nd3eCdYW2xuzSt1y8Q3X52P2V5P gf6w== X-Gm-Message-State: AJaThX4KWIf7Tpc0YteQA1eyDsSBQ5luze6tAgx0c7ZK5PjfjH7VPL1F Ad3nYuZRatRAfec5FodPk03zwUJoS3g= X-Google-Smtp-Source: AGs4zMaPazeEKorA20LgfmuxaRUD4LZnRTIi/eMwruMrxb9Wv325OBtJQl3mgpdxVZyMEiz1uxJGig== X-Received: by 10.25.20.77 with SMTP id k74mr9606078lfi.80.1511629110179; Sat, 25 Nov 2017 08:58:30 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id v12sm5027560ljd.15.2017.11.25.08.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Nov 2017 08:58:29 -0800 (PST) Subject: Re: add BIO_NORETRY flag, implement support in ata_da, use in ZFS vdev_geom To: Warner Losh Cc: Scott Long , FreeBSD FS , freebsd-geom@freebsd.org References: <391f2cc7-0036-06ec-b6c9-e56681114eeb@FreeBSD.org> <64f37301-a3d8-5ac4-a25f-4f6e4254ffe9@FreeBSD.org> <39E8D9C4-6BF3-4844-85AD-3568A6D16E64@samsco.org> From: Andriy Gapon Message-ID: <27c9395f-5b3c-a062-3aee-de591770af0b@FreeBSD.org> Date: Sat, 25 Nov 2017 18:58:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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:58:38 -0000 On 25/11/2017 18:25, Warner Losh wrote: > > > 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 > > > >>> > >>>    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 other > 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 error 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’s not a policy that is always > 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 “EIO” 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.  Yes, it isn't the same. I think that illumos flag does even more. > 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. What are the middle layers? > Of course, you still haven't articulated why this approach would be better Better than what? > nor > show any numbers as to how it makes things better. By now, I have. See my reply to Scott's email. -- Andriy Gapon