svn commit: r275308 - projects/sendfile/sys/kern
Gleb Smirnoff
glebius at FreeBSD.org
Sun Nov 30 09:56:14 UTC 2014
Author: glebius
Date: Sun Nov 30 09:56:13 2014
New Revision: 275308
URL: https://svnweb.freebsd.org/changeset/base/275308
Log:
Pager limits our readahead count to MAXPHYS, so do not try to pre-allocate
larger vector.
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Modified:
projects/sendfile/sys/kern/uipc_syscalls.c
Modified: projects/sendfile/sys/kern/uipc_syscalls.c
==============================================================================
--- projects/sendfile/sys/kern/uipc_syscalls.c Sun Nov 30 09:04:24 2014 (r275307)
+++ projects/sendfile/sys/kern/uipc_syscalls.c Sun Nov 30 09:56:13 2014 (r275308)
@@ -2467,11 +2467,13 @@ retry_space:
/*
* Calculate maximum allowed number of pages for readahead
* at this iteration. First, we allow readahead up to "rem".
- * If application wants more, let it be. But check against
- * "obj_size", since vm_pager_has_page() can hint beyond EOF.
+ * If application wants more, let it be, but there is no
+ * reason to go above MAXPHYS. Also check against "obj_size",
+ * since vm_pager_has_page() can hint beyond EOF.
*/
rhpages = howmany(rem + (off & PAGE_MASK), PAGE_SIZE) - npages;
rhpages = max(SF_READAHEAD(flags), rhpages);
+ rhpages = min(howmany(MAXPHYS, PAGE_SIZE), rhpages);
rhpages = min(howmany(obj_size - trunc_page(off), PAGE_SIZE) -
npages, rhpages);
More information about the svn-src-projects
mailing list