svn commit: r253953 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm
Author: attilio Date: Mon Aug 5 08:55:35 2013 New Revision: 253953 URL: http://svnweb.freebsd.org/changeset/base/253953 Log: Revert r253939: We cannot busy a page before doing pagefaults. Infact, it can deadlock against vnode lock, as it tries to vget(). Other functions, right now, have an opposite lock ordering, like vm_object_sync(), which acquires the vnode lock first and then sleeps on the busy mechanism. Before this patch is reinserted we need to break this ordering. Sponsored by: EMC / Isilon storage division Reported by: kib Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/sys_process.c head/sys/vm/vm_extern.h head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_map.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 5 08:27:35 2013(r253952) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 5 08:55:35 2013(r253953) @@ -324,8 +324,7 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt } static vm_page_t -page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes, -boolean_t alloc) +page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) { vm_object_t obj; vm_page_t pp; @@ -347,8 +346,6 @@ page_busy(vnode_t *vp, int64_t start, in continue; } } else if (pp == NULL) { - if (!alloc) - break; pp = vm_page_alloc(obj, OFF_TO_IDX(start), VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | VM_ALLOC_NOBUSY); @@ -359,10 +356,8 @@ page_busy(vnode_t *vp, int64_t start, in if (pp != NULL) { ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); - vm_page_io_start(pp); - if (!alloc) - break; vm_object_pip_add(obj, 1); + vm_page_io_start(pp); pmap_remove_write(pp); vm_page_clear_dirty(pp, off, nbytes); } @@ -372,12 +367,55 @@ page_busy(vnode_t *vp, int64_t start, in } static void -page_unbusy(vm_page_t pp, boolean_t unalloc) +page_unbusy(vm_page_t pp) { vm_page_io_finish(pp); - if (unalloc) - vm_object_pip_subtract(pp->object, 1); + vm_object_pip_subtract(pp->object, 1); +} + +static vm_page_t +page_hold(vnode_t *vp, int64_t start) +{ + vm_object_t obj; + vm_page_t pp; + + obj = vp->v_object; + zfs_vmobject_assert_wlocked(obj); + + for (;;) { + if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && + pp->valid) { + if ((pp->oflags & VPO_BUSY) != 0) { + /* +* Reference the page before unlocking and +* sleeping so that the page daemon is less +* likely to reclaim it. +*/ + vm_page_reference(pp); + vm_page_sleep(pp, "zfsmwb"); + continue; + } + + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_page_lock(pp); + vm_page_hold(pp); + vm_page_unlock(pp); + + } else + pp = NULL; + break; + } + return (pp); +} + +static void +page_unhold(vm_page_t pp) +{ + + vm_page_lock(pp); + vm_page_unhold(pp); + vm_page_unlock(pp); } static caddr_t @@ -441,8 +479,7 @@ update_pages(vnode_t *vp, int64_t start, zfs_vmobject_wlock(obj); vm_page_undirty(pp); - } else if ((pp = page_busy(vp, start, off, nbytes, - TRUE)) != NULL) { + } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); @@ -451,7 +488,7 @@ update_pages(vnode_t *vp, int64_t start, zfs_unmap_page(sf); zfs_vmobject_wlock(obj); - page_unbusy(pp, TRUE); + page_unbusy(pp); } len -= nbytes; off = 0; @@ -561,7 +598,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len);
svn commit: r253956 - head/sys/conf
Author: gjb Date: Mon Aug 5 10:26:42 2013 New Revision: 253956 URL: http://svnweb.freebsd.org/changeset/base/253956 Log: Redirect svnversion stderr to /dev/null if we cannot determine the tree version, for example if the tree is checked out with an outdated svn from ports, but the base system svnlite is built. Approved by: kib (mentor) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shMon Aug 5 09:53:48 2013(r253955) +++ head/sys/conf/newvers.shMon Aug 5 10:26:42 2013(r253956) @@ -116,7 +116,7 @@ if [ -d "${SYSDIR}/../.git" ] ; then fi if [ -n "$svnversion" ] ; then - svn=`cd ${SYSDIR} && $svnversion` + svn=`cd ${SYSDIR} && $svnversion 2>/dev/null` case "$svn" in [0-9]*) svn=" r${svn}" ;; *) unset svn ;; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253957 - head/sbin/geom/class/eli
Author: crees (doc,ports committer) Date: Mon Aug 5 10:38:34 2013 New Revision: 253957 URL: http://svnweb.freebsd.org/changeset/base/253957 Log: Note NULL encryption method for GELI PR: docs/180551 Submitted by: r4...@tormail.org Approved by: gjb (mentor) Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 == --- head/sbin/geom/class/eli/geli.8 Mon Aug 5 10:26:42 2013 (r253956) +++ head/sbin/geom/class/eli/geli.8 Mon Aug 5 10:38:34 2013 (r253957) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2012 +.Dd July 5, 2013 .Dt GELI 8 .Os .Sh NAME @@ -285,11 +285,14 @@ Currently supported algorithms are: .Nm AES-XTS , .Nm AES-CBC , .Nm Blowfish-CBC , -.Nm Camellia-CBC +.Nm Camellia-CBC , +.Nm 3DES-CBC , and -.Nm 3DES-CBC . +.Nm NULL . The default and recommended algorithm is .Nm AES-XTS . +.Nm NULL +is unencrypted. .It Fl i Ar iterations Number of iterations to use with PKCS#5v2 when processing User Key passphrase component. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253958 - head/sys/cam
Author: mav Date: Mon Aug 5 11:48:40 2013 New Revision: 253958 URL: http://svnweb.freebsd.org/changeset/base/253958 Log: MFprojects/camlock r249505: Change CCB queue resize logic to be able safely handle overallocations: - (re)allocate queue space in power of 2 chunks with 64 elements minimum and never shrink it; with only 4/8 bytes per element size is insignificant. - automatically reallocate the queue to double size if it is overflowed. - if queue reallocation failed, store extra CCBs in unsorted TAILQ, fetching them back as soon as some queue element is freed. To free space in CCB for TAILQ linking, change highpowerq from keeping high-power CCBs to keeping devices frozen due to high-power CCBs. This encloses all pieces of queue resize logic inside of cam_queue.[ch], removing some not obvious duties from xpt_release_ccb(). Modified: head/sys/cam/cam.h head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h Modified: head/sys/cam/cam.h == --- head/sys/cam/cam.h Mon Aug 5 10:38:34 2013(r253957) +++ head/sys/cam/cam.h Mon Aug 5 11:48:40 2013(r253958) @@ -88,6 +88,7 @@ typedef struct { #define CAM_UNQUEUED_INDEX -1 #define CAM_ACTIVE_INDEX -2 #define CAM_DONEQ_INDEX-3 +#define CAM_EXTRAQ_INDEX INT_MAX } cam_pinfo; /* Modified: head/sys/cam/cam_queue.c == --- head/sys/cam/cam_queue.cMon Aug 5 10:38:34 2013(r253957) +++ head/sys/cam/cam_queue.cMon Aug 5 11:48:40 2013(r253958) @@ -284,39 +284,24 @@ u_int32_t cam_ccbq_resize(struct cam_ccbq *ccbq, int new_size) { int delta; - int space_left; delta = new_size - (ccbq->dev_active + ccbq->dev_openings); - space_left = new_size - - ccbq->queue.entries - - ccbq->held - - ccbq->dev_active; - - /* -* Only attempt to change the underlying queue size if we are -* shrinking it and there is space for all outstanding entries -* in the new array or we have been requested to grow the array. -* We don't fail in the case where we can't reduce the array size, -* but clients that care that the queue be "garbage collected" -* should detect this condition and call us again with the -* same size once the outstanding entries have been processed. -*/ - if (space_left < 0 -|| camq_resize(&ccbq->queue, new_size + (CAM_RL_VALUES - 1)) == - CAM_REQ_CMP) { - ccbq->devq_openings += delta; - ccbq->dev_openings += delta; + ccbq->devq_openings += delta; + ccbq->dev_openings += delta; + + new_size = imax(64, 1 << fls(new_size + new_size / 2)); + if (new_size > ccbq->queue.array_size) + return (camq_resize(&ccbq->queue, new_size)); + else return (CAM_REQ_CMP); - } else { - return (CAM_RESRC_UNAVAIL); - } } int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) + if (camq_init(&ccbq->queue, + imax(64, 1 << fls(openings + openings / 2))) != 0) return (1); ccbq->devq_openings = openings; ccbq->dev_openings = openings; Modified: head/sys/cam/cam_queue.h == --- head/sys/cam/cam_queue.hMon Aug 5 10:38:34 2013(r253957) +++ head/sys/cam/cam_queue.hMon Aug 5 11:48:40 2013(r253958) @@ -57,6 +57,8 @@ SLIST_HEAD(ccb_hdr_slist, ccb_hdr); struct cam_ccbq { struct camq queue; + struct ccb_hdr_tailqqueue_extra_head; + int queue_extra_entries; int devq_openings; int devq_allocating; int dev_openings; @@ -177,7 +179,7 @@ cam_ccbq_release_opening(struct cam_ccbq static __inline int cam_ccbq_pending_ccb_count(struct cam_ccbq *ccbq) { - return (ccbq->queue.entries); + return (ccbq->queue.entries + ccbq->queue_extra_entries); } static __inline void @@ -190,14 +192,61 @@ cam_ccbq_take_opening(struct cam_ccbq *c static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb) { + struct ccb_hdr *old_ccb; + struct camq *queue = &ccbq->queue; + ccbq->held--; - camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); + + /* +* If queue is already full, try to resize. +* If resize fail, push CCB with lowest priority out to the TAILQ. +*/ + if (queue->entries == queue->array_size && + camq_resize(&ccbq->queue, queue->array_size * 2) != CAM_REQ_CMP) { + old_ccb = (struct ccb
svn commit: r253960 - head/sys/cam
Author: mav Date: Mon Aug 5 12:15:53 2013 New Revision: 253960 URL: http://svnweb.freebsd.org/changeset/base/253960 Log: MFprojects/camlock r249006: Pass SIM pointer as an argument to camisr_runqueue() instead of doneq pointer. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c == --- head/sys/cam/cam_xpt.c Mon Aug 5 11:56:47 2013(r253959) +++ head/sys/cam/cam_xpt.c Mon Aug 5 12:15:53 2013(r253960) @@ -246,7 +246,7 @@ static xpt_devicefunc_t xptpassannouncef static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); static void camisr(void *); -static void camisr_runqueue(void *); +static void camisr_runqueue(struct cam_sim *); static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus); static dev_match_ret xptdevicematch(struct dev_match_pattern *patterns, @@ -3052,7 +3052,7 @@ xpt_polled_action(union ccb *start_ccb) dev->ccbq.dev_openings < 0) && (--timeout > 0)) { DELAY(100); (*(sim->sim_poll))(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); } dev->ccbq.devq_openings++; @@ -3062,7 +3062,7 @@ xpt_polled_action(union ccb *start_ccb) xpt_action(start_ccb); while(--timeout > 0) { (*(sim->sim_poll))(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; @@ -4309,7 +4309,7 @@ xpt_batch_done(struct cam_sim *sim) sim->flags &= ~CAM_SIM_BATCH; if (!TAILQ_EMPTY(&sim->sim_doneq) && (sim->flags & CAM_SIM_ON_DONEQ) == 0) - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); } union ccb * @@ -4929,7 +4929,7 @@ camisr(void *dummy) while ((sim = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, sim, links); CAM_SIM_LOCK(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); sim->flags &= ~CAM_SIM_ON_DONEQ; CAM_SIM_UNLOCK(sim); } @@ -4939,15 +4939,14 @@ camisr(void *dummy) } static void -camisr_runqueue(void *V_queue) +camisr_runqueue(struct cam_sim *sim) { - cam_isrq_t *queue = V_queue; struct ccb_hdr *ccb_h; - while ((ccb_h = TAILQ_FIRST(queue)) != NULL) { + while ((ccb_h = TAILQ_FIRST(&sim->sim_doneq)) != NULL) { int runq; - TAILQ_REMOVE(queue, ccb_h, sim_links.tqe); + TAILQ_REMOVE(&sim->sim_doneq, ccb_h, sim_links.tqe); ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; CAM_DEBUG(ccb_h->path, CAM_DEBUG_TRACE, @@ -4989,8 +4988,8 @@ camisr_runqueue(void *V_queue) dev = ccb_h->path->device; cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h); - ccb_h->path->bus->sim->devq->send_active--; - ccb_h->path->bus->sim->devq->send_openings++; + sim->devq->send_active--; + sim->devq->send_openings++; runq = TRUE; if (((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 @@ -5011,14 +5010,12 @@ camisr_runqueue(void *V_queue) && (--dev->tag_delay_count == 0)) xpt_start_tags(ccb_h->path); if (!device_is_queued(dev)) { - (void)xpt_schedule_devq( - ccb_h->path->bus->sim->devq, dev); + (void)xpt_schedule_devq(sim->devq, dev); } } if (ccb_h->status & CAM_RELEASE_SIMQ) { - xpt_release_simq(ccb_h->path->bus->sim, -/*run_queue*/TRUE); + xpt_release_simq(sim, /*run_queue*/TRUE); ccb_h->status &= ~CAM_RELEASE_SIMQ; runq = FALSE; } @@ -5029,7 +5026,7 @@ camisr_runqueue(void *V_queue) /*run_queue*/TRUE); ccb_h->status &= ~CAM_DEV_QFRZN; } else if (runq) { - xpt_run_devq(ccb_h->path->bus->sim->devq); + xpt_run_devq(sim->devq); } /* Call the peripheral driver's callback */ ___ svn-sr
svn commit: r253965 - head/sys/dev/ixgbe
Author: jfv Date: Mon Aug 5 16:16:50 2013 New Revision: 253965 URL: http://svnweb.freebsd.org/changeset/base/253965 Log: Correct a fat-finger in the last delta. MFC after: ASAP Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Mon Aug 5 12:55:23 2013(r253964) +++ head/sys/dev/ixgbe/ixgbe.c Mon Aug 5 16:16:50 2013(r253965) @@ -1581,7 +1581,7 @@ ixgbe_msix_link(void *arg) /* First get the cause */ reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); /* Be sure the queue bits are not cleared */ - reg_eicr = ~IXGBE_EICR_RTX_QUEUE; + reg_eicr &= ~IXGBE_EICR_RTX_QUEUE; /* Clear interrupt with write */ IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253967 - head/sys/fs/tmpfs
Author: kib Date: Mon Aug 5 18:53:59 2013 New Revision: 253967 URL: http://svnweb.freebsd.org/changeset/base/253967 Log: The tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node, in particular, from the tmpfs_lookup VOP method. If LK_NOWAIT is not specified in the lkflags, the lookup is supposed to return an alive vnode whenever the underlying node is valid. Currently, the tmpfs_alloc_vp() returns ENOENT if the vnode attached to node exists and is being reclaimed. This causes spurious ENOENT errors from lookup on tmpfs and corresponding random 'No such file' failures from syscalls working with tmpfs files. Fix this by waiting for the doomed vnode to be detached from the tmpfs node if sleepable allocation is requested. Note that filesystems which use vfs_hash.c, correctly handle the case due to vfs_hash_get() looping when vget() returns ENOENT for sleepable requests. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs.h == --- head/sys/fs/tmpfs/tmpfs.h Mon Aug 5 18:11:02 2013(r253966) +++ head/sys/fs/tmpfs/tmpfs.h Mon Aug 5 18:53:59 2013(r253967) @@ -307,6 +307,7 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_VNODE_ALLOCATING 1 #define TMPFS_VNODE_WANT 2 #define TMPFS_VNODE_DOOMED 4 +#defineTMPFS_VNODE_WRECLAIM8 /* - */ /* Modified: head/sys/fs/tmpfs/tmpfs_subr.c == --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Aug 5 18:11:02 2013 (r253966) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Aug 5 18:53:59 2013 (r253967) @@ -479,11 +479,32 @@ tmpfs_alloc_vp(struct mount *mp, struct error = 0; loop: TMPFS_NODE_LOCK(node); +loop1: if ((vp = node->tn_vnode) != NULL) { MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); + if ((node->tn_type == VDIR && node->tn_dir.tn_parent == NULL) || + ((vp->v_iflag & VI_DOOMED) != 0 && + (lkflag & LK_NOWAIT) != 0)) { + VI_UNLOCK(vp); + TMPFS_NODE_UNLOCK(node); + error = ENOENT; + vp = NULL; + goto out; + } + if ((vp->v_iflag & VI_DOOMED) != 0) { + VI_UNLOCK(vp); + node->tn_vpstate |= TMPFS_VNODE_WRECLAIM; + while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) { + msleep(&node->tn_vnode, TMPFS_NODE_MTX(node), + 0, "tmpfsE", 0); + } + goto loop1; + } TMPFS_NODE_UNLOCK(node); error = vget(vp, lkflag | LK_INTERLOCK, curthread); + if (error == ENOENT) + goto loop; if (error != 0) { vp = NULL; goto out; @@ -620,6 +641,9 @@ tmpfs_free_vp(struct vnode *vp) mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); node->tn_vnode = NULL; + if ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) + wakeup(&node->tn_vnode); + node->tn_vpstate &= ~TMPFS_VNODE_WRECLAIM; vp->v_data = NULL; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253968 - in head/sys/arm: arm include
Author: andrew Date: Mon Aug 5 19:06:28 2013 New Revision: 253968 URL: http://svnweb.freebsd.org/changeset/base/253968 Log: When entering exception handlers we may not have an aligned stack. This is because an exception may happen at any time. The stack alignment rules on ARM EABI state the only place the stack must be 8-byte aligned is on a function boundary. If an exception happens while a function is setting up or tearing down it's stack frame it may not be correctly aligned. There is also no requirement for it to be when the function is a leaf node. The fix is to align the stack after we have stored a backup of the old stack pointer, but before we have stored anything in the trapframe. Along with this we need to adjust the size of the trapframe by 4 bytes to ensure the stack below it is also correctly aligned. Modified: head/sys/arm/arm/vm_machdep.c head/sys/arm/include/asmacros.h head/sys/arm/include/frame.h Modified: head/sys/arm/arm/vm_machdep.c == --- head/sys/arm/arm/vm_machdep.c Mon Aug 5 18:53:59 2013 (r253967) +++ head/sys/arm/arm/vm_machdep.c Mon Aug 5 19:06:28 2013 (r253968) @@ -74,10 +74,11 @@ __FBSDID("$FreeBSD$"); #include /* - * struct switchframe must be a multiple of 8 for correct stack alignment + * struct switchframe and trapframe must both be a multiple of 8 + * for correct stack alignment. */ CTASSERT(sizeof(struct switchframe) == 24); -CTASSERT(sizeof(struct trapframe) == 76); +CTASSERT(sizeof(struct trapframe) == 80); #ifndef NSFBUFS #define NSFBUFS(512 + maxusers * 16) Modified: head/sys/arm/include/asmacros.h == --- head/sys/arm/include/asmacros.h Mon Aug 5 18:53:59 2013 (r253967) +++ head/sys/arm/include/asmacros.h Mon Aug 5 19:06:28 2013 (r253968) @@ -63,6 +63,7 @@ */ #ifdef ARM_TP_ADDRESS #define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ str lr, [sp, #-4]!; /* Push the return address */ \ sub sp, sp, #(4*17);/* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ @@ -78,6 +79,7 @@ str r1, [r0, #4]; #else #define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ str lr, [sp, #-4]!; /* Push the return address */ \ sub sp, sp, #(4*17);/* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ @@ -100,7 +102,8 @@ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17);/* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ #else #define PULLFRAME \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ @@ -109,7 +112,8 @@ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17);/* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ #endif /* @@ -133,6 +137,8 @@ orr r2, r2, #(PSR_SVC32_MODE); \ msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ + bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ + sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ @@ -168,6 +174,8 @@ orr r2, r2, #(PSR_SVC32_MODE); \ msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ + bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ + sub sp, sp, #4; /* Pad trapframe to keep alignment *
svn commit: r253969 - head/sys/kern
Author: kib Date: Mon Aug 5 19:42:03 2013 New Revision: 253969 URL: http://svnweb.freebsd.org/changeset/base/253969 Log: Do not override the ENOENT error for the empty path, or EFAULT errors from copyins, with the relative lookup check. Discussed with: rwatson Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Mon Aug 5 19:06:28 2013(r253968) +++ head/sys/kern/vfs_lookup.c Mon Aug 5 19:42:03 2013(r253969) @@ -172,7 +172,8 @@ namei(struct nameidata *ndp) * not an absolute path, and not containing '..' components) to * a real file descriptor, not the pseudo-descriptor AT_FDCWD. */ - if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) { + if (error == 0 && IN_CAPABILITY_MODE(td) && + (cnp->cn_flags & NOCAPCHECK) == 0) { ndp->ni_strictrelative = 1; if (ndp->ni_dirfd == AT_FDCWD) { #ifdef KTRACE ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253970 - in head: sys/netinet6 sys/sys usr.sbin/ndp usr.sbin/rtadvctl usr.sbin/rtadvd usr.sbin/rtsold
Author: hrs Date: Mon Aug 5 20:13:02 2013 New Revision: 253970 URL: http://svnweb.freebsd.org/changeset/base/253970 Log: - Use time_uptime instead of time_second in data structures for PF_INET6 in kernel. This fixes various malfunction when the wall time clock is changed. Bump __FreeBSD_version to 141. - Use clock_gettime(CLOCK_MONOTONIC_FAST) in userland utilities. MFC after:1 month Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6.h head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_id.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/sys/param.h head/usr.sbin/ndp/ndp.c head/usr.sbin/rtadvctl/rtadvctl.c head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/rrenum.c head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.h head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtadvd/timer.h head/usr.sbin/rtadvd/timer_subr.c head/usr.sbin/rtadvd/timer_subr.h head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sys/netinet6/icmp6.c == --- head/sys/netinet6/icmp6.c Mon Aug 5 19:42:03 2013(r253969) +++ head/sys/netinet6/icmp6.c Mon Aug 5 20:13:02 2013(r253970) @@ -1931,8 +1931,8 @@ ni6_store_addrs(struct icmp6_nodeinfo *n ltime = ND6_INFINITE_LIFETIME; else { if (ifa6->ia6_lifetime.ia6t_expire > - time_second) - ltime = htonl(ifa6->ia6_lifetime.ia6t_expire - time_second); + time_uptime) + ltime = htonl(ifa6->ia6_lifetime.ia6t_expire - time_uptime); else ltime = 0; } Modified: head/sys/netinet6/in6.c == --- head/sys/netinet6/in6.c Mon Aug 5 19:42:03 2013(r253969) +++ head/sys/netinet6/in6.c Mon Aug 5 20:13:02 2013(r253970) @@ -523,12 +523,12 @@ in6_control(struct socket *so, u_long cm /* sanity for overflow - beware unsigned */ lt = &ifr->ifr_ifru.ifru_lifetime; if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME && - lt->ia6t_vltime + time_second < time_second) { + lt->ia6t_vltime + time_uptime < time_uptime) { error = EINVAL; goto out; } if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME && - lt->ia6t_pltime + time_second < time_second) { + lt->ia6t_pltime + time_uptime < time_uptime) { error = EINVAL; goto out; } @@ -632,12 +632,12 @@ in6_control(struct socket *so, u_long cm /* for sanity */ if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { ia->ia6_lifetime.ia6t_expire = - time_second + ia->ia6_lifetime.ia6t_vltime; + time_uptime + ia->ia6_lifetime.ia6t_vltime; } else ia->ia6_lifetime.ia6t_expire = 0; if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) { ia->ia6_lifetime.ia6t_preferred = - time_second + ia->ia6_lifetime.ia6t_pltime; + time_uptime + ia->ia6_lifetime.ia6t_pltime; } else ia->ia6_lifetime.ia6t_preferred = 0; break; @@ -1140,7 +1140,7 @@ in6_update_ifa(struct ifnet *ifp, struct ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; ia->ia_addr.sin6_family = AF_INET6; ia->ia_addr.sin6_len = sizeof(ia->ia_addr); - ia->ia6_createtime = time_second; + ia->ia6_createtime = time_uptime; if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) { /* * XXX: some functions expect that ifa_dstaddr is not @@ -1167,7 +1167,7 @@ in6_update_ifa(struct ifnet *ifp, struct } /* update timestamp */ - ia->ia6_updatetime = time_second; + ia->ia6_updatetime = time_uptime; /* set prefix mask */ if (ifra->ifra_prefixmask.sin6_len) { @@ -1217,12 +1217,12 @@ in6_update_ifa(struct ifnet *ifp, struct ia->ia6_lifetime = ifra->ifra_lifetime; if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { ia->ia6_lifetime.ia6t_expire = - time_second + ia->ia6_lifetime.ia6t_vltim
svn commit: r253971 - in head/sys: arm/arm arm/ti/omap4 boot/fdt/dts
Author: cognet Date: Mon Aug 5 20:14:56 2013 New Revision: 253971 URL: http://svnweb.freebsd.org/changeset/base/253971 Log: Let the platform calculate the timer frequency at runtime, and use that for the omap4, instead of relying on the (wrong) value provided in the dts. Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/boot/fdt/dts/pandaboard.dts Modified: head/sys/arm/arm/mpcore_timer.c == --- head/sys/arm/arm/mpcore_timer.c Mon Aug 5 20:13:02 2013 (r253970) +++ head/sys/arm/arm/mpcore_timer.c Mon Aug 5 20:14:56 2013 (r253971) @@ -115,6 +115,8 @@ static struct resource_spec arm_tmr_spec static struct arm_tmr_softc *arm_tmr_sc = NULL; +uint32_t platform_arm_tmr_freq = 0; + #definetmr_prv_read_4(reg) \ bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg) #definetmr_prv_write_4(reg, val) \ @@ -274,13 +276,18 @@ arm_tmr_attach(device_t dev) if (arm_tmr_sc) return (ENXIO); - /* Get the base clock frequency */ - node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) <= 0) { - device_printf(dev, "missing clock-frequency attribute in FDT\n"); - return (ENXIO); + if (platform_arm_tmr_freq != 0) + sc->clkfreq = platform_arm_tmr_freq; + else { + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "clock-frequency", &clock, + sizeof(clock))) <= 0) { + device_printf(dev, "missing clock-frequency attribute in FDT\n"); + return (ENXIO); + } + sc->clkfreq = fdt32_to_cpu(clock); } - sc->clkfreq = fdt32_to_cpu(clock); if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c == --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Mon Aug 5 20:13:02 2013 (r253970) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Mon Aug 5 20:14:56 2013 (r253971) @@ -1384,10 +1384,14 @@ omap4_prcm_probe(device_t dev) * RETURNS: * Always returns 0 */ + +extern uint32_t platform_arm_tmr_freq; + static int omap4_prcm_attach(device_t dev) { struct omap4_prcm_softc *sc = device_get_softc(dev); + unsigned int freq; if (bus_alloc_resources(dev, omap4_scm_res_spec, sc->sc_res)) { device_printf(dev, "could not allocate resources\n"); @@ -1396,6 +1400,8 @@ omap4_prcm_attach(device_t dev) omap4_prcm_sc = sc; ti_cpu_reset = omap4_prcm_reset; + omap4_clk_get_arm_fclk_freq(NULL, &freq); + platform_arm_tmr_freq = freq / 2; return (0); } Modified: head/sys/boot/fdt/dts/pandaboard.dts == --- head/sys/boot/fdt/dts/pandaboard.dtsMon Aug 5 20:13:02 2013 (r253970) +++ head/sys/boot/fdt/dts/pandaboard.dtsMon Aug 5 20:14:56 2013 (r253971) @@ -64,6 +64,13 @@ < 0x48240100 0x0100 >; /* CPU Interface Registers */ }; + omap4_prcm@4a306000 { + compatible = "ti,omap4_prcm"; + reg =< 0x4a306000 0x2000 + 0x4a004000 0x1000 + 0x4a008000 0x8000>; + }; + pl310@48242000 { compatible = "arm,pl310"; reg = < 0x48242000 0x1000 >; @@ -72,7 +79,6 @@ }; mp_tmr@48240200 { compatible = "arm,mpcore-timers"; - clock-frequency = < 50400 >; #address-cells = <1>; #size-cells = <0>; reg = < 0x48240200 0x100 >, /* Global Timer Registers */ @@ -110,13 +116,6 @@ "ag16", "usbb1_ulpiphy_dat7", "input_pulldown"; }; - omap4_prcm@4a306000 { - compatible = "ti,omap4_prcm"; - reg =< 0x4a306000 0x2000 - 0x4a004000 0x1000 - 0x4a008000 0x8000>; - }; - GPIO: gpio { #gpio-cells = <3>; compatible = "ti,gpio"; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253972 - head
Author: hrs Date: Mon Aug 5 20:30:15 2013 New Revision: 253972 URL: http://svnweb.freebsd.org/changeset/base/253972 Log: Document IPv6 timer value change in r253970. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Mon Aug 5 20:14:56 2013(r253971) +++ head/UPDATING Mon Aug 5 20:30:15 2013(r253972) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130806: + Timer values in IPv6 data structures now use time_uptime instead + of time_second. Although this is not a user-visible functional + change, userland utilities which directly use them---ndp(8), + rtadvd(8), and rtsold(8) in the base system---need to be updated + to r253970 or later. + 20130802: find -delete can now delete the pathnames given as arguments, instead of only files found below them or if the pathname did ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253887 - head/sys/dev/filemon
On Mon, 5 Aug 2013 13:22:06 +0900, Hiroki Sato writes: >"Simon J. Gerraty" wrote > in <20130804151754.8189758...@chaos.jnpr.net>: >sj> I can test it for you. > > Okay, I will wait for the results. Seems to work ok. Thanks --sjg ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253973 - head/sys/ufs/ffs
Author: mckusick Date: Mon Aug 5 22:01:16 2013 New Revision: 253973 URL: http://svnweb.freebsd.org/changeset/base/253973 Log: To better understand performance problems with journalled soft updates, we need to collect the highest level of allocation for each of the different soft update dependency structures. This change collects these statistics and makes them available using `sysctl debug.softdep.highuse'. Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 5 20:30:15 2013 (r253972) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 5 22:01:16 2013 (r253973) @@ -661,14 +661,16 @@ FEATURE(softupdates, "FFS soft-updates s #defineD_LAST D_SENTINEL unsigned long dep_current[D_LAST + 1]; +unsigned long dep_highuse[D_LAST + 1]; unsigned long dep_total[D_LAST + 1]; unsigned long dep_write[D_LAST + 1]; - static SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0, "soft updates stats"); static SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFLAG_RW, 0, "total dependencies allocated"); +static SYSCTL_NODE(_debug_softdep, OID_AUTO, highuse, CTLFLAG_RW, 0, +"high use dependencies allocated"); static SYSCTL_NODE(_debug_softdep, OID_AUTO, current, CTLFLAG_RW, 0, "current dependencies allocated"); static SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0, @@ -680,6 +682,8 @@ static SYSCTL_NODE(_debug_softdep, OID_A &dep_total[D_ ## type], 0, ""); \ SYSCTL_ULONG(_debug_softdep_current, OID_AUTO, str, CTLFLAG_RD,\ &dep_current[D_ ## type], 0, ""); \ +SYSCTL_ULONG(_debug_softdep_highuse, OID_AUTO, str, CTLFLAG_RD,\ + &dep_highuse[D_ ## type], 0, ""); \ SYSCTL_ULONG(_debug_softdep_write, OID_AUTO, str, CTLFLAG_RD, \ &dep_write[D_ ## type], 0, ""); @@ -1204,8 +1208,12 @@ jwork_insert(dst, jsegdep) */ static void workitem_free(struct worklist *, int); static void workitem_alloc(struct worklist *, int, struct mount *); +static void workitem_reassign(struct worklist *, int); -#defineWORKITEM_FREE(item, type) workitem_free((struct worklist *)(item), (type)) +#defineWORKITEM_FREE(item, type) \ + workitem_free((struct worklist *)(item), (type)) +#defineWORKITEM_REASSIGN(item, type) \ + workitem_reassign((struct worklist *)(item), (type)) static void workitem_free(item, type) @@ -1219,16 +1227,22 @@ workitem_free(item, type) if (item->wk_state & ONWORKLIST) panic("workitem_free: %s(0x%X) still on list", TYPENAME(item->wk_type), item->wk_state); - if (item->wk_type != type) + if (item->wk_type != type && type != D_NEWBLK) panic("workitem_free: type mismatch %s != %s", TYPENAME(item->wk_type), TYPENAME(type)); #endif if (item->wk_state & IOWAITING) wakeup(item); ump = VFSTOUFS(item->wk_mp); + KASSERT(ump->softdep_deps > 0, + ("workitem_free: %s: softdep_deps going negative", + ump->um_fs->fs_fsmnt)); if (--ump->softdep_deps == 0 && ump->softdep_req) wakeup(&ump->softdep_deps); - dep_current[type]--; + KASSERT(dep_current[item->wk_type] > 0, + ("workitem_free: %s: dep_current[%s] going negative", + ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); + dep_current[item->wk_type]--; free(item, DtoM(type)); } @@ -1247,12 +1261,31 @@ workitem_alloc(item, type, mp) ump = VFSTOUFS(mp); ACQUIRE_LOCK(&lk); dep_current[type]++; + if (dep_current[type] > dep_highuse[type]) + dep_highuse[type] = dep_current[type]; dep_total[type]++; ump->softdep_deps++; ump->softdep_accdeps++; FREE_LOCK(&lk); } +static void +workitem_reassign(item, newtype) + struct worklist *item; + int newtype; +{ + + KASSERT(dep_current[item->wk_type] > 0, + ("workitem_reassign: %s: dep_current[%s] going negative", + VFSTOUFS(item->wk_mp)->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); + dep_current[item->wk_type]--; + dep_current[newtype]++; + if (dep_current[newtype] > dep_highuse[newtype]) + dep_highuse[newtype] = dep_current[newtype]; + dep_total[newtype]++; + item->wk_type = newtype; +} + /* * Workitem queue management */ @@ -5122,7 +5155,7 @@ softdep_setup_allocdirect(ip, off, newbl /* * Convert the newblk to an allocdirect. */ - newblk->nb_list.wk_type = D_ALLOCDIRECT; + WORKITEM_REASSIGN(newblk, D_ALLOCDIRECT); adp = (struct allocdirect *)newbl
svn commit: r253974 - head/sys/ufs/ffs
Author: mckusick Date: Mon Aug 5 22:02:45 2013 New Revision: 253974 URL: http://svnweb.freebsd.org/changeset/base/253974 Log: With the addition of journalled soft updates, the "newblk" structures persist much longer than previously. Historically we had at most 100 entries; now the count may reach a million. With the increased count we spent far too much time looking them up in the grossly undersized newblk hash table. Configure the newblk hash table to accurately reflect the number of entries that it must index. Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 5 22:01:16 2013 (r253973) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 5 22:02:45 2013 (r253974) @@ -2393,7 +2393,7 @@ softdep_initialize() max_softdeps = desiredvnodes * 4; pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, &pagedep_hash); inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash); - newblk_hashtbl = hashinit(desiredvnodes / 5, M_NEWBLK, &newblk_hash); + newblk_hashtbl = hashinit(max_softdeps / 2, M_NEWBLK, &newblk_hash); bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash); i = 1 << (ffs(desiredvnodes / 10) - 1); indir_hashtbl = malloc(i * sizeof(indir_hashtbl[0]), M_FREEWORK, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253976 - head/sys/powerpc/aim
Author: jhibbits Date: Tue Aug 6 01:01:15 2013 New Revision: 253976 URL: http://svnweb.freebsd.org/changeset/base/253976 Log: Evict pages from the PTEG when it's full and trying to insert a new PTE, rather than panicking. Reviewed by: nwhitehorn MFC after:3 weeks Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Mon Aug 5 23:34:35 2013 (r253975) +++ head/sys/powerpc/aim/mmu_oea.c Tue Aug 6 01:01:15 2013 (r253976) @@ -548,7 +548,7 @@ moea_pte_set(struct pte *pt, struct pte /* * Update the PTE as defined in section 7.6.3.1. -* Note that the REF/CHG bits are from pvo_pt and thus should havce +* Note that the REF/CHG bits are from pvo_pt and thus should have * been saved so this routine can restore them (if desired). */ pt->pte_lo = pvo_pt->pte_lo; @@ -2021,10 +2021,8 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon pm->pm_stats.wired_count++; pm->pm_stats.resident_count++; - /* -* We hope this succeeds but it isn't required. -*/ i = moea_pte_insert(ptegidx, &pvo->pvo_pte.pte); + KASSERT(i < 8, ("Invalid PTE index")); if (i >= 0) { PVO_PTEGIDX_SET(pvo, i); } else { @@ -2163,6 +2161,9 @@ moea_pvo_to_pte(const struct pvo_entry * "pvo but no valid pte", pvo); } + if (pvo->pvo_pte.pte.pte_hi != pt->pte_hi) { + panic("moea_pvo_to_pte: pvo does not match pte: pvo hi: %8x, pte hi: %8x", pvo->pvo_pte.pte.pte_hi, pt->pte_hi); + } if ((pt->pte_hi ^ (pvo->pvo_pte.pte.pte_hi & ~PTE_VALID)) == PTE_VALID) { if ((pvo->pvo_pte.pte.pte_hi & PTE_VALID) == 0) { panic("moea_pvo_to_pte: pvo %p has valid pte in " @@ -2181,7 +2182,7 @@ moea_pvo_to_pte(const struct pvo_entry * if (pvo->pvo_pte.pte.pte_hi & PTE_VALID) { panic("moea_pvo_to_pte: pvo %p has invalid pte %p in " - "moea_pteg_table but valid in pvo", pvo, pt); + "moea_pteg_table but valid in pvo: %8x, %8x", pvo, pt, pvo->pvo_pte.pte.pte_hi, pt->pte_hi); } mtx_unlock(&moea_table_mutex); @@ -2305,11 +2306,42 @@ moea_pte_spill(vm_offset_t addr) return (1); } +static __inline struct pvo_entry * +moea_pte_spillable_ident(u_int ptegidx) +{ + struct pte *pt; + struct pvo_entry *pvo_walk, *pvo = NULL; + + LIST_FOREACH(pvo_walk, &moea_pvo_table[ptegidx], pvo_olink) { + if (pvo_walk->pvo_vaddr & PVO_WIRED) + continue; + + if (!(pvo_walk->pvo_pte.pte.pte_hi & PTE_VALID)) + continue; + + pt = moea_pvo_to_pte(pvo_walk, -1); + + if (pt == NULL) + continue; + + pvo = pvo_walk; + + mtx_unlock(&moea_table_mutex); + if (!(pt->pte_lo & PTE_REF)) + return (pvo_walk); + } + + return (pvo); +} + static int moea_pte_insert(u_int ptegidx, struct pte *pvo_pt) { struct pte *pt; + struct pvo_entry *victim_pvo; int i; + int victim_idx; + u_int pteg_bkpidx = ptegidx; mtx_assert(&moea_table_mutex, MA_OWNED); @@ -2337,8 +2369,46 @@ moea_pte_insert(u_int ptegidx, struct pt } } - panic("moea_pte_insert: overflow"); - return (-1); + /* Try again, but this time try to force a PTE out. */ + ptegidx = pteg_bkpidx; + + victim_pvo = moea_pte_spillable_ident(ptegidx); + if (victim_pvo == NULL) { + ptegidx ^= moea_pteg_mask; + victim_pvo = moea_pte_spillable_ident(ptegidx); + } + + if (victim_pvo == NULL) { + panic("moea_pte_insert: overflow"); + return (-1); + } + + victim_idx = moea_pvo_pte_index(victim_pvo, ptegidx); + + if (pteg_bkpidx == ptegidx) + pvo_pt->pte_hi &= ~PTE_HID; + else + pvo_pt->pte_hi |= PTE_HID; + + /* +* Synchronize the sacrifice PTE with its PVO, then mark both +* invalid. The PVO will be reused when/if the VM system comes +* here after a fault. +*/ + pt = &moea_pteg_table[victim_idx >> 3].pt[victim_idx & 7]; + + if (pt->pte_hi != victim_pvo->pvo_pte.pte.pte_hi) + panic("Victim PVO doesn't match PTE! PVO: %8x, PTE: %8x", victim_pvo->pvo_pte.pte.pte_hi, pt->pte_hi); + + /* +* Set the new PTE. +*/ + moea_pte_unset(pt, &victim_pvo->pvo_pte.pte, victim_pvo->pvo_vaddr); + PVO_PTEGIDX_CLR(victim_pvo); + moea_pte_overflow++; + moea_pte_set(pt, pvo_pt); + + return (victim_idx & 7); } static
svn commit: r253977 - head/sys/dev/filemon
Author: hrs Date: Tue Aug 6 02:14:30 2013 New Revision: 253977 URL: http://svnweb.freebsd.org/changeset/base/253977 Log: - Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified PID is valid for monitoring in FILEMON_SET_PID ioctl. - Set the monitored PID to -1 when the process exits. Suggested by: jilles Tested by:sjg MFC after:3 days Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c == --- head/sys/dev/filemon/filemon.c Tue Aug 6 01:01:15 2013 (r253976) +++ head/sys/dev/filemon/filemon.c Tue Aug 6 02:14:30 2013 (r253977) @@ -164,13 +164,12 @@ filemon_ioctl(struct cdev *dev, u_long c /* Set the monitored process ID. */ case FILEMON_SET_PID: - p = pfind(*((pid_t *)data)); - if (p == NULL) - return (EINVAL); - error = p_candebug(curthread, p); - if (error == 0) + error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, + &p); + if (error == 0) { filemon->pid = p->p_pid; - PROC_UNLOCK(p); + PROC_UNLOCK(p); + } break; default: Modified: head/sys/dev/filemon/filemon_wrapper.c == --- head/sys/dev/filemon/filemon_wrapper.c Tue Aug 6 01:01:15 2013 (r253976) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Aug 6 02:14:30 2013 (r253977) @@ -574,6 +574,7 @@ filemon_wrapper_sys_exit(struct thread * (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); filemon_output(filemon, filemon->msgbufr, len); + filemon->pid = -1; } /* Unlock the found filemon structure. */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253887 - head/sys/dev/filemon
"Simon J. Gerraty" wrote in <20130805201400.a181158...@chaos.jnpr.net>: sj> sj> On Mon, 5 Aug 2013 13:22:06 +0900, Hiroki Sato writes: sj> >"Simon J. Gerraty" wrote sj> > in <20130804151754.8189758...@chaos.jnpr.net>: sj> >sj> I can test it for you. sj> > sj> > Okay, I will wait for the results. sj> sj> Seems to work ok. Thank you. Committed in r253977. -- Hiroki pgp99B3uiAPYk.pgp Description: PGP signature
svn commit: r253978 - head/sys/powerpc/aim
Author: jhibbits Date: Tue Aug 6 02:58:16 2013 New Revision: 253978 URL: http://svnweb.freebsd.org/changeset/base/253978 Log: Remove an unnecessary panic. The PVO's PTE entry and the PTEG's PTE entry may not match, if the PVO's PTE is invalid. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Tue Aug 6 02:14:30 2013 (r253977) +++ head/sys/powerpc/aim/mmu_oea.c Tue Aug 6 02:58:16 2013 (r253978) @@ -2161,9 +2161,6 @@ moea_pvo_to_pte(const struct pvo_entry * "pvo but no valid pte", pvo); } - if (pvo->pvo_pte.pte.pte_hi != pt->pte_hi) { - panic("moea_pvo_to_pte: pvo does not match pte: pvo hi: %8x, pte hi: %8x", pvo->pvo_pte.pte.pte_hi, pt->pte_hi); - } if ((pt->pte_hi ^ (pvo->pvo_pte.pte.pte_hi & ~PTE_VALID)) == PTE_VALID) { if ((pvo->pvo_pte.pte.pte_hi & PTE_VALID) == 0) { panic("moea_pvo_to_pte: pvo %p has valid pte in " ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253979 - head/sys/powerpc/ofw
Author: jhibbits Date: Tue Aug 6 03:09:44 2013 New Revision: 253979 URL: http://svnweb.freebsd.org/changeset/base/253979 Log: Micro-optimize OFW syscons 8-bit blank. MFC after:1 week Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c == --- head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 6 02:58:16 2013 (r253978) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 6 03:09:44 2013 (r253979) @@ -586,14 +586,22 @@ ofwfb_blank_display8(video_adapter_t *ad { struct ofwfb_softc *sc; int i; - uint8_t *addr; + uint32_t *addr; + uint32_t color; + uint32_t end; sc = (struct ofwfb_softc *)adp; - addr = (uint8_t *) sc->sc_addr; + addr = (uint32_t *) sc->sc_addr; + end = (sc->sc_stride/4) * sc->sc_height; + + /* Splat 4 pixels at once. */ + color = (ofwfb_background(SC_NORM_ATTR) << 24) | + (ofwfb_background(SC_NORM_ATTR) << 16) | + (ofwfb_background(SC_NORM_ATTR) << 8) | + (ofwfb_background(SC_NORM_ATTR)); - /* Could be done a lot faster e.g. 32-bits, or Altivec'd */ - for (i = 0; i < sc->sc_stride*sc->sc_height; i++) - *(addr + i) = ofwfb_background(SC_NORM_ATTR); + for (i = 0; i < end; i++) + *(addr + i) = color; return (0); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253980 - in head: share/man/man4 sys/dev/ciss
Author: sbruno Date: Tue Aug 6 03:17:01 2013 New Revision: 253980 URL: http://svnweb.freebsd.org/changeset/base/253980 Log: Update ciss(4) with new models of raid controllers from HP Submitted by: scott.ben...@hp.com MFC after:2 weeks Sponsored by: Hewlett Packard Modified: head/share/man/man4/ciss.4 head/sys/dev/ciss/ciss.c Modified: head/share/man/man4/ciss.4 == --- head/share/man/man4/ciss.4 Tue Aug 6 03:09:44 2013(r253979) +++ head/share/man/man4/ciss.4 Tue Aug 6 03:17:01 2013(r253980) @@ -122,6 +122,8 @@ HP Smart Array P220i .It HP Smart Array P222 .It +HP Smart Array P230i +.It HP Smart Array P400 .It HP Smart Array P400i @@ -138,14 +140,30 @@ HP Smart Array P420i .It HP Smart Array P421 .It +HP Smart Array P430 +.It +HP Smart Array P430i +.It +HP Smart Array P431 +.It +HP Smart Array P530 +.It +HP Smart Array P531 +.It HP Smart Array P600 .It HP Smart Array P721m .It +HP Smart Array P731m +.It HP Smart Array P800 .It HP Smart Array P812 .It +HP Smart Array P830 +.It +HP Smart Array P830i +.It HP Modular Smart Array 20 (MSA20) .It HP Modular Smart Array 500 (MSA500) Modified: head/sys/dev/ciss/ciss.c == --- head/sys/dev/ciss/ciss.cTue Aug 6 03:09:44 2013(r253979) +++ head/sys/dev/ciss/ciss.cTue Aug 6 03:17:01 2013(r253980) @@ -338,6 +338,15 @@ static struct { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, +{ 0x103C, 0x1920, CISS_BOARD_SA5, "HP Smart Array P430i" }, +{ 0x103C, 0x1921, CISS_BOARD_SA5, "HP Smart Array P830i" }, +{ 0x103C, 0x1922, CISS_BOARD_SA5, "HP Smart Array P430" }, +{ 0x103C, 0x1923, CISS_BOARD_SA5, "HP Smart Array P431" }, +{ 0x103C, 0x1924, CISS_BOARD_SA5, "HP Smart Array P830" }, +{ 0x103C, 0x1926, CISS_BOARD_SA5, "HP Smart Array P731m" }, +{ 0x103C, 0x1928, CISS_BOARD_SA5, "HP Smart Array P230i" }, +{ 0x103C, 0x1929, CISS_BOARD_SA5, "HP Smart Array P530" }, +{ 0x103C, 0x192A, CISS_BOARD_SA5, "HP Smart Array P531" }, { 0, 0, 0, NULL } }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r253984 - head/contrib/bind9/libtool.m4
Author: erwin Date: Tue Aug 6 06:24:37 2013 New Revision: 253984 URL: http://svnweb.freebsd.org/changeset/base/253984 Log: Remove weirdly-named autofoo file. This is not needed for the (FreeBSD) build, and freebsd-update chokes on it. Somehow it did manage to be merged, despite my best efforts not to. Approved by: delphij (mentor) Deleted: head/contrib/bind9/libtool.m4/lt~obsolete.m4 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"