mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: dmi p <d3vp0ll@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: write(2) and page cache
Date: Mon, 29 Jul 2013 22:54:12 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1307292242380.9718@eggly.anvils> (raw)
In-Reply-To: <CALHgxMEtcdkmrwnu8+mAhUOAMQz7B3V7J01sChF7x3-QQsRcBw@mail.gmail.com>

On Sun, 28 Jul 2013, dmi p wrote:
> Hi,
> When I write(2) on a file such that the size of the buffer being
> written is less than the page size, and the page is not in the page
> cache, does the write syscall block until the page is brought into the
> page cache from disk (to modify it and eventually write back),

Yes (except perhaps when overwriting that part of page at end of file:
I expect some filesystems might optimize out that read, and others not).

> or is the page reading part async with respect to write?

No, that would involve another layer of buffering, which I think
would be too hard to synchronize with page cache and mmap.

Hugh

      reply	other threads:[~2013-07-30  5:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-28 18:48 dmi p
2013-07-30  5:54 ` Hugh Dickins [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=alpine.LNX.2.00.1307292242380.9718@eggly.anvils \
    --to=hughd@google.com \
    --cc=d3vp0ll@gmail.com \
    --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

all inboxes | Powered by JetHome®