Mailinglist Archive: opensuse (946 mails)

< Previous Next >
Re: [opensuse] About relatime and lazytime
On 27/09/17 10:37 AM, Carlos E. R. wrote:
Ok, let's say that I would like the timestamps to be "recent", but not
written to disk often :-)

Then in the generic case 'lazytime' won't help you.

As I've pointed out, it only works with preallocated files, and as far as I can
tell even with the case of the small file example where there was no alteration
to the file allocation map (such an alteration would necessitate a inode write
as well to ensure integrity), the inode still gets flushed when the file closes.

So if you have a shell script that build something by lots of appends to a file
it it going to result in a lot of inode flushing.

I _think_ there is a use case in your favour where, if you have a FS that
allocates nice big 4k blocks at a time, then opening a file (in C or Perl or
Ruby of Python) and and doing lots of small writes that are not enough to
allocated a new new block, the the bytes hit the disk[1], unless you are
buffering :-) But if you are buffering then the contents of the buffer aren't
going to hit the disk.

In the former case, there will be updates to mtime but not to the allocation map
so lazytime helps. In the latter case mtime gets updated when the buffer is
flushed.

Now if you have a 4K disk and use a 512 byte buffer, you'll get a block
allocation and inode write on the first flush, then not for the second, third or
fourth, then the fifth will need a new block, so you update the map and get an
inode flush as well. And so it goes.

The issue is that "preallocation" clause in the semantics of lazytime.

Anyway, that's how I interpret it for the non-database situation.
I may be wrong about my interpretation.
But if I'm not, then that's the best you'll get.

Remember: if you close the file, the the inode gets flushed, so a shell script
of:

....
echo blah blah blah >> textfile.txt
echo more blah >> textfile.txt.
....

will result in the inode being flushed on each occasion.


--
A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting frowned upon?


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups