diff options
-rw-r--r-- | lib/libsys/membarrier.2 | 7 | ||||
-rw-r--r-- | stand/defaults/loader.conf | 2 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 5 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 27 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 2 | ||||
-rw-r--r-- | usr.bin/mididump/mididump.c | 6 |
6 files changed, 27 insertions, 22 deletions
diff --git a/lib/libsys/membarrier.2 b/lib/libsys/membarrier.2 index fe2e6ff763d5..87db620975ef 100644 --- a/lib/libsys/membarrier.2 +++ b/lib/libsys/membarrier.2 @@ -60,7 +60,7 @@ This is an alias for .It Dv MEMBARRIER_CMD_GLOBAL_EXPEDITED Execute a memory barrier on all running threads of all processes registered with -.Dv MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED +.Dv MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED . .It Dv MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED Register the process to receive .Dv MEMBARRIER_CMD_GLOBAL_EXPEDITED @@ -102,8 +102,9 @@ The argument is ignored. .Sh RETURN VALUES If the -.Dv cmd -is MEMBARRIER_CMD_QUERY +.Fa cmd +is +.Dv MEMBARRIER_CMD_QUERY a bitmask of supported commands is returned. Otherwise, on success, .Nm diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 8678c5c50d4f..d266c240955a 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -27,7 +27,7 @@ vesa_load="NO" # Set this to YES to load the vesa module bitmap_load="NO" # Set this to YES if you want splash screen! bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path -splash="/boot/images/freebsd-logo-rev.png" # Set boot_mute="YES" to load it +splash="/boot/images/freebsd-logo-rev.png" # Set boot_mute=YES to load it ### Screen saver modules ################################### # This is best done in rc.conf diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 5128c46a1d9f..0090904785ab 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -623,8 +623,9 @@ vm_thread_stack_back(vm_offset_t ks, vm_page_t ma[], int npages, int req_class, m = vm_page_grab(obj, pindex + n, VM_ALLOC_NOCREAT | VM_ALLOC_WIRED); if (m == NULL) { - m = vm_page_alloc_domain(obj, pindex + n, domain, - req_class | VM_ALLOC_WIRED); + m = n > 0 ? ma[n - 1] : vm_page_mpred(obj, pindex); + m = vm_page_alloc_domain_after(obj, pindex + n, domain, + req_class | VM_ALLOC_WIRED, m); } if (m == NULL) break; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f2b3baf419a0..054832e3f19a 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2014,6 +2014,18 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex) } /* + * vm_page_mpred: + * + * Return the greatest page of the object with index <= pindex, + * or NULL, if there is none. Assumes object lock is held. + */ +vm_page_t +vm_page_mpred(vm_object_t object, vm_pindex_t pindex) +{ + return (vm_radix_lookup_le(&object->rtree, pindex)); +} + +/* * vm_page_alloc: * * Allocate and return a page that is associated with the specified @@ -2040,16 +2052,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) { return (vm_page_alloc_after(object, pindex, req, - vm_radix_lookup_le(&object->rtree, pindex))); -} - -vm_page_t -vm_page_alloc_domain(vm_object_t object, vm_pindex_t pindex, int domain, - int req) -{ - - return (vm_page_alloc_domain_after(object, pindex, domain, req, - vm_radix_lookup_le(&object->rtree, pindex))); + vm_page_mpred(object, pindex))); } /* @@ -2390,7 +2393,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, object)); KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); - mpred = vm_radix_lookup_le(&object->rtree, pindex); + mpred = vm_page_mpred(object, pindex); KASSERT(mpred == NULL || mpred->pindex != pindex, ("vm_page_alloc_contig: pindex already allocated")); for (;;) { @@ -5073,7 +5076,7 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, pflags = vm_page_grab_pflags(allocflags); i = 0; retrylookup: - m = vm_radix_lookup_le(&object->rtree, pindex + i); + m = vm_page_mpred(object, pindex + i); if (m == NULL || m->pindex != pindex + i) { mpred = m; m = NULL; diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index c7c1ec3872a8..b85342b784de 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -606,8 +606,8 @@ void vm_page_free_zero(vm_page_t m); void vm_page_activate (vm_page_t); void vm_page_advise(vm_page_t m, int advice); +vm_page_t vm_page_mpred(vm_object_t, vm_pindex_t); vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int); -vm_page_t vm_page_alloc_domain(vm_object_t, vm_pindex_t, int, int); vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t); vm_page_t vm_page_alloc_domain_after(vm_object_t, vm_pindex_t, int, int, vm_page_t); diff --git a/usr.bin/mididump/mididump.c b/usr.bin/mididump/mididump.c index 16bd775f10d4..8ebcce547ac4 100644 --- a/usr.bin/mididump/mididump.c +++ b/usr.bin/mididump/mididump.c @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +#include <sys/param.h> #include <sys/soundcard.h> #include <err.h> @@ -39,7 +40,6 @@ #include <string.h> #include <unistd.h> -#define ARRLEN(x) (sizeof(x) / sizeof(x[0])) #define NOTE2OCTAVE(n) (n / 12 - 1) #define NOTE2FREQ(n) (440 * pow(2.0f, ((float)n - 69) / 12)) #define CHAN_MASK 0x0f @@ -189,7 +189,7 @@ main(int argc, char *argv[]) case 0x90 ... 0x9f: b1 = read_byte(fd); b2 = read_byte(fd); - pn = ¬es[b1 % ARRLEN(notes)]; + pn = ¬es[b1 % nitems(notes)]; snprintf(buf, sizeof(buf), "%s%d", pn->name, NOTE2OCTAVE(b1)); if (pn->alt != NULL) { @@ -211,7 +211,7 @@ main(int argc, char *argv[]) case 0xb0 ... 0xbf: b1 = read_byte(fd); b2 = read_byte(fd); - if (b1 > ARRLEN(ctls) - 1) + if (b1 > nitems(ctls) - 1) break; printf("Control/Mode change channel=%d, " "control=%d (%s), value=%d", |