Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 18:34:29 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13182 for review
Message-ID:  <200206200134.g5K1YTG49194@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13182

Change 13182 by julian@julian_ref on 2002/06/19 18:33:42

	try MFC jeff's latest patch..

Affected files ...

... //depot/projects/kse/sys/netinet/if_ether.c#12 integrate
... //depot/projects/kse/sys/vm/vm_kern.c#8 integrate

Differences ...

==== //depot/projects/kse/sys/netinet/if_ether.c#12 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)if_ether.c	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/netinet/if_ether.c,v 1.94 2002/05/15 01:03:32 kbyanc Exp $
+ * $FreeBSD: src/sys/netinet/if_ether.c,v 1.95 2002/06/20 01:27:40 peter Exp $
  */
 
 /*
@@ -102,7 +102,7 @@
 static	LIST_HEAD(, llinfo_arp) llinfo_arp;
 
 struct	ifqueue arpintrq;
-static int	arp_inuse, arp_allocated;
+static int	arp_inuse, arp_allocated, arpinit_done;
 
 static int	arp_maxtries = 5;
 static int	useloopback = 1; /* use loopback interface for local traffic */
@@ -162,13 +162,10 @@
 	register struct sockaddr *gate = rt->rt_gateway;
 	register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
 	static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
-	static int arpinit_done;
 
 	if (!arpinit_done) {
 		arpinit_done = 1;
-		LIST_INIT(&llinfo_arp);
 		timeout(arptimer, (caddr_t)0, hz);
-		register_netisr(NETISR_ARP, arpintr);
 	}
 	if (rt->rt_flags & RTF_GATEWAY)
 		return;
@@ -494,6 +491,10 @@
 	register struct arphdr *ar;
 	int s;
 
+	if (!arpinit_done) {
+		arpinit_done = 1;
+		timeout(arptimer, (caddr_t)0, hz);
+	}
 	while (arpintrq.ifq_head) {
 		s = splimp();
 		IF_DEQUEUE(&arpintrq, m);
@@ -943,6 +944,8 @@
 
 	arpintrq.ifq_maxlen = 50;
 	mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF);
+	LIST_INIT(&llinfo_arp);
+	register_netisr(NETISR_ARP, arpintr);
 }
 
 SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);

==== //depot/projects/kse/sys/vm/vm_kern.c#8 (text+ko) ====

@@ -61,7 +61,7 @@
  * any improvements or extensions that they make and grant Carnegie the
  * rights to redistribute these changes.
  *
- * $FreeBSD: src/sys/vm/vm_kern.c,v 1.79 2002/06/19 20:47:18 jeff Exp $
+ * $FreeBSD: src/sys/vm/vm_kern.c,v 1.80 2002/06/19 23:49:57 jeff Exp $
  */
 
 /*
@@ -312,6 +312,7 @@
 	vm_map_entry_t entry;
 	vm_offset_t addr;
 	vm_page_t m;
+	int pflags;
 
 	GIANT_REQUIRED;
 
@@ -346,25 +347,26 @@
 	vm_map_insert(map, kmem_object, offset, addr, addr + size,
 		VM_PROT_ALL, VM_PROT_ALL, 0);
 
+	/*
+	 * Note: if M_NOWAIT specified alone, allocate from 
+	 * interrupt-safe queues only (just the free list).  If 
+	 * M_USE_RESERVE is also specified, we can also
+	 * allocate from the cache.  Neither of the latter two
+	 * flags may be specified from an interrupt since interrupts
+	 * are not allowed to mess with the cache queue.
+	 */
+
+	if ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
+		pflags = VM_ALLOC_INTERRUPT;
+	else
+		pflags = VM_ALLOC_SYSTEM;
+
+	if (flags & M_ZERO)
+		pflags |= VM_ALLOC_ZERO;
+
+
 	for (i = 0; i < size; i += PAGE_SIZE) {
-		int pflags;
-		/*
-		 * Note: if M_NOWAIT specified alone, allocate from 
-		 * interrupt-safe queues only (just the free list).  If 
-		 * M_USE_RESERVE is also specified, we can also
-		 * allocate from the cache.  Neither of the latter two
-		 * flags may be specified from an interrupt since interrupts
-		 * are not allowed to mess with the cache queue.
-		 */
 retry:
-		if ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-			pflags = VM_ALLOC_INTERRUPT;
-		else
-			pflags = VM_ALLOC_SYSTEM;
-
-		if (flags & M_ZERO)
-			pflags |= VM_ALLOC_ZERO;
-
 		m = vm_page_alloc(kmem_object, OFF_TO_IDX(offset + i), pflags);
 
 		/*
@@ -395,6 +397,8 @@
 			vm_map_unlock(map);
 			goto bad;
 		}
+		if (flags & M_ZERO && (m->flags & PG_ZERO) == 0)
+			vm_page_zero_fill(m);
 		vm_page_flag_clear(m, PG_ZERO);
 		m->valid = VM_PAGE_BITS_ALL;
 	}

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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