All of lore.kernel.org
 help / color / mirror / Atom feed
From: The Ghost <the-ghost@inbox.ru>
To: linux-ext4@vger.kernel.org
Subject: Re: Does ext4 write anything during reading with relatime?
Date: Tue, 08 Dec 2015 03:44:47 +0300	[thread overview]
Message-ID: <566627FF.3020005@inbox.ru> (raw)
In-Reply-To: <20151207231913.GA3094@thunk.org>

On 08/12/15 02:19, Theodore Ts'o wrote:
> On Tue, Dec 08, 2015 at 12:42:21AM +0300, The Ghost wrote:
>>
>> I just tried again. With relatime or noatime, the second drive spins up.
>> Always. With read-only, it never spins up. And that doesn't make sense...
>
> The superblock *does* get modified at mount time to update the last
> mount time and the mount count in the superblock.  But I've tested
> using blktrace, and that's the only write I see after copying in a set
> of test files, reading them (so that atime > mtime), and then
> umounting the file system.  I then started the blktrace, mounted the
> file system, and read all of the files using "tar cvzf /tmp/foo.tar.gz /mnt".
>
> Cheers,
>
> 						- Ted

During mount, yes, of course. During unmount, too. But, I spin the 
drives down after I've mounted them and updated the atimes!..

blktrace? thanks for the tip. :) I've installed it, and here is what I see.

I am too lazy to go plug in the drives I used for the RAID, so I just 
set up a loop device and do the test. I set up blktrace to register 
write requests, and for some reason, it shows 1 event each launch (this 
is probably the way it's supposed to be, though I have no idea what it 
means). Fine. I do the test, and it's only that one request, so you're 
right - nothing else gets written.

But then, why does my second drive spin up?! I've plugged in my RAID 
drives, and did the test again. And it did show 5 write events, 1 KiB 
data!! Plus that "one usual event" which, for some reason, does not 
cause the second drive to spin up. So, it does write something only if 
we're using an md device! But not if we're using a loop device, or 
whatever device you've used for the test.

Now I'm getting a feeling I probably won't find out what mysterious data 
gets written onto an md device and not any other kind of device, and 
even if I do, I probably wouldn't understand it...

This leads us to a conclusion that it's not the filesystem's fault - 
it's probably the RAID. But, it does not happen when I mount the 
filesystem in read-only mode, or when I read from the md device itself, 
which led me to believe it must be the filesystem!!..


Thank you for taking your time to explore this mystery with me. :) Now I 
can boast that not only have I contributed to the Linux kernel 
development by helping get one patch accepted, but also I've talked to 
Ted Ts'o once about something that apparently turned out to have nothing 
to do with ext4. :)


-- 
The Ghost

      reply	other threads:[~2015-12-08  0:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-05 11:03 Does ext4 write anything during reading with relatime? The Ghost
2015-12-06 21:14 ` Theodore Ts'o
2015-12-07 21:42   ` The Ghost
2015-12-07 23:19     ` Theodore Ts'o
2015-12-08  0:44       ` The Ghost [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=566627FF.3020005@inbox.ru \
    --to=the-ghost@inbox.ru \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.