On Mon, 28 Jan 2013 13:54:53 +0100, Andrey Zonov <z...@freebsd.org> wrote:

Author: zont
Date: Mon Jan 28 12:54:53 2013
New Revision: 246032
URL: http://svnweb.freebsd.org/changeset/base/246032

Log:
  - Add system wide page faults requiring I/O counter.
 Reviewed by:   alc
  MFC after:    2 weeks

Sounds very useful!

Ronald.



Modified:
  head/sys/sys/vmmeter.h
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_meter.c

Modified: head/sys/sys/vmmeter.h
==============================================================================
--- head/sys/sys/vmmeter.h      Mon Jan 28 12:50:16 2013        (r246031)
+++ head/sys/sys/vmmeter.h      Mon Jan 28 12:54:53 2013        (r246032)
@@ -61,6 +61,7 @@ struct vmmeter {
         * Virtual memory activity.
         */
        u_int v_vm_faults;      /* (p) address memory faults */
+       u_int v_io_faults;      /* (p) page faults requiring I/O */
        u_int v_cow_faults;     /* (p) copy-on-writes faults */
        u_int v_cow_optim;      /* (p) optimized copy-on-writes faults */
        u_int v_zfod;           /* (p) pages zero filled on demand */

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c      Mon Jan 28 12:50:16 2013        (r246031)
+++ head/sys/vm/vm_fault.c      Mon Jan 28 12:54:53 2013        (r246032)
@@ -939,9 +939,10 @@ vnode_locked:
         * Unlock everything, and return
         */
        unlock_and_deallocate(&fs);
-       if (hardfault)
+       if (hardfault) {
+               PCPU_INC(cnt.v_io_faults);
                curthread->td_ru.ru_majflt++;
-       else
+       } else
                curthread->td_ru.ru_minflt++;
        return (KERN_SUCCESS);

Modified: head/sys/vm/vm_meter.c
==============================================================================
--- head/sys/vm/vm_meter.c      Mon Jan 28 12:50:16 2013        (r246031)
+++ head/sys/vm/vm_meter.c      Mon Jan 28 12:54:53 2013        (r246032)
@@ -283,6 +283,7 @@ VM_STATS_SYS(v_syscall, "System calls");
 VM_STATS_SYS(v_intr, "Device interrupts");
 VM_STATS_SYS(v_soft, "Software interrupts");
 VM_STATS_VM(v_vm_faults, "Address memory faults");
+VM_STATS_VM(v_io_faults, "Page faults requiring I/O");
 VM_STATS_VM(v_cow_faults, "Copy-on-write faults");
 VM_STATS_VM(v_cow_optim, "Optimized COW faults");
 VM_STATS_VM(v_zfod, "Pages zero-filled on demand");
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to