Date: Sun, 4 Feb 2018 14:00:38 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328847 - stable/11/sys/kern Message-ID: <201802041400.w14E0c6h038414@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sun Feb 4 14:00:38 2018 New Revision: 328847 URL: https://svnweb.freebsd.org/changeset/base/328847 Log: MFC r328126: correct read-ahead calculations in vfs_bio_getpages Modified: stable/11/sys/kern/vfs_bio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Sun Feb 4 13:58:31 2018 (r328846) +++ stable/11/sys/kern/vfs_bio.c Sun Feb 4 14:00:38 2018 (r328847) @@ -4764,7 +4764,14 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int la = IDX_TO_OFF(ma[count - 1]->pindex); if (la >= object->un_pager.vnp.vnp_size) return (VM_PAGER_BAD); - lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; + + /* + * Change the meaning of la from where the last requested page starts + * to where it ends, because that's the end of the requested region + * and the start of the potential read-ahead region. + */ + la += PAGE_SIZE; + lpart = la > object->un_pager.vnp.vnp_size; bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802041400.w14E0c6h038414>