kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Direct IO and Page cache
@ 2013-07-26  3:15 Kumar amit mehta
  2013-07-26  9:14 ` Chinmay V S
  2013-07-26 14:56 ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 9+ messages in thread
From: Kumar amit mehta @ 2013-07-26  3:15 UTC (permalink / raw)
  To: kernelnewbies

Hi,

We have direct I/O(O_DIRECT), for example raw devices(/dev/rawctl) that
map to the block devices and we also have page cache. Now If I've
understood this correctly, direct I/O will bypass this page cache, which
is fine, I'll not get into the performance debate, but what about data
consistency. Kernel cannot and __should'nt__ try to control how the
applications are being written. So one bad day somebody comes up with
an application which does both these two types of IO(one that goes
through page cache and the other that doesn't) and in that application,
one instance is writing directly to the backend device and the other
instance, who is not aware of this write, goes ahead and writes to the
page cache, and that write would be written later to the backend device.
So wouldn't we end up corrupting the on disk data.

I can think of multiple other scenarios which could corrupt the on-disk
data, if there isn't any safeguarding policies employed by the kernel.
But I'm very much sure that kernel is aware of such nasty attempts, and
I'd like to know how does kernel takes care of this.

!!amit

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-26 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26  3:15 Direct IO and Page cache Kumar amit mehta
2013-07-26  9:14 ` Chinmay V S
2013-07-26  4:02   ` Kumar amit mehta
2013-07-26 10:21     ` Chinmay V S
2013-07-26 10:31       ` Chinmay V S
2013-07-26  6:04         ` Kumar amit mehta
2013-07-26 14:59     ` Valdis.Kletnieks at vt.edu
2013-07-26 15:52       ` Kumar amit mehta
2013-07-26 14:56 ` Valdis.Kletnieks at vt.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).