Page MenuHomeFreeBSD

Add vnode_pager_purge_range(9) KPI
Needs ReviewPublic

Authored by khng on Nov 12 2020, 4:31 PM.

Details

Reviewers
allanjude
imp
brooks
Group Reviewers
manpages
Summary

This KPI is created in addition to the existing vnode_pager_setsize(9)
KPI. The KPI is intended for file systems that are able to turn a range
of file into sparse range, also known as hole-punching.

Submitted by: Ka Ho Ng <khng@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 38886
Build 35775: arc lint + arc unit

Event Timeline

khng requested review of this revision.Nov 12 2020, 4:31 PM
khng created this revision.

Rebased to FreeBSD 14-CURRENT

Don't forget a manpage.

Seems like a manpage for vnode_pager_setsize(9) is also missing. Should I do it all together or separate the manpage into another differential?

In D27194#634238, @khng300_gmail.com wrote:

Don't forget a manpage.

Seems like a manpage for vnode_pager_setsize(9) is also missing. Should I do it all together or separate the manpage into another differential?

If they're going to be separate documents, then I'd say separate reviews. If they're going to be additions to an existing manpage (with appropriate LINKS entries, of course), then I'd do them together.

  • vnode_pager_purge_range comments updated
  • Add vnode_pager_purge_range.9
  • vnode_pager_purge_range.9 linting and style fixes
share/man/man9/vnode_pager_purge_range.9
38
.Nm
invalidates contents of the cache ...
45

"Affected"

55
for content occupying whole blocks within block
khng marked 2 inline comments as done.Jan 28 2021, 5:46 AM
khng marked an inline comment as done.
markj added inline comments.
sys/vm/vnode_pager.c
567

Suppose (startoff & PAGE_MASK) != 0. Note that OFF_TO_IDX(startoff) == OFF_TO_IDX(startoff & ~PAGE_MASK). Finally suppose that the page at OFF_TO_IDX(startoff) is resident in the object. vm_object_page_remove() will free the page at this index, so we will throw away data that is outside the requested range. In other words, I believe this vm_page_grab() call will always return NULL.

636

I think this block of code is asking to be moved into a subroutine, otherwise it is duplicated three times in this file.

khng marked 2 inline comments as done.Jan 29 2021, 6:20 AM
  • Minor changes in vnode_pager_purge_range to unnecessary vm_object_page_remove
khng planned changes to this revision.Feb 1 2021, 7:16 AM
  • vnode_pager_purge_range fixes on non-existing page (m == NULL)

Rebased on top of freebsd/main

Rebased onto D27194

  • Add fspacectl(2) and VOP_FDEALLOCATE(9).
  • Regen.
  • Wire up OpenZFS with VOP_DEALLOCATE(9)

Fixes cross-referencing D28347

  • Add vnode_pager_purge_range(9) KPI
  • vnode_pager_purge_range comments updated
  • Add vnode_pager_purge_range.9
  • vnode_pager_purge_range.9 linting and style fixes
  • Update wording
  • Two fixes:
  • Minor changes in vnode_pager_purge_range to unnecessary vm_object_page_remove
  • vnode_pager_purge_range fixes on non-existing page (m == NULL)

Rebased on top of freebsd/main

  • Add vnode_pager_purge_range(9) KPI
  • vnode_pager_purge_range comments updated
  • Add vnode_pager_purge_range.9
  • vnode_pager_purge_range.9 linting and style fixes
  • Update wording
  • Two fixes:
  • Minor changes in vnode_pager_purge_range to unnecessary vm_object_page_remove
  • vnode_pager_purge_range fixes on non-existing page (m == NULL)

Rebased

  • Add vnode_pager_purge_range(9) KPI
  • vnode_pager_purge_range comments updated
  • Add vnode_pager_purge_range.9
  • vnode_pager_purge_range.9 linting and style fixes
  • Update wording
  • Two fixes:
  • Minor changes in vnode_pager_purge_range to unnecessary vm_object_page_remove
  • vnode_pager_purge_range fixes on non-existing page (m == NULL)

Updated to tools/tools/git/git-arc.sh workflow

  • cpucontrol(8): Fix display.
  • grep: fix null pattern and empty pattern file behavior
  • grep: turn off -w if -x is specified
  • Add vnode_pager_purge_range(9) KPI
  • vnode_pager_purge_range comments updated
  • Add vnode_pager_purge_range.9
  • vnode_pager_purge_range.9 linting and style fixes
  • Update wording
  • Two fixes:
  • Minor changes in vnode_pager_purge_range to unnecessary vm_object_page_remove
  • vnode_pager_purge_range fixes on non-existing page (m == NULL)
  • Add fspacectl(2) and VOP_FDEALLOCATE(9).
  • Regen.
  • Wire up OpenZFS with VOP_DEALLOCATE(9)

Manual: fix missing includes

gbe added a subscriber: gbe.

LGTM for the man page part.