it'd be nice if (flags & AMAP_EXTEND_NOWAIT) ? M_NOWAIT : (M_WAITOK | M_CANFAIL) and was only evaluated once. also, it's probably better to use UVM_KMF_* flags instead of PR_* flags for uvm_mapent_alloc(). otherwise it looks good. mmmm, CSE.... .mrg.