From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D91631382C5 for ; Wed, 17 Jun 2020 09:47:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BF25E0AAE; Wed, 17 Jun 2020 09:47:39 +0000 (UTC) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 30258E0A9B for ; Wed, 17 Jun 2020 09:47:39 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id dr13so1623143ejc.3 for ; Wed, 17 Jun 2020 02:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Rnimesa0+xC3assWN5v+C57U01kvQG4mmI/g1Q0DciI=; b=UA8IKNa49SKOl28YEJhBWKPbDWUwcZhJTKOzhiRd7fazctT6aBriX2Ce4ikf20dKog Dd/hGQceIUVI6a+84t+bNgDnw1KCra5ZFZ8GtC8KIFNZixgBfd9CO9XOpRC9QdarZ58L pqHLs4f5FUbUVFjX6kA6S9S9n08SBjGF6N+xIVPaoACEN+/8hthvfIIk9rYcyqDhKU5I gnOqOdXIHDsjo81R9Nf9HV7Pwmfpy5uzEH5KfHBm5rcNmOZcEmUQVM+RYiJD+AD19Zvh ZsOMBCJ6Tg6oZkknttQmZOksmN4026vDBPTI/EPqFeTrtKpcD+EYITgmb3X+H+/igA2x v4cQ== X-Gm-Message-State: AOAM530CjA730P++nFUtf9AldcDeP3yijBQPbomrgeAZkoneeWbRMRAI fTeUt+GxSyZaww1ZO3OABj+1ImvWI8cCMG5JQ1jgum6a X-Google-Smtp-Source: ABdhPJwolv3QtD9xun5jhpmVWplGhj5sfTL/qQy6ghid6q4vXVOEQnVlJvUp787o67j2zwWXXxNLnWtGwNxGDrqGmxY= X-Received: by 2002:a17:906:118e:: with SMTP id n14mr7163385eja.314.1592387257537; Wed, 17 Jun 2020 02:47:37 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <6d77acb3-5754-06cb-b8ef-2f1a5d7d8084@gmail.com> <5EE8A6C9.9020900@youngman.org.uk> <5611481.lOV4Wx5bFT@lenovo.localdomain> <2fe8d752-b3f9-3187-a9fc-5c95c8030a10@youngman.org.uk> In-Reply-To: <2fe8d752-b3f9-3187-a9fc-5c95c8030a10@youngman.org.uk> From: Rich Freeman Date: Wed, 17 Jun 2020 05:47:26 -0400 Message-ID: Subject: Re: [gentoo-user] Testing a used hard drive to make SURE it is good. To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: f25408d1-56f4-414f-a397-20efa615e1bb X-Archives-Hash: c36efef49239ec619c3d58835ecb2056 On Tue, Jun 16, 2020 at 7:38 PM antlists wrote: > > On 16/06/2020 13:25, Rich Freeman wrote: > > And of course the problem with these latest hidden SMR drives is that > > they generally don't support TRIM, > > This, I believe, is a problem with the ATA spec. I don't understand > what's going on, but something like for these drives you need v4 of the > spec, and only v3 is finalised. Various people have pointed out holes in > this theory, so you don't need to add to them :-) But yes, I do > understand that apparently there is no official standard way to send a > trim to these drives ... You might be right, but I thought that some drive-managed SMR drives did support TRIM. It seems just as likely that TRIM support was not implemented to conceal the fact that the drives are SMR. > > > so even repeated sequential writes > > can be a problem because the drive doesn't realize that after you send > > block 1 you're going to send blocks 2-100k all sequentially. If it > > knew that then it would just start overwriting in place obliterating > > later tracks, since they're just going to be written next anyway. > > No it can't do that. Because when it overwrites the end of the file it > will be obliterating other random files that aren't going to be > overwritten ... Yes and no. First, all but the last few tracks can definitely be written without worry. The last few tracks might need to be cached but that is far less seeking than caching the whole thing. Second, if the writes end on an SMR zone boundary, then nothing will need rewriting. This is of course how things are handled on host-managed SMR drives - you just try to avoid the partial writes in the first place. > > > Instead this drive is going to cache every write until it can > > consolidate them, which isn't terrible but it still turns every seek > > into three (write buffer, read buffer, write permanent - plus updating > > metadata). > > Which IS terrible if you don't give the drive down-time to flush the > buffer ... It is less terrible than completely random writes, which is my point. The drive requires far less time to flush the buffer if it is doing large sequential writes, because only tail ends of a few regions might need to be preserved. > > > If they weren't being sneaky they could have made it > > drive-managed WITH TRIM so that it worked more like an SSD where you > > get the best performance if the OS uses TRIM, but it can fall back if > > you don't. Sequential writes on trimmed areas for SMR should perform > > identically to writes on CMR drives. > > You're forgetting one thing - rewriting a block on SSD or CMR doesn't > obliterate neighbouring blocks Actually, SSDs have exactly the same problem - you cannot rewrite one block on an SSD without obliterating neighboring blocks. The differences are: 1. The size of these regions is much smaller, so the amount of data that needs to be read and rewritten is much smaller. One block of rewrite might be amplified to hundreds of kilobytes, not hundreds of megabytes. 2. SSDs have no seek penalties, so the cost of these extra reads+writes are much lower in absolute terms, but you're still getting write amplification. 3. The SSDs aren't accumulating a large cache over time that can cause performance to hit a wall for a long time. The SSD just delays every write it gets as needed, because these write delays all the time aren't as noticeable. 4. SSDs clearly advertise these issues and filesystems were updated to support TRIM and mitigate them before they were adopted en masse. #4 is really a big one. Filesystems that aren't optimized for SSD can have very noticeable performance drops. Now, that is all relative - a non-aware filesystem on SSD is still going to perform way better than it does on any hard drive, so people switching to SSD from hard drives are still going to be very happy. If you are doing benchmarking though you'll definitely see an issue if you're doing random writes on SSDs without a filesystem that supports TRIM/etc. > ... with SMR for every track you rewrite > you have to salvage the neighbouring track too ... More than just one neighboring track. It really is the same issue as SSD, except: 1. All the issues are amplified by the seek latency of hard drives. 2. The overall move from CMR->SMR is 100% downside in performance, compared to the move from CMR->SSD where the downside is offset by a much larger upside, so even a dumb implementation feels like a massive improvement. In any case, none of this really changes the fact that drive-managed SMR really shouldn't be a thing at all, and it certainly shouldn't be an unlabeled "feature." SMR should have just been introduced as host-managed as a way to offer cheaper storage for those who have the use cases and filesystems that can manage it. There is nothing wrong with tape for storage, but if you stuck a tape drive preloaded with a tape in a box that could speak ATA and called it a USB3 external "hard drive" you'd drive people crazy. -- Rich