* write(2) and page cache
@ 2013-07-28 18:48 dmi p
2013-07-30 5:54 ` Hugh Dickins
0 siblings, 1 reply; 2+ messages in thread
From: dmi p @ 2013-07-28 18:48 UTC (permalink / raw)
To: linux-kernel
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), or is
the page reading part async with respect to write?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: write(2) and page cache
2013-07-28 18:48 write(2) and page cache dmi p
@ 2013-07-30 5:54 ` Hugh Dickins
0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2013-07-30 5:54 UTC (permalink / raw)
To: dmi p; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-30 5:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-28 18:48 write(2) and page cache dmi p
2013-07-30 5:54 ` Hugh Dickins
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®