From db2078e4f1802434f791f4f1c333725c42fe172b Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sat, 17 Dec 2011 15:24:05 +0000 Subject: Adjust the kernel to use the slab allocator * device/dev_lookup.c: Replace zalloc header, types and function calls with their slab counterparts. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/io_req.h: Likewise. * device/net_io.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_perm.c: Likewise. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/task.h: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/pmap.h: Remove #include . * include/mach_debug/mach_debug.defs (host_zone_info): Replace routine declaration with skip directive. (host_slab_info): New routine declaration. * include/mach_debug/mach_debug_types.defs (zone_name_t) (zone_name_array_t, zone_info_t, zone_info_array_t): Remove types. (cache_info_t, cache_info_array_t): New types. * include/mach_debug/mach_debug_types.h: Replace #include with . * ipc/ipc_entry.c: Replace zalloc header, types and function calls with their slab counterparts. * ipc/ipc_entry.h: Likewise. * ipc/ipc_init.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_table.c (kalloc_map): Remove extern declaration. * kern/act.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/kalloc.h: Add #include . (MINSIZE): Remove definition. (kalloc_map): Add extern declaration. (kget): Remove prototype. * kern/mach_clock.c: Adjust comment. * kern/processor.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/startup.c: Remove #include . * kern/task.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_init.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_page.h: Remove #include . * vm/vm_pageout.c: Replace zalloc header, types and function calls with their slab counterparts. * vm/vm_resident.c: Likewise. (zdata, zdata_size): Remove declarations. (vm_page_bootstrap): Don't steal memory for the zone system. --- kern/task.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'kern/task.c') diff --git a/kern/task.c b/kern/task.c index 88da16e8..2e9fd769 100644 --- a/kern/task.c +++ b/kern/task.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include /* for thread_wakeup */ @@ -52,7 +52,7 @@ #include /* for splsched */ task_t kernel_task = TASK_NULL; -zone_t task_zone; +struct kmem_cache task_cache; extern void eml_init(void); extern void eml_task_reference(task_t, task_t); @@ -60,11 +60,8 @@ extern void eml_task_deallocate(task_t); void task_init(void) { - task_zone = zinit( - sizeof(struct task), 0, - TASK_MAX * sizeof(struct task), - TASK_CHUNK * sizeof(struct task), - 0, "tasks"); + kmem_cache_init(&task_cache, "task", sizeof(struct task), 0, + NULL, NULL, NULL, 0); eml_init(); machine_task_module_init (); @@ -120,7 +117,7 @@ kern_return_t task_create( int i; #endif - new_task = (task_t) zalloc(task_zone); + new_task = (task_t) kmem_cache_alloc(&task_cache); if (new_task == TASK_NULL) { panic("task_create: no memory for task structure"); } @@ -235,7 +232,7 @@ void task_deallocate( pset_deallocate(pset); vm_map_deallocate(task->map); is_release(task->itk_space); - zfree(task_zone, (vm_offset_t) task); + kmem_cache_free(&task_cache, (vm_offset_t) task); } void task_reference( -- cgit v1.2.3 From aef06eb95fdb3e5f5b857a8b641723759e850a85 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sat, 17 Dec 2011 21:25:23 +0000 Subject: Remove the defunct kernel_task_create() function The kmem_suballoc() function, which has been replaced with kmem_submap(), is called by kernel_task_create(). Rather than update it, remove this now unused function. * kern/task.c (kernel_task_create): Remove function. * kern/task.h (kernel_task_create): Remove prototype. --- kern/task.c | 32 -------------------------------- kern/task.h | 2 -- 2 files changed, 34 deletions(-) (limited to 'kern/task.c') diff --git a/kern/task.c b/kern/task.c index 2e9fd769..b1381ed5 100644 --- a/kern/task.c +++ b/kern/task.c @@ -74,38 +74,6 @@ void task_init(void) (void) task_create(TASK_NULL, FALSE, &kernel_task); } -/* - * Create a task running in the kernel address space. It may - * have its own map of size mem_size (if 0, it uses the kernel map), - * and may have ipc privileges. - */ -task_t kernel_task_create( - task_t parent_task, - vm_size_t map_size) -{ - task_t new_task; - vm_offset_t min, max; - - /* - * Create the task. - */ - (void) task_create(parent_task, FALSE, &new_task); - - /* - * Task_create creates the task with a user-space map. - * Remove the map and replace it with the kernel map - * or a submap of the kernel map. - */ - vm_map_deallocate(new_task->map); - if (map_size == 0) - new_task->map = kernel_map; - else - new_task->map = kmem_suballoc(kernel_map, &min, &max, - map_size, FALSE); - - return new_task; -} - kern_return_t task_create( task_t parent_task, boolean_t inherit_memory, diff --git a/kern/task.h b/kern/task.h index 9d902435..c4251581 100644 --- a/kern/task.h +++ b/kern/task.h @@ -162,8 +162,6 @@ extern kern_return_t task_hold(task_t); extern kern_return_t task_dowait(task_t, boolean_t); extern kern_return_t task_release(task_t); -extern task_t kernel_task_create(task_t, vm_size_t); - extern task_t kernel_task; #endif /* _KERN_TASK_H_ */ -- cgit v1.2.3 From 88382234bb540544a3550d1ddfb84e0d17eec971 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sat, 17 Dec 2011 21:43:48 +0000 Subject: Remove arbitrary limits used by the zone system The zone allocator could limit the size of its zones to an arbitrary value set at zinit() time. There is no such parameter with the slab module. As a result of removing those limits, the kern/mach_param.h header becomes empty, and is simply removed altogether. * Makefrag.am (libkernel_a_SOURCES): Remove kern/mach_param.h. * i386/i386/fpu.c: Remove #include . * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * ipc/ipc_init.c: Likewise. (ipc_space_max): Remove variable. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_init.h (IPC_ZONE_TYPE): Remove macro. (ipc_space_max): Remove extern declaration. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_hash.c (ipc_hash_init): Don't use ipc_tree_entry_max to compute ipc_hash_global_size. * ipc/ipc_marequest.c: Remove #include . (ipc_marequest_max): Remove variable. (ipc_marequest_init): Don't use ipc_marequest_max to compute ipc_marequest_size. (ipc_marequest_info): Return (unsigned int)-1 in maxp. * kern/act.c: Remove #include . * kern/mach_clock.c: Likewise. * kern/priority.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_fault.c: Likewise. --- Makefrag.am | 1 - i386/i386/fpu.c | 1 - i386/i386/machine_task.c | 1 - i386/i386/pcb.c | 1 - ipc/ipc_hash.c | 7 ++--- ipc/ipc_init.c | 6 ----- ipc/ipc_init.h | 8 ------ ipc/ipc_marequest.c | 11 +++----- kern/act.c | 1 - kern/mach_clock.c | 1 - kern/mach_param.h | 67 ------------------------------------------------ kern/priority.c | 1 - kern/task.c | 1 - kern/thread.c | 1 - vm/memory_object_proxy.c | 1 - vm/vm_fault.c | 1 - 16 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 kern/mach_param.h (limited to 'kern/task.c') diff --git a/Makefrag.am b/Makefrag.am index b3e131a8..71800937 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -161,7 +161,6 @@ libkernel_a_SOURCES += \ kern/mach_clock.h \ kern/mach_factor.c \ kern/mach_factor.h \ - kern/mach_param.h \ kern/machine.c \ kern/machine.h \ kern/macro_help.h \ diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index 75bf6555..f2c81244 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -44,7 +44,6 @@ #include #include /* spls */ -#include #include #include #include diff --git a/i386/i386/machine_task.c b/i386/i386/machine_task.c index 689bf046..62b22e3a 100644 --- a/i386/i386/machine_task.c +++ b/i386/i386/machine_task.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c index 11ef5e78..e065dbb2 100644 --- a/i386/i386/pcb.c +++ b/i386/i386/pcb.c @@ -36,7 +36,6 @@ #include "vm_param.h" #include #include -#include #include #include #include diff --git a/ipc/ipc_hash.c b/ipc/ipc_hash.c index c2412890..a1ca225d 100644 --- a/ipc/ipc_hash.c +++ b/ipc/ipc_hash.c @@ -537,11 +537,8 @@ ipc_hash_init(void) /* if not configured, initialize ipc_hash_global_size */ - if (ipc_hash_global_size == 0) { - ipc_hash_global_size = ipc_tree_entry_max >> 8; - if (ipc_hash_global_size < 32) - ipc_hash_global_size = 32; - } + if (ipc_hash_global_size == 0) + ipc_hash_global_size = 256; /* make sure it is a power of two */ diff --git a/ipc/ipc_init.c b/ipc/ipc_init.c index 36d0f19e..ca7e7912 100644 --- a/ipc/ipc_init.c +++ b/ipc/ipc_init.c @@ -35,7 +35,6 @@ */ #include -#include #include #include #include @@ -57,11 +56,6 @@ static struct vm_map ipc_kernel_map_store; vm_map_t ipc_kernel_map = &ipc_kernel_map_store; vm_size_t ipc_kernel_map_size = 8 * 1024 * 1024; -int ipc_space_max = SPACE_MAX; -int ipc_tree_entry_max = ITE_MAX; -int ipc_port_max = PORT_MAX; -int ipc_pset_max = SET_MAX; - /* * Routine: ipc_bootstrap * Purpose: diff --git a/ipc/ipc_init.h b/ipc/ipc_init.h index b2f1dd4b..8dd64bb5 100644 --- a/ipc/ipc_init.h +++ b/ipc/ipc_init.h @@ -37,14 +37,6 @@ #ifndef _IPC_IPC_INIT_H_ #define _IPC_IPC_INIT_H_ -/* all IPC zones should be exhaustible */ -#define IPC_ZONE_TYPE ZONE_EXHAUSTIBLE - -extern int ipc_space_max; -extern int ipc_tree_entry_max; -extern int ipc_port_max; -extern int ipc_pset_max; - /* * Exported interfaces */ diff --git a/ipc/ipc_marequest.c b/ipc/ipc_marequest.c index 2087c678..6036967f 100644 --- a/ipc/ipc_marequest.c +++ b/ipc/ipc_marequest.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -59,7 +58,6 @@ struct kmem_cache ipc_marequest_cache; -int ipc_marequest_max = IMAR_MAX; #define imar_alloc() ((ipc_marequest_t) kmem_cache_alloc(&ipc_marequest_cache)) #define imar_free(imar) kmem_cache_free(&ipc_marequest_cache, (vm_offset_t) (imar)) @@ -102,11 +100,8 @@ ipc_marequest_init(void) /* if not configured, initialize ipc_marequest_size */ - if (ipc_marequest_size == 0) { - ipc_marequest_size = ipc_marequest_max >> 8; - if (ipc_marequest_size < 16) - ipc_marequest_size = 16; - } + if (ipc_marequest_size == 0) + ipc_marequest_size = 16; /* make sure it is a power of two */ @@ -436,7 +431,7 @@ ipc_marequest_info(maxp, info, count) info[i].hib_count = bucket_count; } - *maxp = ipc_marequest_max; + *maxp = (unsigned int)-1; return ipc_marequest_size; } diff --git a/kern/act.c b/kern/act.c index f4f1e316..36fa79c1 100644 --- a/kern/act.c +++ b/kern/act.c @@ -30,7 +30,6 @@ #include #include -#include /* XXX INCALL_... */ #include #include #include diff --git a/kern/mach_clock.c b/kern/mach_clock.c index 050f0888..edf87f07 100644 --- a/kern/mach_clock.c +++ b/kern/mach_clock.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/kern/mach_param.h b/kern/mach_param.h deleted file mode 100644 index 10376d81..00000000 --- a/kern/mach_param.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University. - * Copyright (c) 1993,1994 The University of Utah and - * the Computer Systems Laboratory (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF - * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY - * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF - * THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - * File: kern/mach_param.h - * Author: Avadis Tevanian, Jr., Michael Wayne Young - * Date: 1986 - * - * Mach system sizing parameters - * - */ - -#ifndef _KERN_MACH_PARAM_H_ -#define _KERN_MACH_PARAM_H_ - -#define THREAD_MAX 1024 /* Max number of threads */ -#define THREAD_CHUNK 64 /* Allocation chunk */ - -#define TASK_MAX 1024 /* Max number of tasks */ -#define TASK_CHUNK 64 /* Allocation chunk */ - -#define ACT_MAX 1024 /* Max number of acts */ -#define ACT_CHUNK 64 /* Allocation chunk */ - -#define ACTPOOL_MAX 1024 -#define ACTPOOL_CHUNK 64 - -#define PORT_MAX ((TASK_MAX * 3 + THREAD_MAX) /* kernel */ \ - + (THREAD_MAX * 2) /* user */ \ - + 40000) /* slop for objects */ - /* Number of ports, system-wide */ - -#define SET_MAX (TASK_MAX + THREAD_MAX + 200) - /* Max number of port sets */ - -#define ITE_MAX (1 << 16) /* Max number of splay tree entries */ - -#define SPACE_MAX (TASK_MAX + 5) /* Max number of IPC spaces */ - -#define IMAR_MAX (1 << 10) /* Max number of msg-accepted reqs */ - -#endif /* _KERN_MACH_PARAM_H_ */ diff --git a/kern/priority.c b/kern/priority.c index feddd8ee..17541b8b 100644 --- a/kern/priority.c +++ b/kern/priority.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/kern/task.c b/kern/task.c index b1381ed5..2624dd95 100644 --- a/kern/task.c +++ b/kern/task.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/kern/thread.c b/kern/thread.c index 0a59f076..74e1c4b5 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/vm/memory_object_proxy.c b/vm/memory_object_proxy.c index 9c0528c0..4fed312e 100644 --- a/vm/memory_object_proxy.c +++ b/vm/memory_object_proxy.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 840f0381..10955edd 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -51,7 +51,6 @@ #include #include /* For memory_object_data_{request,unlock} */ -#include #include #include -- cgit v1.2.3 From beda83efaa45fb04f142034f61eb1ae9fe872c59 Mon Sep 17 00:00:00 2001 From: David Höppner <0xffea@gmail.com> Date: Fri, 4 Jan 2013 22:43:53 +0000 Subject: Add statistics for task_events_info * ipc/ipc_mqueue.c (ipc_mqueue_send, ipc_mqueue_receive): Increment counters for message sent and received. * kern/ipc_kobject.c (ipc_kobject_server): Increment sent and received counters for the kernel task. * kern/task.c (task_create): Zero statistics. * kern/task.c (task_info): Add task_events_info call. * kern/task.h: Add statistics. * vm/vm_fault.c (vm_fault_page): Increment zero_fills, pageins, reactivations and cow_faults counters. * vm/vm_fault.c (vm_fault_wire_fast): Increment faults counters. * vm/vm_pageout.c (vm_pageout_scan): Increment reactivations counter. --- ipc/ipc_mqueue.c | 4 ++++ kern/ipc_kobject.c | 10 ++++++++-- kern/task.c | 31 +++++++++++++++++++++++++++++++ kern/task.h | 9 +++++++++ vm/vm_fault.c | 7 +++++++ vm/vm_pageout.c | 1 + 6 files changed, 60 insertions(+), 2 deletions(-) (limited to 'kern/task.c') diff --git a/ipc/ipc_mqueue.c b/ipc/ipc_mqueue.c index f3d5d4b0..80a34d3a 100644 --- a/ipc/ipc_mqueue.c +++ b/ipc/ipc_mqueue.c @@ -374,6 +374,8 @@ ipc_mqueue_send(kmsg, option, time_out) } } + current_task()->messages_sent++; + return MACH_MSG_SUCCESS; } @@ -684,6 +686,8 @@ ipc_mqueue_receive( ip_unlock(port); } + current_task()->messages_received++; + *kmsgp = kmsg; *seqnop = seqno; return MACH_MSG_SUCCESS; diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c index 5b355264..37d4eb99 100644 --- a/kern/ipc_kobject.c +++ b/kern/ipc_kobject.c @@ -177,15 +177,21 @@ ipc_kobject_server(request) #endif /* MACH_MACHINE_ROUTINES */ ) { (*routine)(&request->ikm_header, &reply->ikm_header); - } - else if (!ipc_kobject_notify(&request->ikm_header,&reply->ikm_header)){ + kernel_task->messages_received++; + } else { + if (!ipc_kobject_notify(&request->ikm_header, + &reply->ikm_header)) { ((mig_reply_header_t *) &reply->ikm_header)->RetCode = MIG_BAD_ID; #if MACH_IPC_TEST printf("ipc_kobject_server: bogus kernel message, id=%d\n", request->ikm_header.msgh_id); #endif /* MACH_IPC_TEST */ + } else { + kernel_task->messages_received++; + } } + kernel_task->messages_sent++; } check_simple_locks(); diff --git a/kern/task.c b/kern/task.c index 2624dd95..114dd319 100644 --- a/kern/task.c +++ b/kern/task.c @@ -108,6 +108,13 @@ kern_return_t task_create( new_task->active = TRUE; new_task->user_stop_count = 0; new_task->thread_count = 0; + new_task->faults = 0; + new_task->zero_fills = 0; + new_task->reactivations = 0; + new_task->pageins = 0; + new_task->cow_faults = 0; + new_task->messages_sent = 0; + new_task->messages_received = 0; eml_task_reference(new_task, parent_task); @@ -747,6 +754,30 @@ kern_return_t task_info( break; } + case TASK_EVENTS_INFO: + { + register task_events_info_t event_info; + + if (*task_info_count < TASK_EVENTS_INFO_COUNT) { + return KERN_INVALID_ARGUMENT; + } + + event_info = (task_events_info_t) task_info_out; + + task_lock(&task); + event_info->faults = task->faults; + event_info->zero_fills = task->zero_fills; + event_info->reactivations = task->reactivations; + event_info->pageins = task->pageins; + event_info->cow_faults = task->cow_faults; + event_info->messages_sent = task->messages_sent; + event_info->messages_received = task->messages_received; + task_unlock(&task); + + *task_info_count = TASK_EVENTS_INFO_COUNT; + break; + } + case TASK_THREAD_TIMES_INFO: { register task_thread_times_info_t times_info; diff --git a/kern/task.h b/kern/task.h index c4251581..9bfea571 100644 --- a/kern/task.h +++ b/kern/task.h @@ -102,6 +102,15 @@ struct task { /* Hardware specific data. */ machine_task_t machine; + + /* Statistics */ + natural_t faults; /* page faults counter */ + natural_t zero_fills; /* zero fill pages counter */ + natural_t reactivations; /* reactivated pages counter */ + natural_t pageins; /* actual pageins couter */ + natural_t cow_faults; /* copy-on-write faults counter */ + natural_t messages_sent; /* messages sent counter */ + natural_t messages_received; /* messages received counter */ }; #define task_lock(task) simple_lock(&(task)->lock) diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 178f3072..fe5b488a 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -254,6 +254,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, vm_stat_sample(SAMPLED_PC_VM_FAULTS_ANY); vm_stat.faults++; /* needs lock XXX */ + current_task()->faults++; /* * Recovery actions @@ -471,6 +472,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, vm_stat_sample(SAMPLED_PC_VM_ZFILL_FAULTS); vm_stat.zero_fill_count++; + current_task()->zero_fills; vm_object_lock(object); pmap_clear_modify(m->phys_addr); break; @@ -552,6 +554,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, if (m->inactive) { vm_stat_sample(SAMPLED_PC_VM_REACTIVATION_FAULTS); vm_stat.reactivations++; + current_task()->reactivations++; } VM_PAGE_QUEUES_REMOVE(m); @@ -651,6 +654,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, vm_stat.pageins++; vm_stat_sample(SAMPLED_PC_VM_PAGEIN_FAULTS); + current_task()->pageins++; if ((rc = memory_object_data_request(object->pager, object->pager_request, @@ -740,6 +744,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, vm_page_zero_fill(m); vm_stat_sample(SAMPLED_PC_VM_ZFILL_FAULTS); vm_stat.zero_fill_count++; + current_task()->zero_fills; vm_object_lock(object); pmap_clear_modify(m->phys_addr); break; @@ -855,6 +860,7 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, vm_stat.cow_faults++; vm_stat_sample(SAMPLED_PC_VM_COW_FAULTS); + current_task()->cow_faults; object = first_object; offset = first_offset; @@ -1638,6 +1644,7 @@ kern_return_t vm_fault_wire_fast(map, va, entry) vm_prot_t prot; vm_stat.faults++; /* needs lock XXX */ + current_task()->faults++; /* * Recovery actions */ diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c index 77c1cfea..661675f0 100644 --- a/vm/vm_pageout.c +++ b/vm/vm_pageout.c @@ -764,6 +764,7 @@ void vm_pageout_scan() vm_object_unlock(object); vm_page_activate(m); vm_stat.reactivations++; + current_task()->reactivations++; vm_page_unlock_queues(); vm_pageout_inactive_used++; continue; -- cgit v1.2.3