Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_subr.c
Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | |||||
static int vnsz2log; | static int vnsz2log; | ||||
/* | /* | ||||
* Support for the bufobj clean & dirty pctrie. | * Support for the bufobj clean & dirty pctrie. | ||||
*/ | */ | ||||
static void * | static void * | ||||
buf_trie_alloc(struct pctrie *ptree) | buf_trie_alloc(struct pctrie *ptree) | ||||
{ | { | ||||
return (uma_zalloc_smr(buf_trie_zone, M_NOWAIT)); | void *res; | ||||
/* Spin to accommodate potential SMR free latency. */ | |||||
for (;;) { | |||||
res = uma_zalloc_smr(buf_trie_zone, M_NOWAIT); | |||||
if (__predict_true(res != NULL)) | |||||
break; | |||||
smr_synchronize(buf_trie_smr); | |||||
} | } | ||||
return (res); | |||||
} | |||||
static void | static void | ||||
buf_trie_free(struct pctrie *ptree, void *node) | buf_trie_free(struct pctrie *ptree, void *node) | ||||
{ | { | ||||
uma_zfree_smr(buf_trie_zone, node); | uma_zfree_smr(buf_trie_zone, node); | ||||
} | } | ||||
PCTRIE_DEFINE_SMR(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, | PCTRIE_DEFINE_SMR(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, | ||||
buf_trie_smr); | buf_trie_smr); | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | vntblinit(void *dummy __unused) | ||||
* Preallocate enough nodes to support one-per buf so that | * Preallocate enough nodes to support one-per buf so that | ||||
* we can not fail an insert. reassignbuf() callers can not | * we can not fail an insert. reassignbuf() callers can not | ||||
* tolerate the insertion failure. | * tolerate the insertion failure. | ||||
*/ | */ | ||||
buf_trie_zone = uma_zcreate("BUF TRIE", pctrie_node_size(), | buf_trie_zone = uma_zcreate("BUF TRIE", pctrie_node_size(), | ||||
NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, | NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, | ||||
UMA_ZONE_NOFREE | UMA_ZONE_SMR); | UMA_ZONE_NOFREE | UMA_ZONE_SMR); | ||||
buf_trie_smr = uma_zone_get_smr(buf_trie_zone); | buf_trie_smr = uma_zone_get_smr(buf_trie_zone); | ||||
uma_prealloc(buf_trie_zone, nbuf); | /* XXX: slop */ | ||||
uma_prealloc(buf_trie_zone, nbuf * 3 / 2); | |||||
vnodes_created = counter_u64_alloc(M_WAITOK); | vnodes_created = counter_u64_alloc(M_WAITOK); | ||||
recycles_count = counter_u64_alloc(M_WAITOK); | recycles_count = counter_u64_alloc(M_WAITOK); | ||||
recycles_free_count = counter_u64_alloc(M_WAITOK); | recycles_free_count = counter_u64_alloc(M_WAITOK); | ||||
deferred_inact = counter_u64_alloc(M_WAITOK); | deferred_inact = counter_u64_alloc(M_WAITOK); | ||||
/* | /* | ||||
* Initialize the filesystem syncer. | * Initialize the filesystem syncer. | ||||
▲ Show 20 Lines • Show All 6,236 Lines • Show Last 20 Lines |