[Open]Solaris sendfile() cache

Post z dnia: 05/01/2007


* Sendfile is implemented through two schemes,
* direct I/O or by caching in the filesystem page
* cache. We cache the input file by default and
* use direct I/O only if sendfile_max_size is set
* appropriately as explained below. Note that this
* logic is consistent with other filesystems where
* caching is turned on by default unless explicitly
* turned off by using the DIRECTIO ioctl.
* We choose a slightly different scheme here. One can
* turn off caching by setting sendfile_max_size to 0.
* One can also enable caching of files
* <= sendfile_max_size by setting sendfile_max_size
* to an appropriate value. By default sendfile_max_size
* is set to the maximum value so
* that all files are cached. In future, we may provide
* better interfaces for caching the file.

root@opensol:~# uname -a; isainfo -kv
SunOS opensol 5.11 snv_46 i86pc i386 i86pc
64-bit amd64 kernel modules

root@opensol:~# mdb -k
Loading modules: [ unix krtld genunix specfs dtrace cpu.AuthenticAMD.15 uppc pcplusmp ufs ip sctp usba lofs zfs random crypto nfs cpc ptm ]

> sendfile_max_size::dump
\/ 1 2 3 4 5 6 7 8 9 a b c d e f v123456789abcdef
ffffffffc0034ed0: ffffffff ffffff7f 00000000 00000000 ................

W sendfile_init() sendfile_max_size jest inicjowane na MAXOFFSET_T mozna to zmieniac przez mdb -kw

Mozna tez sobie poczytac jak ( i kiedy ) wykorzystywane sa pule watkow w implementacji sendfile(). W wielkim skrocie: np. w sytuacji: wolny dysk vs szybka siec.

Comments are closed.