Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #30739

Re: Shutdown behavior and flash storage devices

From Don Y <blockedofcourse@foo.invalid>
Newsgroups comp.arch.embedded
Subject Re: Shutdown behavior and flash storage devices
Date 2021-07-25 13:27 -0700
Organization A noiseless patient Spider
Message-ID <sdkheo$t29$1@dont-email.me> (permalink)
References <sdhb29$ibh$1@gioia.aioe.org> <sdidmc$d9c$1@dont-email.me> <sdjmlo$4ji$1@gioia.aioe.org> <sdkfcj$ddf$1@dont-email.me>

Show all headers | View raw


On 7/25/2021 12:51 PM, Dimiter_Popoff wrote:
> If you have no knowledge of how the flash medium is written - which
> would normally be the case with USB sticks or SD cards etc. - the most
> efficient way to mitigate data loss probability is to do as much
> write cacheing as you can afford at system level.

One would assume you'd adopt such a strategy regardless -- as the
durability of FLASH is limited.   (write a piece of code that
just keeps rewriting the contents of FLASH and see how long before
you get write/verify errors)

> Of course again
> you will be prone to data loss on unexpected power loss but updating
> the write cache will be done at (much) longer intervals and in
> relatively brief bursts, thus the probability to be hit gets lower.

The usual trick is to just have a mirror of the FLASH contents
and flush that to the media when you're pretty sure the ship
is sinking.

But, if this is *large*, then you risk only partial writes before
power drops to an unusable/unreliable level.

> The rest can only be got rid of by having large enough caps on
> the power supply and an early warning that power has been lost
> (usually at the input of the stepdowns and you are running on fumes.

I'm not sure that will work with consumer devices.  You have no way of
knowing how long it will take to reliably flush ALL of the data
out to the physical store.

Remember, if you have a USB interface, then the interface limits the
write rate as well as the media in the device.

> Of course you can employ various strategies to mimick flash drive
> behaviour at a higher level, Don suggested one, Kent also did,
> but these mean having different drivers for different media and
> all the consequences of that.

Exactly.  I use "bare" devices so I can see how they respond -- because
the datasheet gives me hard limits.

So, I have to worry about a write *failing* (in which case, it's as if
I lost power prematurely) but not *other* "unchanged" data being corrupted
in the process (neglecting read/write disturb events).

> I prefer to talk to standard SCSI
> or ATA behaving things and leave it to them to handle their
> unique specifics. [I remember how I *had to* introduce write
> cacheing at system level, in the mid 90-s I started to do backups
> under DPS to magneto-optical devices; early days DPS would
> simply update its CAT (Cluster Allocation Table) every time
> it got modifier and these sectors got corrupted before the backup
> would finish.... :-) ].

I think much of that is inconsistent with Dave's idea of "consumer"
(which I read as "inexpensive")

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Shutdown behavior and flash storage devices Dave Nadler <drn@nadler.com> - 2021-07-24 11:19 -0400
  Re: Shutdown behavior and flash storage devices Theo <theom+news@chiark.greenend.org.uk> - 2021-07-24 16:37 +0100
  Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-24 18:10 -0700
    Re: Shutdown behavior and flash storage devices Dimiter_Popoff <dp@tgi-sci.com> - 2021-07-25 14:18 +0300
      Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-25 09:20 -0700
    Re: Shutdown behavior and flash storage devices Dave Nadler <drn@nadler.com> - 2021-07-25 08:49 -0400
      Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-25 09:30 -0700
      Re: Shutdown behavior and flash storage devices Dimiter_Popoff <dp@tgi-sci.com> - 2021-07-25 22:51 +0300
        Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-25 13:27 -0700
          Re: Shutdown behavior and flash storage devices Dimiter_Popoff <dp@tgi-sci.com> - 2021-07-26 00:00 +0300
            Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-25 17:35 -0700
  Re: Shutdown behavior and flash storage devices kegs@provalid.com (Kent Dickey) - 2021-07-25 13:53 -0500
    Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-25 13:20 -0700
  Re: Shutdown behavior and flash storage devices Jaded Hobo <badboy@heaven.org> - 2021-07-27 19:44 +0200
    Re: Shutdown behavior and flash storage devices Don Y <blockedofcourse@foo.invalid> - 2021-07-27 11:27 -0700

csiph-web