Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caprevoke: Also exclude shadow bitmap from global VM stats #2101

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sys/vm/vm_cheri_revoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ vm_map_install_cheri_revoke_shadow(struct vm_map *map, struct sysentvec *sv)
* both large and sparsely mapped.
*/
vm_object_set_flag(vmo_shadow, OBJ_NOCAP);
vm_object_set_flag(vmo_shadow, OBJ_CHERISHADOW);

vmo_info = vm_object_allocate(OBJT_SWAP, PAGE_SIZE);

Expand Down
5 changes: 3 additions & 2 deletions sys/vm/vm_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ vmtotal(SYSCTL_HANDLER_ARGS)
* this case, the lack of synchronization should not
* impair the accuracy of the reported statistics.
*/
if ((object->flags & OBJ_FICTITIOUS) != 0) {
if ((object->flags & (OBJ_FICTITIOUS | OBJ_CHERISHADOW)) != 0) {
/*
* Devices, like /dev/mem, will badly skew our totals.
* Devices, like /dev/mem, will badly skew our totals,
* as will the shadow bitmap.
*/
continue;
}
Expand Down
1 change: 1 addition & 0 deletions sys/vm/vm_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ struct vm_object {
#define OBJ_HASCAP 0x10000 /* object can store capabilities */
#define OBJ_NOCAP 0x20000 /* object and all shadow objects can
not store capabilities */
#define OBJ_CHERISHADOW 0x40000 /* object is the shadow bitmap */

/*
* Helpers to perform conversion between vm_object page indexes and offsets.
Expand Down
Loading