public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* O_DIRECT and delayed allocation question
@ 2009-06-18 19:53 Curt Wohlgemuth
  2009-06-19 11:55 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Curt Wohlgemuth @ 2009-06-18 19:53 UTC (permalink / raw)
  To: ext4 development

This might be a question with an obvious answer, but I'd like
verification one way or the other.

Does the use of O_DIRECT essentially disable delayed allocation for a
given file?

My simple tests show a larger degree of block fragmentation for files
written using O_DIRECT than without, and on its face, this makes sense
to me.  This fragmentation can be removed by using fallocate() on a
file before extending it with writes.

(Strictly speaking, I guess the use of O_DIRECT wouldn't "disable"
delayed allocation, since the blocks are allocated at the "normal"
time -- when going to disk.  But effectively there would be a lot less
block grouping available to build large extents if each write goes to
disk immediately, instead of going through the page cache.)

Thanks,
Curt

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

end of thread, other threads:[~2009-06-19 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18 19:53 O_DIRECT and delayed allocation question Curt Wohlgemuth
2009-06-19 11:55 ` Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox