Date: Wed, 5 Oct 2016 18:03:17 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r306713 - in user/alc/PQ_LAUNDRY: lib/libc/stdlib lib/msun/ld80 lib/msun/src sys/cam sys/vm Message-ID: <201610051803.u95I3Hq1040052@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Wed Oct 5 18:03:17 2016 New Revision: 306713 URL: https://svnweb.freebsd.org/changeset/base/306713 Log: MFH r306708-306712 Modified: user/alc/PQ_LAUNDRY/lib/libc/stdlib/random.c user/alc/PQ_LAUNDRY/lib/msun/ld80/e_lgammal_r.c user/alc/PQ_LAUNDRY/lib/msun/src/e_lgammaf_r.c user/alc/PQ_LAUNDRY/sys/cam/cam_queue.c user/alc/PQ_LAUNDRY/sys/cam/cam_queue.h user/alc/PQ_LAUNDRY/sys/vm/vm_page.c user/alc/PQ_LAUNDRY/sys/vm/vm_page.h user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) Modified: user/alc/PQ_LAUNDRY/lib/libc/stdlib/random.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/stdlib/random.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/lib/libc/stdlib/random.c Wed Oct 5 18:03:17 2016 (r306713) @@ -270,16 +270,17 @@ void srandomdev(void) { int mib[2]; - size_t len; + size_t expected, len; if (rand_type == TYPE_0) - len = sizeof(state[0]); + expected = len = sizeof(state[0]); else - len = rand_deg * sizeof(state[0]); + expected = len = rand_deg * sizeof(state[0]); mib[0] = CTL_KERN; mib[1] = KERN_ARND; - sysctl(mib, 2, state, &len, NULL, 0); + if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) + abort(); if (rand_type != TYPE_0) { fptr = &state[rand_sep]; Modified: user/alc/PQ_LAUNDRY/lib/msun/ld80/e_lgammal_r.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/msun/ld80/e_lgammal_r.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/lib/msun/ld80/e_lgammal_r.c Wed Oct 5 18:03:17 2016 (r306713) @@ -249,7 +249,7 @@ sin_pil(long double x) long double lgammal_r(long double x, int *signgamp) { - long double nadj,p,p1,p2,p3,q,r,t,w,y,z; + long double nadj,p,p1,p2,q,r,t,w,y,z; uint64_t lx; int i; uint16_t hx,ix; Modified: user/alc/PQ_LAUNDRY/lib/msun/src/e_lgammaf_r.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/msun/src/e_lgammaf_r.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/lib/msun/src/e_lgammaf_r.c Wed Oct 5 18:03:17 2016 (r306713) @@ -122,7 +122,7 @@ sin_pif(float x) float __ieee754_lgammaf_r(float x, int *signgamp) { - float nadj,p,p1,p2,p3,q,r,t,w,y,z; + float nadj,p,p1,p2,q,r,t,w,y,z; int32_t hx; int i,ix; Modified: user/alc/PQ_LAUNDRY/sys/cam/cam_queue.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cam/cam_queue.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/sys/cam/cam_queue.c Wed Oct 5 18:03:17 2016 (r306713) @@ -176,8 +176,11 @@ camq_remove(struct camq *queue, int inde { cam_pinfo *removed_entry; - if (index == 0 || index > queue->entries) - return (NULL); + if (index <= 0 || index > queue->entries) + panic("%s: Attempt to remove out-of-bounds index %d " + "from queue %p of size %d", __func__, index, queue, + queue->entries); + removed_entry = queue->queue_array[index]; if (queue->entries != index) { queue->queue_array[index] = queue->queue_array[queue->entries]; Modified: user/alc/PQ_LAUNDRY/sys/cam/cam_queue.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cam/cam_queue.h Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/sys/cam/cam_queue.h Wed Oct 5 18:03:17 2016 (r306713) @@ -197,6 +197,11 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb struct ccb_hdr *old_ccb; struct camq *queue = &ccbq->queue; + KASSERT((new_ccb->ccb_h.func_code & XPT_FC_QUEUED) != 0 && + (new_ccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0, + ("%s: Cannot queue ccb %p func_code %#x", __func__, new_ccb, + new_ccb->ccb_h.func_code)); + /* * If queue is already full, try to resize. * If resize fail, push CCB with lowest priority out to the TAILQ. @@ -218,6 +223,7 @@ cam_ccbq_remove_ccb(struct cam_ccbq *ccb { struct ccb_hdr *cccb, *bccb; struct camq *queue = &ccbq->queue; + cam_pinfo *removed_entry __unused; /* If the CCB is on the TAILQ, remove it from there. */ if (ccb->ccb_h.pinfo.index == CAM_EXTRAQ_INDEX) { @@ -228,7 +234,10 @@ cam_ccbq_remove_ccb(struct cam_ccbq *ccb return; } - camq_remove(queue, ccb->ccb_h.pinfo.index); + removed_entry = camq_remove(queue, ccb->ccb_h.pinfo.index); + KASSERT(removed_entry == &ccb->ccb_h.pinfo, + ("%s: Removed wrong entry from queue (%p != %p)", __func__, + removed_entry, &ccb->ccb_h.pinfo)); /* * If there are some CCBs on TAILQ, find the best one and move it Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_page.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_page.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_page.c Wed Oct 5 18:03:17 2016 (r306713) @@ -398,7 +398,6 @@ vm_page_domain_init(struct vm_domain *vm vmd->vmd_free_count = 0; vmd->vmd_segs = 0; vmd->vmd_oom = FALSE; - vmd->vmd_pass = 0; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); @@ -3829,14 +3828,13 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag vm_cnt.v_free_count, vm_cnt.v_cache_count); for (dom = 0; dom < vm_ndomains; dom++) { db_printf( - "dom %d page_cnt %d free %d pq_act %d pq_inact %d pq_laund %d pass %d\n", + "dom %d page_cnt %d free %d pq_act %d pq_inact %d pq_laund %d\n", dom, vm_dom[dom].vmd_page_count, vm_dom[dom].vmd_free_count, vm_dom[dom].vmd_pagequeues[PQ_ACTIVE].pq_cnt, vm_dom[dom].vmd_pagequeues[PQ_INACTIVE].pq_cnt, - vm_dom[dom].vmd_pagequeues[PQ_LAUNDRY].pq_cnt, - vm_dom[dom].vmd_pass); + vm_dom[dom].vmd_pagequeues[PQ_LAUNDRY].pq_cnt); } } Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_page.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_page.h Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_page.h Wed Oct 5 18:03:17 2016 (r306713) @@ -227,7 +227,6 @@ struct vm_domain { u_int vmd_free_count; long vmd_segs; /* bitmask of the segments */ boolean_t vmd_oom; - int vmd_pass; /* local pagedaemon pass */ int vmd_oom_seq; int vmd_last_active_scan; struct vm_page vmd_laundry_marker; Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Oct 5 17:32:06 2016 (r306712) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Oct 5 18:03:17 2016 (r306713) @@ -1893,11 +1893,12 @@ static void vm_pageout_worker(void *arg) { struct vm_domain *domain; - int domidx; + int domidx, pass; bool target_met; domidx = (uintptr_t)arg; domain = &vm_dom[domidx]; + pass = 0; target_met = true; /* @@ -1959,9 +1960,9 @@ vm_pageout_worker(void *arg) * and try again later. */ mtx_unlock(&vm_page_queue_free_mtx); - if (domain->vmd_pass > 1) + if (pass > 1) pause("psleep", hz / 2); - domain->vmd_pass++; + pass++; } else { /* * Yes. Sleep until pages need to be reclaimed or @@ -1971,12 +1972,12 @@ vm_pageout_worker(void *arg) &vm_page_queue_free_mtx, PDROP | PVM, "psleep", hz) == 0) { PCPU_INC(cnt.v_pdwakeups); - domain->vmd_pass = 1; + pass = 1; } else - domain->vmd_pass = 0; + pass = 0; } - target_met = vm_pageout_scan(domain, domain->vmd_pass); + target_met = vm_pageout_scan(domain, pass); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610051803.u95I3Hq1040052>