svn commit: r274963 - projects/sendfile/sys/kern
Gleb Smirnoff
glebius at FreeBSD.org
Mon Nov 24 12:39:51 UTC 2014
Author: glebius
Date: Mon Nov 24 12:39:50 2014
New Revision: 274963
URL: https://svnweb.freebsd.org/changeset/base/274963
Log:
Even if application specified zero readahead, but current sendfile_swapin()
run is limited by socket space, not by the "nbytes" argument, do readahead.
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 Mon Nov 24 11:37:27 2014 (r274962)
+++ projects/sendfile/sys/kern/uipc_syscalls.c Mon Nov 24 12:39:50 2014 (r274963)
@@ -2468,8 +2468,10 @@ retry_space:
else
npages = howmany(space, PAGE_SIZE);
+ rhpages = SF_READAHEAD(flags) ?
+ SF_READAHEAD(flags) : roundup2(rem - space, PAGE_SIZE);
rhpages = min(howmany(obj_size - (off & ~PAGE_MASK) -
- (npages * PAGE_SIZE), PAGE_SIZE), SF_READAHEAD(flags));
+ (npages * PAGE_SIZE), PAGE_SIZE), rhpages);
sfio = malloc(sizeof(struct sf_io) +
(rhpages + npages) * sizeof(vm_page_t), M_TEMP, M_WAITOK);
More information about the svn-src-projects
mailing list