Use COUNTER_U64_DEFINE_EARLY() in places where it simplifies things.
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23978
This commit is contained in:
parent
fffcb56f7a
commit
d869a17e62
@ -198,15 +198,15 @@ static uma_zone_t smr_zone;
|
|||||||
|
|
||||||
static SYSCTL_NODE(_debug, OID_AUTO, smr, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
|
static SYSCTL_NODE(_debug, OID_AUTO, smr, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
|
||||||
"SMR Stats");
|
"SMR Stats");
|
||||||
static counter_u64_t advance = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(advance);
|
||||||
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance, CTLFLAG_RW, &advance, "");
|
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance, CTLFLAG_RW, &advance, "");
|
||||||
static counter_u64_t advance_wait = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(advance_wait);
|
||||||
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance_wait, CTLFLAG_RW, &advance_wait, "");
|
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance_wait, CTLFLAG_RW, &advance_wait, "");
|
||||||
static counter_u64_t poll = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(poll);
|
||||||
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll, CTLFLAG_RW, &poll, "");
|
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll, CTLFLAG_RW, &poll, "");
|
||||||
static counter_u64_t poll_scan = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(poll_scan);
|
||||||
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll_scan, CTLFLAG_RW, &poll_scan, "");
|
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll_scan, CTLFLAG_RW, &poll_scan, "");
|
||||||
static counter_u64_t poll_fail = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(poll_fail);
|
||||||
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll_fail, CTLFLAG_RW, &poll_fail, "");
|
SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, poll_fail, CTLFLAG_RW, &poll_fail, "");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -631,15 +631,3 @@ smr_init(void)
|
|||||||
smr_zone = uma_zcreate("SMR CPU", sizeof(struct smr),
|
smr_zone = uma_zcreate("SMR CPU", sizeof(struct smr),
|
||||||
NULL, NULL, NULL, NULL, (CACHE_LINE_SIZE * 2) - 1, UMA_ZONE_PCPU);
|
NULL, NULL, NULL, NULL, (CACHE_LINE_SIZE * 2) - 1, UMA_ZONE_PCPU);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
smr_init_counters(void *unused)
|
|
||||||
{
|
|
||||||
|
|
||||||
advance = counter_u64_alloc(M_WAITOK);
|
|
||||||
advance_wait = counter_u64_alloc(M_WAITOK);
|
|
||||||
poll = counter_u64_alloc(M_WAITOK);
|
|
||||||
poll_scan = counter_u64_alloc(M_WAITOK);
|
|
||||||
poll_fail = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
|
||||||
SYSINIT(smr_counters, SI_SUB_CPU, SI_ORDER_ANY, smr_init_counters, NULL);
|
|
||||||
|
@ -345,11 +345,12 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, SYSCTL_NULL_INT_PTR,
|
|||||||
*/
|
*/
|
||||||
static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
|
static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
|
||||||
"Name cache statistics");
|
"Name cache statistics");
|
||||||
#define STATNODE_ULONG(name, descr) \
|
#define STATNODE_ULONG(name, descr) \
|
||||||
SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr);
|
SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr);
|
||||||
#define STATNODE_COUNTER(name, descr) \
|
#define STATNODE_COUNTER(name, descr) \
|
||||||
static counter_u64_t __read_mostly name; \
|
static COUNTER_U64_DEFINE_EARLY(name); \
|
||||||
SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr);
|
SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, \
|
||||||
|
descr);
|
||||||
STATNODE_ULONG(numneg, "Number of negative cache entries");
|
STATNODE_ULONG(numneg, "Number of negative cache entries");
|
||||||
STATNODE_ULONG(numcache, "Number of cache entries");
|
STATNODE_ULONG(numcache, "Number of cache entries");
|
||||||
STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held");
|
STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held");
|
||||||
@ -1936,26 +1937,6 @@ nchinit(void *dummy __unused)
|
|||||||
TAILQ_INIT(&ncneg_hot.nl_list);
|
TAILQ_INIT(&ncneg_hot.nl_list);
|
||||||
|
|
||||||
mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF);
|
mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF);
|
||||||
|
|
||||||
numcachehv = counter_u64_alloc(M_WAITOK);
|
|
||||||
numcalls = counter_u64_alloc(M_WAITOK);
|
|
||||||
dothits = counter_u64_alloc(M_WAITOK);
|
|
||||||
dotdothits = counter_u64_alloc(M_WAITOK);
|
|
||||||
numchecks = counter_u64_alloc(M_WAITOK);
|
|
||||||
nummiss = counter_u64_alloc(M_WAITOK);
|
|
||||||
nummisszap = counter_u64_alloc(M_WAITOK);
|
|
||||||
numposzaps = counter_u64_alloc(M_WAITOK);
|
|
||||||
numposhits = counter_u64_alloc(M_WAITOK);
|
|
||||||
numnegzaps = counter_u64_alloc(M_WAITOK);
|
|
||||||
numneghits = counter_u64_alloc(M_WAITOK);
|
|
||||||
numfullpathcalls = counter_u64_alloc(M_WAITOK);
|
|
||||||
numfullpathfail1 = counter_u64_alloc(M_WAITOK);
|
|
||||||
numfullpathfail2 = counter_u64_alloc(M_WAITOK);
|
|
||||||
numfullpathfail4 = counter_u64_alloc(M_WAITOK);
|
|
||||||
numfullpathfound = counter_u64_alloc(M_WAITOK);
|
|
||||||
zap_and_exit_bucket_relock_success = counter_u64_alloc(M_WAITOK);
|
|
||||||
numneg_evicted = counter_u64_alloc(M_WAITOK);
|
|
||||||
shrinking_skipped = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
}
|
||||||
SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL);
|
SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL);
|
||||||
|
|
||||||
|
@ -177,12 +177,12 @@ static unsigned long swap_maxpages;
|
|||||||
SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0,
|
SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0,
|
||||||
"Maximum amount of swap supported");
|
"Maximum amount of swap supported");
|
||||||
|
|
||||||
static counter_u64_t swap_free_deferred;
|
static COUNTER_U64_DEFINE_EARLY(swap_free_deferred);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_deferred,
|
SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_deferred,
|
||||||
CTLFLAG_RD, &swap_free_deferred,
|
CTLFLAG_RD, &swap_free_deferred,
|
||||||
"Number of pages that deferred freeing swap space");
|
"Number of pages that deferred freeing swap space");
|
||||||
|
|
||||||
static counter_u64_t swap_free_completed;
|
static COUNTER_U64_DEFINE_EARLY(swap_free_completed);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_completed,
|
SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_completed,
|
||||||
CTLFLAG_RD, &swap_free_completed,
|
CTLFLAG_RD, &swap_free_completed,
|
||||||
"Number of deferred frees completed");
|
"Number of deferred frees completed");
|
||||||
@ -527,15 +527,6 @@ swap_pager_init(void)
|
|||||||
sx_init(&swdev_syscall_lock, "swsysc");
|
sx_init(&swdev_syscall_lock, "swsysc");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
swap_pager_counters(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
swap_free_deferred = counter_u64_alloc(M_WAITOK);
|
|
||||||
swap_free_completed = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
|
||||||
SYSINIT(swap_counters, SI_SUB_CPU, SI_ORDER_ANY, swap_pager_counters, NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SWAP_PAGER_SWAP_INIT() - swap pager initialization from pageout process
|
* SWAP_PAGER_SWAP_INIT() - swap pager initialization from pageout process
|
||||||
*
|
*
|
||||||
|
@ -153,31 +153,21 @@ struct vm_object kernel_object_store;
|
|||||||
static SYSCTL_NODE(_vm_stats, OID_AUTO, object, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
static SYSCTL_NODE(_vm_stats, OID_AUTO, object, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
||||||
"VM object stats");
|
"VM object stats");
|
||||||
|
|
||||||
static counter_u64_t object_collapses = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(object_collapses);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapses, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapses, CTLFLAG_RD,
|
||||||
&object_collapses,
|
&object_collapses,
|
||||||
"VM object collapses");
|
"VM object collapses");
|
||||||
|
|
||||||
static counter_u64_t object_bypasses = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(object_bypasses);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, bypasses, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, bypasses, CTLFLAG_RD,
|
||||||
&object_bypasses,
|
&object_bypasses,
|
||||||
"VM object bypasses");
|
"VM object bypasses");
|
||||||
|
|
||||||
static counter_u64_t object_collapse_waits = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(object_collapse_waits);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapse_waits, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapse_waits, CTLFLAG_RD,
|
||||||
&object_collapse_waits,
|
&object_collapse_waits,
|
||||||
"Number of sleeps for collapse");
|
"Number of sleeps for collapse");
|
||||||
|
|
||||||
static void
|
|
||||||
counter_startup(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
object_collapses = counter_u64_alloc(M_WAITOK);
|
|
||||||
object_bypasses = counter_u64_alloc(M_WAITOK);
|
|
||||||
object_collapse_waits = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
|
||||||
SYSINIT(object_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL);
|
|
||||||
|
|
||||||
static uma_zone_t obj_zone;
|
static uma_zone_t obj_zone;
|
||||||
|
|
||||||
static int vm_object_zinit(void *mem, int size, int flags);
|
static int vm_object_zinit(void *mem, int size, int flags);
|
||||||
|
@ -130,31 +130,21 @@ static int vm_pageproc_waiters;
|
|||||||
static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
||||||
"VM page statistics");
|
"VM page statistics");
|
||||||
|
|
||||||
static counter_u64_t pqstate_commit_retries = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(pqstate_commit_retries);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, pqstate_commit_retries,
|
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, pqstate_commit_retries,
|
||||||
CTLFLAG_RD, &pqstate_commit_retries,
|
CTLFLAG_RD, &pqstate_commit_retries,
|
||||||
"Number of failed per-page atomic queue state updates");
|
"Number of failed per-page atomic queue state updates");
|
||||||
|
|
||||||
static counter_u64_t queue_ops = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(queue_ops);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_ops,
|
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_ops,
|
||||||
CTLFLAG_RD, &queue_ops,
|
CTLFLAG_RD, &queue_ops,
|
||||||
"Number of batched queue operations");
|
"Number of batched queue operations");
|
||||||
|
|
||||||
static counter_u64_t queue_nops = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(queue_nops);
|
||||||
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_nops,
|
SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_nops,
|
||||||
CTLFLAG_RD, &queue_nops,
|
CTLFLAG_RD, &queue_nops,
|
||||||
"Number of batched queue operations with no effects");
|
"Number of batched queue operations with no effects");
|
||||||
|
|
||||||
static void
|
|
||||||
counter_startup(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
pqstate_commit_retries = counter_u64_alloc(M_WAITOK);
|
|
||||||
queue_ops = counter_u64_alloc(M_WAITOK);
|
|
||||||
queue_nops = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
|
||||||
SYSINIT(page_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bogus page -- for I/O to/from partially complete buffers,
|
* bogus page -- for I/O to/from partially complete buffers,
|
||||||
* or for paging into sparsely invalid regions.
|
* or for paging into sparsely invalid regions.
|
||||||
|
@ -264,11 +264,11 @@ static struct vm_reserv_domain vm_rvd[MAXMEMDOM];
|
|||||||
static SYSCTL_NODE(_vm, OID_AUTO, reserv, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
static SYSCTL_NODE(_vm, OID_AUTO, reserv, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
||||||
"Reservation Info");
|
"Reservation Info");
|
||||||
|
|
||||||
static counter_u64_t vm_reserv_broken = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(vm_reserv_broken);
|
||||||
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, broken, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, broken, CTLFLAG_RD,
|
||||||
&vm_reserv_broken, "Cumulative number of broken reservations");
|
&vm_reserv_broken, "Cumulative number of broken reservations");
|
||||||
|
|
||||||
static counter_u64_t vm_reserv_freed = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(vm_reserv_freed);
|
||||||
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, freed, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, freed, CTLFLAG_RD,
|
||||||
&vm_reserv_freed, "Cumulative number of freed reservations");
|
&vm_reserv_freed, "Cumulative number of freed reservations");
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq,
|
|||||||
sysctl_vm_reserv_partpopq, "A",
|
sysctl_vm_reserv_partpopq, "A",
|
||||||
"Partially populated reservation queues");
|
"Partially populated reservation queues");
|
||||||
|
|
||||||
static counter_u64_t vm_reserv_reclaimed = EARLY_COUNTER;
|
static COUNTER_U64_DEFINE_EARLY(vm_reserv_reclaimed);
|
||||||
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD,
|
SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD,
|
||||||
&vm_reserv_reclaimed, "Cumulative number of reclaimed reservations");
|
&vm_reserv_reclaimed, "Cumulative number of reclaimed reservations");
|
||||||
|
|
||||||
@ -1440,21 +1440,6 @@ vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end)
|
|||||||
return (new_end);
|
return (new_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Initializes the reservation management system. Specifically, initializes
|
|
||||||
* the reservation counters.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
vm_reserv_counter_init(void *unused)
|
|
||||||
{
|
|
||||||
|
|
||||||
vm_reserv_freed = counter_u64_alloc(M_WAITOK);
|
|
||||||
vm_reserv_broken = counter_u64_alloc(M_WAITOK);
|
|
||||||
vm_reserv_reclaimed = counter_u64_alloc(M_WAITOK);
|
|
||||||
}
|
|
||||||
SYSINIT(vm_reserv_counter_init, SI_SUB_CPU, SI_ORDER_ANY,
|
|
||||||
vm_reserv_counter_init, NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the superpage containing the given page.
|
* Returns the superpage containing the given page.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user