Index: sys/vm/vm_object.h =================================================================== --- sys/vm/vm_object.h (revisione 237271) +++ sys/vm/vm_object.h (copia locale) @@ -76,8 +76,22 @@ * * vm_object_t Virtual memory object. * + * The root of cached pages pool is protected by both the per-object mutex + * and the free pages queue mutex. + * On insert in the cache splay tree, the per-object mutex is expected + * to be already held and the free paging queue mutex will be + * acquired during the operation too. + * On remove and lookup from the cache splay tree, only the free + * paging queue mutex is expected to be locked. + * These rules allow to check reliably the presence of cached pages + * with only the per-mutex lock held, avoiding to acquire the + * free paging queue mutex unnecessarilly and thus reducing the + * contention on it. + * * List of locks * (c) const until freed + * (o) per-object mutex + * (q) free paging queue mutex * */ @@ -102,7 +116,7 @@ struct vm_object { vm_ooffset_t backing_object_offset;/* Offset in backing object */ TAILQ_ENTRY(vm_object) pager_object_list; /* list of all objects of this pager type */ LIST_HEAD(, vm_reserv) rvq; /* list of reservations */ - vm_page_t cache; /* root of the cache page splay tree */ + vm_page_t cache; /* (o + q) root of the cache page splay tree */ void *handle; union { /*