Date: Thu, 12 May 2011 13:05:00 -0700 From: mdf@FreeBSD.org To: Lev Serebryakov <lev@serebryakov.spb.ru> Cc: Kostik Belousov <kostikbel@gmail.com>, freebsd-hackers@freebsd.org, Lev Serebryakov <lev@freebsd.org> Subject: Re: Does FreeBSD have replacement for posix_fadvice() or fcntl(F_RDADVISE)? Message-ID: <BANLkTiknJi9ppLKY3%2Btx7Hr-64C6Ww70WA@mail.gmail.com> In-Reply-To: <1367664809.20110512235200@serebryakov.spb.ru> References: <1649118429.20110512113812@serebryakov.spb.ru> <20110512111752.GP48734@deviant.kiev.zoral.com.ua> <BANLkTinB_c5eXK2B0UhQkPmukcz65uKxdg@mail.gmail.com> <1367664809.20110512235200@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
2011/5/12 Lev Serebryakov <lev@serebryakov.spb.ru>: > Hello, Mdf. > You wrote 12 =D0=BC=D0=B0=D1=8F 2011 =D0=B3., 15:40:25: > >>>> =C2=A0 =C2=A0Does FreeBSD have some custom call, which can be used whe= re Linux >>>> =C2=A0programs uses posix_fadvice() and DARWIN ones fcntl(F_RDADVISE)? >>>> >>>> =C2=A0 =C2=A0It is like madvise(2) but for file descriptors. >>> No, it does not (and I think the function is spelled posix_fadvise()). >>> >>> mdf reserved the syscall slot for posix_fadvise in his recent work >>> on posix_fallocate(). Might be, he could comment more. >> Whoops, I replied bot forgot to reply-all. > >> Adding a stub for posix_fadvise() is on my list of things to do, since >> we use it at $WORK in our custom filesystem, but the list is long and >> spare time is short. > >> Nominally a technically correct implementation can do error checking >> and then nothing. =C2=A0Even after a stub is added to the OS, each >> filesystem must implement a VOP to do the work. > =C2=A0transmission Torrents client rely on this syscall. It could be beui= lt > without it, of course (it is in our ports!), but it seems, that it > produce much more sane disk load on Linux, because uses pre-fetch via > posix_fadvise(). My profiling shows that pread() could take about 40% > of it CPU time (8 seconds out of 20 with turned on ktrace, for > example), even if throughput is very modest (700KiB/s, for example). > Authors say, that they didn't observe such behavior on Linux (which > has posix_fadvise()) or MacOS X (with fcntl(F_RDADVISE))... > > =C2=A0May be, we should go to fs@ with this thread now? Probably; the interface and a few unit tests are a start but the common filesystems (presumably ufs and zfs and perhaps others) will need support and I do not have any knowledge of the internals of those filesystems. Cheers, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTiknJi9ppLKY3%2Btx7Hr-64C6Ww70WA>