Page MenuHomeFreeBSD

vm_reserv: Introduce vm_reserv_populate_range
Needs ReviewPublic

Authored by bnovkov on Fri, Oct 18, 5:47 PM.
Tags
None
Referenced Files
F101981495: D47181.diff
Wed, Nov 6, 3:29 AM
Unknown Object (File)
Fri, Nov 1, 11:34 PM
Unknown Object (File)
Mon, Oct 28, 6:34 PM
Unknown Object (File)
Wed, Oct 23, 10:42 AM
Unknown Object (File)
Mon, Oct 21, 8:21 AM
Unknown Object (File)
Mon, Oct 21, 7:24 AM
Unknown Object (File)
Sun, Oct 20, 11:34 PM
Unknown Object (File)
Sun, Oct 20, 11:34 PM
Subscribers

Details

Reviewers
alc
markj
kib
Summary

This patch adds a routine for populating a range of pages within a reservation.
Instead of repeatedly calling vm_reserv_populate, this routine uses bit_nset to populate the bitmap in one go and updates the reservation's partpopq state only once.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/vm/vm_reserv.c
630

Either use __FUNCTION__ or __func__ consistently, please. __func__ is better because it is standard.

644

Does it make sense to assert that no bits in range are set, before setting them? Otherwise this update might be too optimistic.

sys/vm/vm_reserv.c
641–642

This needs to be within a loop. Multiple pages may need to have their psind updated. For example, the range being populated may span multiple 64 KB pages within a 2 MB reservation.

644

This check exists within the caller.

728–729

Call it here.

836–837

And, call it here too.

Adress @kib 's and @alc 's comments:

  • vm_reserv_populate_range should now properly update psinds for SUBLEVEL-sized superpages
  • Replaced two 'for loop + vm_reserv_populate' constructs with vm_reserv_populate_range