aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2024-10-22 12:47:52 +0000
committerMark Johnston <markj@FreeBSD.org>2024-10-29 13:34:33 +0000
commit9c139dd5bf40968f1e84ef607927acee4b80e7fd (patch)
treeed952a38aec57c87efe33b1f35d0db4ae7febf47
parentbbe4a6a3f2b9d418ca6833cf9f628096d22bcd85 (diff)
vm_object: Report laundry pages in kinfo_vmobject
Reviewed by: bnovkov, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47214 (cherry picked from commit a86373bc93ee1c850943e8585d0d426479378145)
-rw-r--r--sys/sys/user.h3
-rw-r--r--sys/vm/vm_object.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h
index c6894c527143..13062d67a69d 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -593,7 +593,8 @@ struct kinfo_vmobject {
uint64_t _kvo_backing_obj; /* Handle for the backing obj */
} kvo_type_spec; /* Type-specific union */
uint64_t kvo_me; /* Uniq handle for anon obj */
- uint64_t _kvo_qspare[6];
+ uint64_t kvo_laundry; /* Number of laundry pages. */
+ uint64_t _kvo_qspare[5];
uint32_t kvo_swapped; /* Number of swapped pages */
uint32_t _kvo_ispare[7];
char kvo_path[PATH_MAX]; /* Pathname, if any. */
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 6da30800896e..8ae9fe50833d 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2618,10 +2618,12 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
* sysctl is only meant to give an
* approximation of the system anyway.
*/
- if (m->a.queue == PQ_ACTIVE)
+ if (vm_page_active(m))
kvo->kvo_active++;
- else if (m->a.queue == PQ_INACTIVE)
+ else if (vm_page_inactive(m))
kvo->kvo_inactive++;
+ else if (vm_page_in_laundry(m))
+ kvo->kvo_laundry++;
}
}