Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2007 17:23:29 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 125506 for review
Message-ID:  <200708211723.l7LHNTGB063270@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125506

Change 125506 by kmacy@kmacy_home:ethng on 2007/08/21 17:23:15

	IFC

Affected files ...

.. //depot/projects/ethng/src/share/man/man4/umodem.4#2 integrate
.. //depot/projects/ethng/src/sys/dev/drm/i915_dma.c#2 integrate
.. //depot/projects/ethng/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#2 integrate
.. //depot/projects/ethng/src/sys/i386/i386/pmap.c#2 integrate
.. //depot/projects/ethng/src/sys/kern/kern_cpu.c#3 integrate
.. //depot/projects/ethng/src/sys/kern/kern_switch.c#2 integrate
.. //depot/projects/ethng/src/sys/kern/sched_ule.c#2 integrate
.. //depot/projects/ethng/src/sys/kern/vfs_aio.c#2 integrate
.. //depot/projects/ethng/src/sys/vm/vm_map.c#2 integrate
.. //depot/projects/ethng/src/sys/vm/vm_map.h#2 integrate
.. //depot/projects/ethng/src/sys/vm/vm_mmap.c#2 integrate

Differences ...

==== //depot/projects/ethng/src/share/man/man4/umodem.4#2 (text+ko) ====

@@ -34,7 +34,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/umodem.4,v 1.9 2006/11/22 21:30:02 brueffer Exp $
+.\" $FreeBSD: src/share/man/man4/umodem.4,v 1.10 2007/08/21 13:20:13 sanpei Exp $
 .\"
 .Dd November 22, 2006
 .Dt UMODEM 4
@@ -85,6 +85,10 @@
 .It
 Curitel PC5740 Wireless Modem
 .It
+Kyocera AH-K3001V Mobile Phone(WILLCOM)
+.It
+Kyocera WX320K Mobile Phone(WILLCOM)
+.It
 Metricom Ricochet GS USB wireless modem
 .It
 Sierra MC5720 Wireless Modem

==== //depot/projects/ethng/src/sys/dev/drm/i915_dma.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/drm/i915_dma.c,v 1.5 2007/07/12 09:02:31 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/drm/i915_dma.c,v 1.6 2007/08/21 12:52:57 kib Exp $");
 
 #include "dev/drm/drmP.h"
 #include "dev/drm/drm.h"
@@ -125,18 +125,17 @@
 	drm_dma_handle_t *dmah;
 
 	DRM_UNLOCK();
+	memset(dev_priv, 0, sizeof(drm_i915_private_t));
 	dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 
 	    0xffffffff);
+	DRM_LOCK();
 	if (!dmah) {
 		dev->dev_private = (void *)dev_priv;
 		i915_dma_cleanup(dev);
 		DRM_ERROR("Can not allocate hardware status page\n");
-		DRM_LOCK();
 		return DRM_ERR(ENOMEM);
 	}
-	DRM_LOCK();
 
-	memset(dev_priv, 0, sizeof(drm_i915_private_t));
 	dev_priv->status_page_dmah = dmah;
 
 	DRM_GETSAREA();

==== //depot/projects/ethng/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c,v 1.9 2007/05/30 03:03:05 kan Exp $
+ * $FreeBSD: src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c,v 1.10 2007/08/20 15:33:22 cognet Exp $
  */
 
 #include <sys/param.h>
@@ -131,25 +131,25 @@
 	args->logbufsize = -1;
 
 	parse_int(mp, "flags", &args->flags, &error);
-	if (error != 0)
+	if (error != 0 && error != ENOENT)
 		return error;
 
 	args->flags |= XFSMNT_32BITINODES;
 
 	parse_int(mp, "sunit", &args->sunit, &error);
-	if (error != 0)
+	if (error != 0 && error != ENOENT)
 		return error;
 
 	parse_int(mp, "swidth", &args->swidth, &error);
-	if (error != 0)
+	if (error != 0 && error != ENOENT)
 		return error;
 
 	parse_int(mp, "logbufs", &args->logbufs, &error);
-	if (error != 0)
+	if (error != 0 && error != ENOENT)
 		return error;
 
 	parse_int(mp, "logbufsize", &args->logbufsize, &error);
-	if (error != 0)
+	if (error != 0 && error != ENOENT)
 		return error;
 
 	fsname = vfs_getopts(mp->mnt_optnew, "from", &error);

