User: Password:
|
|
Subscribe / Log in / New account

When to flush()?

When to flush()?

Posted Apr 1, 2009 12:20 UTC (Wed) by RobSeace (subscriber, #4435)
In reply to: When to flush()? by rvfh
Parent article: That massive filesystem thread

You mean like open(O_SYNC)? Or, do you mean something more than that is required?


(Log in to post comments)

When to flush()?

Posted Apr 1, 2009 13:19 UTC (Wed) by rvfh (subscriber, #31018) [Link]

> You mean like open(O_SYNC)?

Yes, but with more granularity. O_SYNC means write everything immediately, whereas you might want to give the kernel some time to organise the reads/writes more efficiently:
* O_CRITICAL: 1 second
* O_EXPENDABLE: 30 seconds
* default: 5 seconds

Totally superfluous.

Posted Apr 2, 2009 14:14 UTC (Thu) by xoddam (subscriber, #2322) [Link]

The application developer who has the choice of using these options doesn't know whether the data is expendable or not, and the end-user doesn't care about the implementation details.

Things go strangely pear-shaped when the most irrelevant, trivial data (eg. GNOME configs when we're only using GNOME because it's a default someone else chose) goes missing or gets corrupted.

I most definitely don't care if GNOME forgets where I put a window or two. But I do care if it fails to start.

What we end-users want (I wear a developer hat much of the time but I'm *always* a user) is not to be annoyed by the things we don't care about. O_EXPENDABLE and its ilk are an invitation for corner-cases to bite end-users. End-users don't deserve such treatment.

Totally superfluous.

Posted Apr 2, 2009 14:30 UTC (Thu) by rvfh (subscriber, #31018) [Link]

> The application developer who has the choice of using these options doesn't know whether the data is expendable or not
How then are they expected to know when to flush?

And anyway, do we really not know which files are important and which are not?
Examples:
* pid file, browser cache: don't care
* conf file, document, code: care
* database file: care a lot

But I do thank you for challenging this idea ;-) Please feel free to give counter-examples and -arguments.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds