Date: Tue, 4 Mar 2008 15:12:46 +0000 (GMT) From: Robert Watson <rwatson@FreeBSD.org> To: Julian Elischer <julian@elischer.org> Cc: freebsd-hackers@freebsd.org, Ivan Voras <ivoras@freebsd.org> Subject: Re: readahead(2) - Linux Message-ID: <20080304150904.R41184@fledge.watson.org> In-Reply-To: <47CC6E7D.10707@elischer.org> References: <200803022218.32873.cneirabustos@gmail.com> <20080303081021.GC80576@hoeg.nl> <fqgvlb$s11$1@ger.gmane.org> <47CC6E7D.10707@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 3 Mar 2008, Julian Elischer wrote: > Ivan Voras wrote: >> Ed Schouten wrote: >>> * carlos neira <cneirabustos@gmail.com> wrote: >>>> is there an equivalent of readahead syscall in linux , for freebsd ?. i >>>> was looking at http://preload.sourceforge.net/ , and it needs this . >>> Maybe a mmap(), followed by a madvise()? >> >> Or an open() followed by a read() loop? :) If the goal is to preload the >> files, this one is certainly going to do it :) > > the aim is to load it into system memory but not copy anything into user > memory. In an ideal world (tm), a prefetch system call doesn't actually force the I/O to happen, it just hints that if it did happen, life would then be better. Then, in said ideal world (tm), the VM system can juggle investing pages in memory and I/O capacity in heuristic read-ahead, prefetch hints from the application, anonymously process memory, and buffer cache, based on what is most effective for particular applications or workloads. Last time I read up on I/O prefetching literature, it was considered quite difficult to place prefetch calls in applications in a useful way, and that normal heuristic read-ahead, which we already support, actually caught a high percentage of real application cases since applications do tend to order and store data usefully in files. For certain applications, though, that doesn't help much, and there isn't a way to tune "up" read-ahead prefetching, so it could be we're no longer doing as good a job. Robert N M Watson Computer Laboratory University of Cambridge
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080304150904.R41184>