==== //depot/projects/ethng/src/sys/i386/i386/pmap.c#2 (text+ko) ====

@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.593 2007/07/01 07:08:26 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.594 2007/08/21 04:59:34 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1795,7 +1795,7 @@
 	static const struct timeval printinterval = { 60, 0 };
 	static struct timeval lastprint;
 	static vm_pindex_t colour;
-	int bit, field, page_req;
+	int bit, field;
 	pv_entry_t pv;
 	struct pv_chunk *pc;
 	vm_page_t m;
@@ -1830,8 +1830,7 @@
 		}
 	}
 	pc = (struct pv_chunk *)pmap_ptelist_alloc(&pv_vafree);
-	page_req = try ? VM_ALLOC_NORMAL : VM_ALLOC_SYSTEM; 
-	m = vm_page_alloc(NULL, colour, page_req |
+	m = vm_page_alloc(NULL, colour, VM_ALLOC_NORMAL |
 	    VM_ALLOC_NOOBJ | VM_ALLOC_WIRED);
 	if (m == NULL || pc == NULL) {
 		if (try) {
@@ -1860,7 +1859,7 @@
 		PV_STAT(pmap_collect_inactive++);
 		pmap_collect(pmap, &vm_page_queues[PQ_INACTIVE]);
 		if (m == NULL)
-			m = vm_page_alloc(NULL, colour, VM_ALLOC_SYSTEM |
+			m = vm_page_alloc(NULL, colour, VM_ALLOC_NORMAL |
 			    VM_ALLOC_NOOBJ | VM_ALLOC_WIRED);
 		if (pc == NULL)
 			pc = (struct pv_chunk *)pmap_ptelist_alloc(&pv_vafree);

==== //depot/projects/ethng/src/sys/kern/kern_cpu.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_cpu.c,v 1.26 2007/08/19 20:34:13 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_cpu.c,v 1.27 2007/08/20 06:28:26 njl Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -227,7 +227,7 @@
 	const struct cf_setting *set;
 	struct cf_saved_freq *saved_freq, *curr_freq;
 	struct pcpu *pc;
-	int cpu_id, error, i;
+	int error, i;
 
 	sc = device_get_softc(dev);
 	error = 0;
@@ -294,22 +294,17 @@
 			goto out;
 		}
 
-		/* Bind to the target CPU before switching, if necessary. */
-		cpu_id = PCPU_GET(cpuid);
+		/* Bind to the target CPU before switching. */
 		pc = cpu_get_pcpu(set->dev);
-		if (cpu_id != pc->pc_cpuid) {
-			thread_lock(curthread);
-			sched_bind(curthread, pc->pc_cpuid);
-			thread_unlock(curthread);
-		}
+		thread_lock(curthread);
+		sched_bind(curthread, pc->pc_cpuid);
+		thread_unlock(curthread);
 		CF_DEBUG("setting abs freq %d on %s (cpu %d)\n", set->freq,
 		    device_get_nameunit(set->dev), PCPU_GET(cpuid));
 		error = CPUFREQ_DRV_SET(set->dev, set);
-		if (cpu_id != pc->pc_cpuid) {
-			thread_lock(curthread);
-			sched_unbind(curthread);
-			thread_unlock(curthread);
-		}
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
 		if (error) {
 			goto out;
 		}
@@ -323,22 +318,17 @@
 			goto out;
 		}
 
-		/* Bind to the target CPU before switching, if necessary. */
-		cpu_id = PCPU_GET(cpuid);
+		/* Bind to the target CPU before switching. */
 		pc = cpu_get_pcpu(set->dev);
-		if (cpu_id != pc->pc_cpuid) {
-			thread_lock(curthread);
-			sched_bind(curthread, pc->pc_cpuid);
-			thread_unlock(curthread);
-		}
+		thread_lock(curthread);
+		sched_bind(curthread, pc->pc_cpuid);
+		thread_unlock(curthread);
 		CF_DEBUG("setting rel freq %d on %s (cpu %d)\n", set->freq,
 		    device_get_nameunit(set->dev), PCPU_GET(cpuid));
 		error = CPUFREQ_DRV_SET(set->dev, set);
-		if (cpu_id != pc->pc_cpuid) {
-			thread_lock(curthread);
-			sched_unbind(curthread);
-			thread_unlock(curthread);
-		}
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
 		if (error) {
 			/* XXX Back out any successful setting? */
 			goto out;

==== //depot/projects/ethng/src/sys/kern/kern_switch.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.133 2007/08/03 23:35:35 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.134 2007/08/20 06:36:12 jeff Exp $");
 
 #include "opt_sched.h"
 
@@ -360,45 +360,35 @@
 }
 
 static __inline int
-runq_findbit_from(struct runq *rq, u_char start)
+runq_findbit_from(struct runq *rq, u_char pri)
 {
 	struct rqbits *rqb;
-	int bit;
-	int pri;
+	rqb_word_t mask;
 	int i;
 
+	/*
+	 * Set the mask for the first word so we ignore priorities before 'pri'.
+	 */
+	mask = (rqb_word_t)-1 << (pri & (RQB_BPW - 1));
 	rqb = &rq->rq_status;
-	bit = start & (RQB_BPW -1);
-	pri = 0;
-	CTR1(KTR_RUNQ, "runq_findbit_from: start %d", start);
 again:
-	for (i = RQB_WORD(start); i < RQB_LEN; i++) {
-		CTR3(KTR_RUNQ, "runq_findbit_from: bits %d = %#x bit = %d",
-		    i, rqb->rqb_bits[i], bit);
-		if (rqb->rqb_bits[i]) {
-			if (bit != 0) {
-				for (pri = bit; pri < RQB_BPW; pri++)
-					if (rqb->rqb_bits[i] & (1ul << pri))
-						break;
-				bit = 0;
-				if (pri >= RQB_BPW)
-					continue;
-			} else
-				pri = RQB_FFS(rqb->rqb_bits[i]);
-			pri += (i << RQB_L2BPW);
-			CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d",
-			    rqb->rqb_bits[i], i, pri);
-			return (pri);
-		}
-		bit = 0;
+	for (i = RQB_WORD(pri); i < RQB_LEN; mask = -1, i++) {
+		mask = rqb->rqb_bits[i] & mask;
+		if (mask == 0)
+			continue;
+		pri = RQB_FFS(mask) + (i << RQB_L2BPW);
+		CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d",
+		    mask, i, pri);
+		return (pri);
 	}
-	if (start != 0) {
-		CTR0(KTR_RUNQ, "runq_findbit_from: restarting");
-		start = 0;
-		goto again;
-	}
-
-	return (-1);
+	if (pri == 0)
+		return (-1);
+	/*
+	 * Wrap back around to the beginning of the list just once so we
+	 * scan the whole thing.
+	 */
+	pri = 0;
+	goto again;
 }
 
 /*

==== //depot/projects/ethng/src/sys/kern/sched_ule.c#2 (text+ko) ====

@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.204 2007/08/04 01:21:28 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.205 2007/08/20 06:34:20 jeff Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_sched.h"
@@ -1328,6 +1328,12 @@
 		incr = 1;
 	tickincr = incr;
 #ifdef SMP
+	/*
+	 * Set steal thresh to log2(mp_ncpu) but no greater than 4.  This
+	 * prevents excess thrashing on large machines and excess idle on
+	 * smaller machines.
+	 */
+	steal_thresh = min(ffs(mp_ncpus) - 1, 4);
 	affinity = SCHED_AFFINITY_DEFAULT;
 #endif
 }

