svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys...

Gleb Kurtsou gleb at freebsd.org
Sun Feb 14 23:05:22 UTC 2016


On (16/12/2015 21:30), Gleb Smirnoff wrote:
> Author: glebius
> Date: Wed Dec 16 21:30:45 2015
> New Revision: 292373
> URL: https://svnweb.freebsd.org/changeset/base/292373
> 
> Log:
>   A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().
>   
>   o With new KPI consumers can request contiguous ranges of pages, and
>     unlike before, all pages will be kept busied on return, like it was
>     done before with the 'reqpage' only. Now the reqpage goes away. With
>     new interface it is easier to implement code protected from race
>     conditions.
>   
>     Such arrayed requests for now should be preceeded by a call to
>     vm_pager_haspage() to make sure that request is possible. This
>     could be improved later, making vm_pager_haspage() obsolete.

vm_pager_haspage is essentially wrapper around VOP_BMAP. VOP_BMAP is a
stub for all non UFS-like file systems.  E.g. it's return (0) in zfs and
return (EOPNOTSUPP) in tmpfs.

Could you elaborate on how strong the requirement of "should be preceded
by a call to vm_pager_haspage" is. It's also not clear how to approach
it if file system doesn't have bmap and getpages/putpages, but uses
standard fallback pager through read/write.

You've added vm_pager_has_page to exec_map_first_page. Should we now
assume that vm_pager_get_pages(VM_INITIAL_PAGEIN) may fail if 'after'
returned by vm_pager_has_page is less than VM_INITIAL_PAGEIN?

Could you please take a look at 2 patches attached. I'd like to commit
the one fixing vnode_pager_haspage, but I'm not sure about
vm_pager_has_page usage in exec_map_first_page.


0001-Emulate-vop_stdbmap-in-vnode_pager_haspage-if-bmap-i.patch
	
'after' will be uninitialized if VOP_BMAP returns error.  KASSERT in
exec_map_first_page may fail because of it.  I'm not sure if after = 0
is currently expected in exec_map_first_page.

Extend the logic to treat EOPNOTSUPP as vop_stdbmap (set before and
after to 0). Then extend both to fs block size.


0002-Handle-vm_pager_has_page-failure-during-exec.patch

Patch may be dropped if vm_pager_has_page is required to succeed as
described above.

Thanks,
Gleb.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Emulate-vop_stdbmap-in-vnode_pager_haspage-if-bmap-i.patch
Type: text/x-diff
Size: 1762 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160214/2684c86f/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Handle-vm_pager_has_page-failure-during-exec.patch
Type: text/x-diff
Size: 2120 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160214/2684c86f/attachment-0001.patch>


More information about the svn-src-head mailing list