Diskova cache a moje dalsi cache

Vlada Macek tuttle na sandbox.cz
Neděle Září 7 01:39:29 CEST 2008


Dalibor Straka wrote:
> Premyslim, jestli jsem neudelal uplnou debilitu, jestli ta stejna data
> nedrzi linuxova cache taky a ja ji jen duplikuju a zbytecne zeru pamet?
>   

Jo, nekdy se muze hodit mit vlastni mezipamet a obejit systemove buffery.

Linux, man open(2):

       O_DIRECT (Since Linux 2.6.10)
              Try to minimize cache effects of the I/O to and from this 
file.
              In  general  this  will degrade performance, but it is
useful in
              special situations, such  as  when  applications  do 
their  own
              caching.   File I/O is done directly to/from user space
buffers.
              The I/O is synchronous, that is, at the completion of a 
read(2)
              or write(2), data is guaranteed to have been transferred. 
Under
              Linux 2.4 transfer sizes, and the alignment of user 
buffer  and
              file  offset  must all be multiples of the logical block
size of
              the file system.  Under Linux 2.6 alignment to  512-byte 
bound-
              aries suffices.
              A  semantically  similar  (but  deprecated)  interface for
block
              devices is described in raw(8).

Solaris ma neco jako UFS Direct I/O. Google zazvonil, ale moc jsem nehledal.

Treba to pomuze.

-- 
\//\/\
http://macek.sandbox.cz



Další informace o konferenci Linux