mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Friesen <cbf123@mail.usask.ca>
To: lkml <linux-kernel@vger.kernel.org>
Subject: close() behaviour changes depending on whether file exists or not?
Date: Thu, 07 Jan 2016 11:59:13 +0200	[thread overview]
Message-ID: <568E36F1.9030805@mail.usask.ca> (raw)

I'm running 3.14 on my laptop, and I'm seeing some unexpected behaviour when I 
write out to a big file.  Basically if the

If I run

strace dd if=/dev/zero of=bigfile bs=1M count=1000;cat /proc/meminfo |egrep 
"Dirty|Writeback"

I see the final close() of "bigfile" (fd 1 in the strace output) complete right 
away, and I get speeds of 1.5GB/s.  When it completes I see "Dirty" in 
/proc/meminfo right at about a GB of data.

However, if I then immediately repeat the test (so the "bigfile" file exists 
already) I see the final close() delay until the writeback is done, almost as 
though there is an implicit fsync() call.  When it completes /proc/meminfo has a 
"Dirty" value of basically nothing and a "Writeback" value of about 67MB.

Is this a known issue?  I checked a 3.10 kernel that I had hanging around and it 
showed the same behaviour.

Thanks,
Chris


PS: Please CC me on reply, I'm not subscribed to the list.

                 reply	other threads:[~2016-01-07  9:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=568E36F1.9030805@mail.usask.ca \
    --to=cbf123@mail.usask.ca \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome