PERFORCE change 48552 for review
Robert Watson
rwatson at FreeBSD.org
Tue Mar 9 21:06:29 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48552
Change 48552 by rwatson at rwatson_paprika on 2004/03/09 21:06:02
Integrate netperf_socket:
- Giant no longer required for some more kernel memory map
operations.
- Move ah_algorithms to static const global instad of function local
to make it more clear that no synchronization is required
(loopback via KAME).
Affected files ...
.. //depot/projects/netperf_socket/sys/i386/i386/vm_machdep.c#4 integrate
.. //depot/projects/netperf_socket/sys/netinet6/ah_core.c#2 integrate
.. //depot/projects/netperf_socket/sys/vm/uma_core.c#4 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_fault.c#3 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/i386/i386/vm_machdep.c#4 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.229 2004/03/09 20:53:01 jb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.230 2004/03/10 04:44:42 alc Exp $");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
@@ -320,10 +320,8 @@
* XXX do we need to move the TSS off the allocated pages
* before freeing them? (not done here)
*/
- mtx_lock(&Giant);
kmem_free(kernel_map, (vm_offset_t)pcb->pcb_ext,
ctob(IOPAGES + 1));
- mtx_unlock(&Giant);
pcb->pcb_ext = 0;
}
}
==== //depot/projects/netperf_socket/sys/netinet6/ah_core.c#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/ah_core.c,v 1.22 2003/11/15 06:18:09 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/ah_core.c,v 1.23 2004/03/10 04:56:54 rwatson Exp $ */
/* $KAME: ah_core.c,v 1.59 2003/07/25 10:17:14 itojun Exp $ */
/*
@@ -153,47 +153,48 @@
static void ah_update_mbuf __P((struct mbuf *, int, int,
const struct ah_algorithm *, struct ah_algorithm_state *));
+/* checksum algorithms */
+static const struct ah_algorithm ah_algorithms[] = {
+ { ah_sumsiz_1216, ah_common_mature, 128, 128, "hmac-md5",
+ ah_hmac_md5_init, ah_hmac_md5_loop,
+ ah_hmac_md5_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160, "hmac-sha1",
+ ah_hmac_sha1_init, ah_hmac_sha1_loop,
+ ah_hmac_sha1_result, },
+ { ah_sumsiz_1216, ah_keyed_md5_mature, 128, 128, "keyed-md5",
+ ah_keyed_md5_init, ah_keyed_md5_loop,
+ ah_keyed_md5_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160, "keyed-sha1",
+ ah_keyed_sha1_init, ah_keyed_sha1_loop,
+ ah_keyed_sha1_result, },
+ { ah_sumsiz_zero, ah_none_mature, 0, 2048, "none",
+ ah_none_init, ah_none_loop, ah_none_result, },
+ { ah_sumsiz_1216, ah_common_mature, 256, 256,
+ "hmac-sha2-256",
+ ah_hmac_sha2_256_init, ah_hmac_sha2_256_loop,
+ ah_hmac_sha2_256_result, },
+ { ah_sumsiz_1216, ah_common_mature, 384, 384,
+ "hmac-sha2-384",
+ ah_hmac_sha2_384_init, ah_hmac_sha2_384_loop,
+ ah_hmac_sha2_384_result, },
+ { ah_sumsiz_1216, ah_common_mature, 512, 512,
+ "hmac-sha2-512",
+ ah_hmac_sha2_512_init, ah_hmac_sha2_512_loop,
+ ah_hmac_sha2_512_result, },
+ { ah_sumsiz_1216, ah_common_mature, 160, 160,
+ "hmac-ripemd160",
+ ah_hmac_ripemd160_init, ah_hmac_ripemd160_loop,
+ ah_hmac_ripemd160_result, },
+ { ah_sumsiz_1216, ah_common_mature, 128, 128,
+ "aes-xcbc-mac",
+ ah_aes_xcbc_mac_init, ah_aes_xcbc_mac_loop,
+ ah_aes_xcbc_mac_result, },
+};
+
const struct ah_algorithm *
ah_algorithm_lookup(idx)
int idx;
{
- /* checksum algorithms */
- static struct ah_algorithm ah_algorithms[] = {
- { ah_sumsiz_1216, ah_common_mature, 128, 128, "hmac-md5",
- ah_hmac_md5_init, ah_hmac_md5_loop,
- ah_hmac_md5_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160, "hmac-sha1",
- ah_hmac_sha1_init, ah_hmac_sha1_loop,
- ah_hmac_sha1_result, },
- { ah_sumsiz_1216, ah_keyed_md5_mature, 128, 128, "keyed-md5",
- ah_keyed_md5_init, ah_keyed_md5_loop,
- ah_keyed_md5_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160, "keyed-sha1",
- ah_keyed_sha1_init, ah_keyed_sha1_loop,
- ah_keyed_sha1_result, },
- { ah_sumsiz_zero, ah_none_mature, 0, 2048, "none",
- ah_none_init, ah_none_loop, ah_none_result, },
- { ah_sumsiz_1216, ah_common_mature, 256, 256,
- "hmac-sha2-256",
- ah_hmac_sha2_256_init, ah_hmac_sha2_256_loop,
- ah_hmac_sha2_256_result, },
- { ah_sumsiz_1216, ah_common_mature, 384, 384,
- "hmac-sha2-384",
- ah_hmac_sha2_384_init, ah_hmac_sha2_384_loop,
- ah_hmac_sha2_384_result, },
- { ah_sumsiz_1216, ah_common_mature, 512, 512,
- "hmac-sha2-512",
- ah_hmac_sha2_512_init, ah_hmac_sha2_512_loop,
- ah_hmac_sha2_512_result, },
- { ah_sumsiz_1216, ah_common_mature, 160, 160,
- "hmac-ripemd160",
- ah_hmac_ripemd160_init, ah_hmac_ripemd160_loop,
- ah_hmac_ripemd160_result, },
- { ah_sumsiz_1216, ah_common_mature, 128, 128,
- "aes-xcbc-mac",
- ah_aes_xcbc_mac_init, ah_aes_xcbc_mac_loop,
- ah_aes_xcbc_mac_result, },
- };
switch (idx) {
case SADB_AALG_MD5HMAC:
==== //depot/projects/netperf_socket/sys/vm/uma_core.c#4 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.92 2004/03/07 07:00:46 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.93 2004/03/10 04:44:43 alc Exp $");
/* I should really use ktr.. */
/*
@@ -2052,17 +2052,7 @@
uma_large_free(uma_slab_t slab)
{
vsetobj((vm_offset_t)slab->us_data, kmem_object);
- /*
- * XXX: We get a lock order reversal if we don't have Giant:
- * vm_map_remove (locks system map) -> vm_map_delete ->
- * vm_map_entry_unwire -> vm_fault_unwire -> mtx_lock(&Giant)
- */
- if (!mtx_owned(&Giant)) {
- mtx_lock(&Giant);
- page_free(slab->us_data, slab->us_size, slab->us_flags);
- mtx_unlock(&Giant);
- } else
- page_free(slab->us_data, slab->us_size, slab->us_flags);
+ page_free(slab->us_data, slab->us_size, slab->us_flags);
uma_zfree_internal(slabzone, slab, NULL, 0);
}
==== //depot/projects/netperf_socket/sys/vm/vm_fault.c#3 (text+ko) ====
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.185 2004/02/15 00:42:26 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.186 2004/03/10 04:44:43 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1081,7 +1081,8 @@
pmap = vm_map_pmap(map);
- mtx_lock(&Giant);
+ if (pmap != kernel_pmap)
+ mtx_lock(&Giant);
/*
* Since the pages are wired down, we must be able to get their
* mappings from the physical map system.
@@ -1095,7 +1096,8 @@
vm_page_unlock_queues();
}
}
- mtx_unlock(&Giant);
+ if (pmap != kernel_pmap)
+ mtx_unlock(&Giant);
}
/*
More information about the p4-projects
mailing list