Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Christian Loehle <christian.loehle@arm.com>
To: Patryk <pbiel7@gmail.com>
Cc: linux-mmc@vger.kernel.org, Oleksij Rempel <o.rempel@pengutronix.de>
Subject: Re: Question regarding informing MMC subsystem about upcoming power loss.
Date: Wed, 6 Mar 2024 11:11:58 +0000	[thread overview]
Message-ID: <ba258d15-6237-4ccf-b4d9-d6ddc105d89f@arm.com> (raw)
In-Reply-To: <CA+DkFDYMtEW9vp4EmU9ayhb+qCRgqYwKEeAU3LgWiuedSvUt8w@mail.gmail.com>

On 05/03/2024 15:59, Patryk wrote:
> wt., 5 mar 2024 o 16:33 Christian Loehle <christian.loehle@arm.com> napisał(a):
>> Immune to what exactly?
>> - (User) data loss of data that is still in the cache of the sd card?
>> (That would be saved by a timely cache flush)
>> - (User) data loss of data that should've been written to flash already?
>> - SD cards breaking?
>> - Explosions?
> 
> Data loss of data that is still in the cache of the sd card

Then my (very biased) opinion is:
Anything >1s window between being notified and power-loss a userspace umount/fsync
might be an improvement enough for your case.
Anything <1s window is then so storage-module-implementation specific that
it's hard to draft a solution that actually provides a measurable improvement.
Of course, turning off the SD cache completely is always an option (with drawbacks
like reduced performance and endurance).

> 
>> (Anything but the first IMO should be fixed by procurement and not by the
>> kernel, but I'm not sure if that's consensus).
>>
>>> Assuming that I have the information about upcoming power loss
>>> (provided by e.g. external interrupt, PSU voltage monitoring etc) how
>>> should I pass this information to the Kernel so that it will try to
>>> clean up resources - in particular MMC subsystem?
> 
>> There was a discussion, currently there aren't really, but it depends
>> on the scenario you're afraid of. Just issuing a cache flush might be fine.
>> https://www.phoronix.com/news/Linux-Priority-Based-Shutdown
>> https://lore.kernel.org/lkml/2023112403-laxative-lustiness-6a7f@gregkh/T/
> 
> Thanks, I didn't know about this, I will check it.

Forgot to CC Oleksij before, did it now.

Kind Regards,
Christian

> 
>> One of the fundamental questions IMO remains: How much time do we actually
>> have between being notified?
> 
> I haven't done any measurements yet, sorry.
> 
> Best regards
> Patryk


      reply	other threads:[~2024-03-06 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 15:22 Question regarding informing MMC subsystem about upcoming power loss Patryk
2024-03-05 15:33 ` Christian Loehle
2024-03-05 15:59   ` Patryk
2024-03-06 11:11     ` Christian Loehle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba258d15-6237-4ccf-b4d9-d6ddc105d89f@arm.com \
    --to=christian.loehle@arm.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pbiel7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox