HomeFreeBSD

Avoid unnecessary page lookups in vm_object_madvise().

Description

Avoid unnecessary page lookups in vm_object_madvise().

vm_object_madvise() is frequently used to apply advice to a contiguous
set of pages in an object with no backing object. Optimize this case by
skipping non-resident subranges in constant time, and by iterating over
resident pages using the object memq, thus avoiding radix tree lookups on
each page index in the specified range.

While here, move MADV_WILLNEED handling to vm_page_advise(), and rename the
"advise" parameter to vm_object_madvise() to "advice."

Reviewed by: alc, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9098

Details

Provenance
markjAuthored on
Reviewer
alc
Differential Revision
D9098: Speed up iteration in vm_object_madvise().
Parents
rS312207: Merge ^/head r312201 through r312206.
Branches
Unknown
Tags
Unknown