==== //depot/projects/ethng/src/sys/kern/vfs_aio.c#2 (text+ko) ====

@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.232 2007/06/10 01:50:05 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.233 2007/08/20 11:53:26 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -719,6 +719,7 @@
 	}
 	AIO_UNLOCK(ki);
 	taskqueue_drain(taskqueue_aiod_bio, &ki->kaio_task);
+	mtx_destroy(&ki->kaio_mtx);
 	uma_zfree(kaio_zone, ki);
 	p->p_aioinfo = NULL;
 }
@@ -837,7 +838,10 @@
 	 */
 	if (cb->aio_lio_opcode == LIO_READ) {
 		auio.uio_rw = UIO_READ;
-		error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, td);
+		if (auio.uio_resid == 0)
+			error = 0;
+		else
+			error = fo_read(fp, &auio, fp->f_cred, FOF_OFFSET, td);
 	} else {
 		if (fp->f_type == DTYPE_VNODE)
 			bwillwrite();

==== //depot/projects/ethng/src/sys/vm/vm_map.c#2 (text+ko) ====

@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.386 2007/05/31 22:52:15 attilio Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.387 2007/08/20 12:05:45 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -155,6 +155,22 @@
 #define PROC_VMSPACE_LOCK(p) do { } while (0)
 #define PROC_VMSPACE_UNLOCK(p) do { } while (0)
 
+/*
+ *	VM_MAP_RANGE_CHECK:	[ internal use only ]
+ *
+ *	Asserts that the starting and ending region
+ *	addresses fall within the valid range of the map.
+ */
+#define	VM_MAP_RANGE_CHECK(map, start, end)		\
+		{					\
+		if (start < vm_map_min(map))		\
+			start = vm_map_min(map);	\
+		if (end > vm_map_max(map))		\
+			end = vm_map_max(map);		\
+		if (start > end)			\
+			start = end;			\
+		}
+
 void
 vm_map_startup(void)
 {
@@ -1145,6 +1161,25 @@
 	return (0);
 }
 
+int
+vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
+    vm_offset_t *addr /* IN/OUT */, vm_size_t length, vm_prot_t prot,
+    vm_prot_t max, int cow)
+{
+	vm_offset_t start, end;
+	int result;
+
+	start = *addr;
+	vm_map_lock(map);
+	end = start + length;
+	VM_MAP_RANGE_CHECK(map, start, end);
+	(void) vm_map_delete(map, start, end);
+	result = vm_map_insert(map, object, offset, start, end, prot,
+	    max, cow);
+	vm_map_unlock(map);
+	return (result);
+}
+
 /*
  *	vm_map_find finds an unallocated region in the target address
  *	map with the given length.  The search is defined to be
@@ -1355,22 +1390,6 @@
 }
 
 /*
- *	VM_MAP_RANGE_CHECK:	[ internal use only ]
- *
- *	Asserts that the starting and ending region
- *	addresses fall within the valid range of the map.
- */
-#define	VM_MAP_RANGE_CHECK(map, start, end)		\
-		{					\
-		if (start < vm_map_min(map))		\
-			start = vm_map_min(map);	\
-		if (end > vm_map_max(map))		\
-			end = vm_map_max(map);		\
-		if (start > end)			\
-			start = end;			\
-		}
-
-/*
  *	vm_map_submap:		[ kernel use only ]
  *
  *	Mark the given range as handled by a subordinate map.

==== //depot/projects/ethng/src/sys/vm/vm_map.h#2 (text+ko) ====

@@ -57,7 +57,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- * $FreeBSD: src/sys/vm/vm_map.h,v 1.119 2006/05/29 21:28:56 tegge Exp $
+ * $FreeBSD: src/sys/vm/vm_map.h,v 1.120 2007/08/20 12:05:45 kib Exp $
  */
 
 /*
@@ -333,6 +333,7 @@
 vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t);
 int vm_map_delete (vm_map_t, vm_offset_t, vm_offset_t);
 int vm_map_find (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, boolean_t, vm_prot_t, vm_prot_t, int);
+int vm_map_fixed (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int);
 int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *);
 int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t);
 void vm_map_init (struct vm_map *, vm_offset_t, vm_offset_t);

==== //depot/projects/ethng/src/sys/vm/vm_mmap.c#2 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_mmap.c,v 1.212 2007/07/04 22:57:21 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_mmap.c,v 1.213 2007/08/20 12:05:45 kib Exp $");
 
 #include "opt_compat.h"
 #include "opt_hwpmc_hooks.h"
@@ -1341,7 +1341,6 @@
 		if (*addr != trunc_page(*addr))
 			return (EINVAL);
 		fitit = FALSE;
-		(void) vm_map_remove(map, *addr, *addr + size);
 	}
 	/*
 	 * Lookup/allocate object.
@@ -1400,8 +1399,11 @@
 	if (flags & MAP_STACK)
 		rv = vm_map_stack(map, *addr, size, prot, maxprot,
 		    docow | MAP_STACK_GROWS_DOWN);
+	else if (fitit)
+		rv = vm_map_find(map, object, foff, addr, size, TRUE,
+				 prot, maxprot, docow);
 	else
-		rv = vm_map_find(map, object, foff, addr, size, fitit,
+		rv = vm_map_fixed(map, object, foff, addr, size,
 				 prot, maxprot, docow);
 
 	if (rv != KERN_SUCCESS) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708211723.l7LHNTGB063270>