PERFORCE change 54042 for review
Robert Watson
rwatson at FreeBSD.org
Wed Jun 2 13:12:19 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=54042
Change 54042 by rwatson at rwatson_tislabs on 2004/06/02 13:11:44
Integrate FreeBSD CVS HEAD into netperf_socket to prepare for
the next batch of netperf merging.
Affected files ...
.. //depot/projects/netperf_socket/sys/amd64/amd64/trap.c#6 integrate
.. //depot/projects/netperf_socket/sys/boot/i386/boot2/boot1.S#4 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac.c#6 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac_cam.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aac_disk.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/aac/aacvar.h#4 integrate
.. //depot/projects/netperf_socket/sys/dev/arl/if_arl.c#5 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/trap.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_clock.c#5 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_exec.c#10 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_exit.c#10 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_sig.c#9 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_thread.c#9 integrate
.. //depot/projects/netperf_socket/sys/kern/sched_ule.c#8 integrate
.. //depot/projects/netperf_socket/sys/netinet6/ip6_input.c#6 integrate
.. //depot/projects/netperf_socket/sys/sys/proc.h#9 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/amd64/amd64/trap.c#6 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.275 2004/03/13 19:15:43 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.276 2004/06/02 07:52:33 tjr Exp $");
/*
* AMD64 Trap and System call handling
@@ -262,7 +262,7 @@
break;
case T_PAGEFLT: /* page fault */
- if (td->td_flags & TDF_SA)
+ if (td->td_pflags & TDP_SA)
thread_user_enter(p, td);
i = trap_pfault(&frame, TRUE);
if (i == -1)
==== //depot/projects/netperf_socket/sys/boot/i386/boot2/boot1.S#4 (text+ko) ====
@@ -12,7 +12,7 @@
* warranties of merchantability and fitness for a particular
* purpose.
*
- * $FreeBSD: src/sys/boot/i386/boot2/boot1.S,v 1.27 2004/05/14 20:29:29 ru Exp $
+ * $FreeBSD: src/sys/boot/i386/boot2/boot1.S,v 1.28 2004/06/02 09:38:32 phk Exp $
*/
/* Memory Locations */
@@ -197,13 +197,16 @@
xorb %al,%al # Zero assumed bss from
rep # the end of boot2.bin
stosb # up to 0x10000
- callw seta20 # Enable A20
- jmp start+MEM_JMP-MEM_ORG # Start BTX
+
/*
* Enable A20 so we can access memory above 1 meg.
+ * Use the zero-valued %cx as a timeout for embedded hardware which do not
+ * have a keyboard controller.
*/
seta20: cli # Disable interrupts
-seta20.1: inb $0x64,%al # Get status
+seta20.1: dec %cx # Timeout?
+ jz seta20.3 # Yes
+ inb $0x64,%al # Get status
testb $0x2,%al # Busy?
jnz seta20.1 # Yes
movb $0xd1,%al # Command: Write
@@ -213,8 +216,12 @@
jnz seta20.2 # Yes
movb $0xdf,%al # Enable
outb %al,$0x60 # A20
+seta20.3:
sti # Enable interrupts
- retw # To caller
+
+ jmp start+MEM_JMP-MEM_ORG # Start BTX
+
+
/*
* Trampoline used to call read from within boot1.
*/
==== //depot/projects/netperf_socket/sys/dev/aac/aac.c#6 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.93 2004/06/01 15:50:11 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.94 2004/06/02 18:15:48 scottl Exp $");
/*
* Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
@@ -236,7 +236,6 @@
/*
* Initialize locks
*/
- AAC_LOCK_INIT(&sc->aac_sync_lock, "AAC sync FIB lock");
AAC_LOCK_INIT(&sc->aac_aifq_lock, "AAC AIF lock");
AAC_LOCK_INIT(&sc->aac_io_lock, "AAC I/O lock");
AAC_LOCK_INIT(&sc->aac_container_lock, "AAC container lock");
@@ -316,7 +315,7 @@
/* disconnect ourselves from the intrhook chain */
config_intrhook_disestablish(&sc->aac_ich);
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
mi = (struct aac_mntinfo *)&fib->data[0];
/* loop over possible containers */
@@ -526,7 +525,7 @@
*/
device_printf(sc->aac_dev, "shutting down controller...");
- aac_alloc_sync_fib(sc, &fib, AAC_SYNC_LOCK_FORCE);
+ aac_alloc_sync_fib(sc, &fib);
cc = (struct aac_close_command *)&fib->data[0];
bzero(cc, sizeof(struct aac_close_command));
@@ -1690,39 +1689,7 @@
return(0);
}
-/*
- * Grab the sync fib area.
- */
int
-aac_alloc_sync_fib(struct aac_softc *sc, struct aac_fib **fib, int flags)
-{
-
- /*
- * If the force flag is set, the system is shutting down, or in
- * trouble. Ignore the mutex.
- */
- if (!(flags & AAC_SYNC_LOCK_FORCE))
- AAC_LOCK_ACQUIRE(&sc->aac_sync_lock);
-
- *fib = &sc->aac_common->ac_sync_fib;
-
- return (1);
-}
-
-/*
- * Release the sync fib area.
- */
-void
-aac_release_sync_fib(struct aac_softc *sc)
-{
-
- AAC_LOCK_RELEASE(&sc->aac_sync_lock);
-}
-
-/*
- * Send a synchronous FIB to the controller and wait for a result.
- */
-int
aac_sync_fib(struct aac_softc *sc, u_int32_t command, u_int32_t xferstate,
struct aac_fib *fib, u_int16_t datasize)
{
@@ -2267,7 +2234,7 @@
debug_called(2);
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
fib->data[0] = 0;
if (aac_sync_fib(sc, RequestAdapterInfo, 0, fib, 1)) {
@@ -2588,7 +2555,7 @@
* doesn't tell us anything else! Re-enumerate the
* containers and sort things out.
*/
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
mi = (struct aac_mntinfo *)&fib->data[0];
do {
/*
@@ -2883,7 +2850,7 @@
device_t child;
int i, found, error;
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
c_cmd = (struct aac_ctcfg *)&fib->data[0];
bzero(c_cmd, sizeof(struct aac_ctcfg));
==== //depot/projects/netperf_socket/sys/dev/aac/aac_cam.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.15 2004/05/30 20:08:23 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.16 2004/06/02 18:15:48 scottl Exp $");
/*
* CAM front-end for communicating with non-DASD devices
@@ -523,7 +523,7 @@
return (CAM_REQ_ABORTED);
}
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
vmi = (struct aac_vmioctl *)&fib->data[0];
bzero(vmi, sizeof(struct aac_vmioctl));
@@ -570,7 +570,7 @@
struct aac_vmi_devinfo_resp *vmi_resp;
int error;
- aac_alloc_sync_fib(sc, &fib, 0);
+ aac_alloc_sync_fib(sc, &fib);
vmi = (struct aac_vmioctl *)&fib->data[0];
bzero(vmi, sizeof(struct aac_vmioctl));
==== //depot/projects/netperf_socket/sys/dev/aac/aac_disk.c#4 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_disk.c,v 1.38 2004/05/30 20:08:23 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_disk.c,v 1.39 2004/06/02 18:15:48 scottl Exp $");
#include "opt_aac.h"
@@ -246,7 +246,8 @@
}
}
- aac_alloc_sync_fib(sc, &fib, AAC_SYNC_LOCK_FORCE);
+ /* Skip aac_alloc_sync_fib(). We don't want to mess with sleep locks */
+ fib = &sc->aac_common->ac_sync_fib;
bw = (struct aac_blockwrite *)&fib->data[0];
while (length > 0) {
==== //depot/projects/netperf_socket/sys/dev/aac/aacvar.h#4 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.42 2004/05/30 22:40:28 scottl Exp $
+ * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.43 2004/06/02 18:15:48 scottl Exp $
*/
#include <sys/bio.h>
@@ -332,10 +332,10 @@
TAILQ_HEAD(,aac_container) aac_container_tqh;
aac_lock_t aac_container_lock;
- /* Protect the sync fib */
-#define AAC_SYNC_LOCK_FORCE (1 << 0)
- aac_lock_t aac_sync_lock;
-
+ /*
+ * The general I/O lock. This protects the sync fib, the lists, the
+ * queues, and the registers.
+ */
aac_lock_t aac_io_lock;
/* delayed activity infrastructure */
@@ -395,9 +395,6 @@
extern int aac_alloc_command(struct aac_softc *sc,
struct aac_command **cmp);
extern void aac_release_command(struct aac_command *cm);
-extern int aac_alloc_sync_fib(struct aac_softc *sc,
- struct aac_fib **fib, int flags);
-extern void aac_release_sync_fib(struct aac_softc *sc);
extern int aac_sync_fib(struct aac_softc *sc, u_int32_t command,
u_int32_t xferstate, struct aac_fib *fib,
u_int16_t datasize);
@@ -574,3 +571,20 @@
sc->aac_common->ac_printf[0] = 0;
AAC_QNOTIFY(sc, AAC_DB_PRINTF);
}
+
+static __inline int
+aac_alloc_sync_fib(struct aac_softc *sc, struct aac_fib **fib)
+{
+
+ AAC_LOCK_ACQUIRE(&sc->aac_io_lock);
+ *fib = &sc->aac_common->ac_sync_fib;
+ return (0);
+}
+
+static __inline void
+aac_release_sync_fib(struct aac_softc *sc)
+{
+
+ AAC_LOCK_RELEASE(&sc->aac_io_lock);
+}
+
==== //depot/projects/netperf_socket/sys/dev/arl/if_arl.c#5 (text+ko) ====
@@ -3,7 +3,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/arl/if_arl.c,v 1.6 2004/05/23 16:11:45 mux Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/arl/if_arl.c,v 1.7 2004/06/02 18:03:07 fjoe Exp $");
#include "opt_inet.h"
@@ -404,7 +404,7 @@
{
struct arl_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data;
- struct ieee80211req *ireq = (struct ieee80211req *)data;;
+ struct ieee80211req *ireq = (struct ieee80211req *)data;
d_thread_t *td = _ARL_CURPROC;
struct arl_req arlan_io;
int count, s, error = 0;
==== //depot/projects/netperf_socket/sys/i386/i386/trap.c#4 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.264 2004/03/11 00:17:45 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.265 2004/06/02 07:52:33 tjr Exp $");
/*
* 386 Trap and System call handling
@@ -313,7 +313,7 @@
break;
case T_PAGEFLT: /* page fault */
- if (td->td_flags & TDF_SA)
+ if (td->td_pflags & TDP_SA)
thread_user_enter(p, td);
i = trap_pfault(&frame, TRUE, eva);
==== //depot/projects/netperf_socket/sys/kern/kern_clock.c#5 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_clock.c,v 1.168 2004/05/03 00:48:11 cperciva Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_clock.c,v 1.169 2004/06/02 12:05:06 tjr Exp $");
#include "opt_ntp.h"
#include "opt_ddb.h"
@@ -458,7 +458,6 @@
* if there is no related user location yet, don't
* bother trying to count it.
*/
- td = curthread;
if (td->td_proc->p_flag & P_PROFIL)
addupc_intr(td, CLKF_PC(frame), 1);
}
==== //depot/projects/netperf_socket/sys/kern/kern_exec.c#10 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.244 2004/05/21 14:50:23 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.245 2004/06/02 07:52:34 tjr Exp $");
#include "opt_ktrace.h"
#include "opt_mac.h"
@@ -266,9 +266,7 @@
*/
p->p_flag &= ~P_SA;
td->td_mailbox = NULL;
- mtx_lock_spin(&sched_lock);
- td->td_flags &= ~TDF_SA;
- mtx_unlock_spin(&sched_lock);
+ td->td_pflags &= ~TDP_SA;
thread_single_end();
}
p->p_flag |= P_INEXEC;
==== //depot/projects/netperf_socket/sys/kern/kern_exit.c#10 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exit.c,v 1.232 2004/05/26 12:09:38 tmm Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exit.c,v 1.233 2004/06/02 07:52:34 tjr Exp $");
#include "opt_compat.h"
#include "opt_ktrace.h"
@@ -162,9 +162,7 @@
* Turn off threading support.
*/
p->p_flag &= ~P_SA;
- mtx_lock_spin(&sched_lock);
- td->td_flags &= ~TDF_SA;
- mtx_unlock_spin(&sched_lock);
+ td->td_pflags &= ~TDP_SA;
thread_single_end(); /* Don't need this any more. */
}
==== //depot/projects/netperf_socket/sys/kern/kern_sig.c#9 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.278 2004/05/21 10:02:24 bde Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.279 2004/06/02 07:52:35 tjr Exp $");
#include "opt_compat.h"
#include "opt_ktrace.h"
@@ -1490,7 +1490,7 @@
int error;
p = td->td_proc;
- if (td->td_flags & TDF_SA) {
+ if (td->td_pflags & TDP_SA) {
if (td->td_mailbox == NULL)
thread_user_enter(p, td);
PROC_LOCK(p);
@@ -1524,7 +1524,7 @@
ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)],
&td->td_sigmask, code);
#endif
- if (!(td->td_flags & TDF_SA))
+ if (!(td->td_pflags & TDP_SA))
(*p->p_sysent->sv_sendsig)(
ps->ps_sigact[_SIG_IDX(sig)], sig,
&td->td_sigmask, code);
@@ -2291,7 +2291,7 @@
mtx_lock(&ps->ps_mtx);
}
- if (!(td->td_flags & TDF_SA && td->td_mailbox) &&
+ if (!(td->td_pflags & TDP_SA && td->td_mailbox) &&
action == SIG_DFL) {
/*
* Default action, where the default is to kill
@@ -2301,7 +2301,7 @@
sigexit(td, sig);
/* NOTREACHED */
} else {
- if (td->td_flags & TDF_SA && td->td_mailbox) {
+ if (td->td_pflags & TDP_SA && td->td_mailbox) {
if (sig == SIGKILL) {
mtx_unlock(&ps->ps_mtx);
sigexit(td, sig);
@@ -2350,7 +2350,7 @@
p->p_code = 0;
p->p_sig = 0;
}
- if (td->td_flags & TDF_SA && td->td_mailbox)
+ if (td->td_pflags & TDP_SA && td->td_mailbox)
thread_signal_add(curthread, sig);
else
(*p->p_sysent->sv_sendsig)(action, sig,
==== //depot/projects/netperf_socket/sys/kern/kern_thread.c#9 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.177 2004/05/21 14:50:23 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.178 2004/06/02 07:52:35 tjr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -609,7 +609,7 @@
return (error);
TIMESPEC_TO_TIMEVAL(&tv, &timeout);
}
- if (td->td_flags & TDF_SA)
+ if (td->td_pflags & TDP_SA)
td->td_pflags |= TDP_UPCALLING;
else {
ku->ku_mflags = fuword(&ku->ku_mailbox->km_flags);
@@ -748,7 +748,7 @@
if (virtual_cpu != 0)
ncpus = virtual_cpu;
if (!(mbx.km_flags & KMF_BOUND))
- sa = TDF_SA;
+ sa = TDP_SA;
else
ncpus = 1;
PROC_LOCK(p);
@@ -787,7 +787,7 @@
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(p);
} else {
- if (!first && ((td->td_flags & TDF_SA) ^ sa) != 0)
+ if (!first && ((td->td_pflags & TDP_SA) ^ sa) != 0)
return (EINVAL);
newkg = kg;
}
@@ -891,14 +891,14 @@
}
if (!sa) {
newtd->td_mailbox = mbx.km_curthread;
- newtd->td_flags &= ~TDF_SA;
+ newtd->td_pflags &= ~TDP_SA;
if (newtd != td) {
mtx_unlock_spin(&sched_lock);
cpu_set_upcall_kse(newtd, newku);
mtx_lock_spin(&sched_lock);
}
} else {
- newtd->td_flags |= TDF_SA;
+ newtd->td_pflags |= TDP_SA;
}
if (newtd != td)
setrunqueue(newtd);
@@ -1263,7 +1263,7 @@
struct thread *td = curthread;
struct ksegrp *kg = td->td_ksegrp;
- if (kg->kg_numupcalls == 0 || !(td->td_flags & TDF_SA))
+ if (kg->kg_numupcalls == 0 || !(td->td_pflags & TDP_SA))
return (0);
if (user) {
/* Current always do via ast() */
@@ -1621,8 +1621,8 @@
/* Let the new thread become owner of the upcall */
ku->ku_owner = td2;
td2->td_upcall = ku;
- td2->td_flags = TDF_SA;
- td2->td_pflags = TDP_UPCALLING;
+ td2->td_flags = 0;
+ td2->td_pflags = TDP_SA|TDP_UPCALLING;
td2->td_kse = NULL;
td2->td_state = TDS_CAN_RUN;
td2->td_inhibitors = 0;
@@ -1729,7 +1729,7 @@
* but for now do it every time.
*/
kg = td->td_ksegrp;
- if (td->td_flags & TDF_SA) {
+ if (td->td_pflags & TDP_SA) {
ku = td->td_upcall;
KASSERT(ku, ("%s: no upcall owned", __func__));
KASSERT((ku->ku_owner == td), ("%s: wrong owner", __func__));
@@ -1788,7 +1788,7 @@
ku = td->td_upcall;
/* Nothing to do with bound thread */
- if (!(td->td_flags & TDF_SA))
+ if (!(td->td_pflags & TDP_SA))
return (0);
/*
==== //depot/projects/netperf_socket/sys/kern/sched_ule.c#8 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.105 2004/04/22 21:37:46 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.106 2004/06/02 05:46:48 jeff Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,12 +74,6 @@
int realstathz;
int tickincr = 1;
-#ifdef SMP
-/* Callouts to handle load balancing SMP systems. */
-static struct callout kseq_lb_callout;
-static struct callout kseq_group_callout;
-#endif
-
/*
* These datastructures are allocated within their parent datastructure but
* are scheduler specific.
@@ -249,12 +243,16 @@
static int ksg_maxid;
static struct kseq kseq_cpu[MAXCPU];
static struct kseq_group kseq_groups[MAXCPU];
+static int bal_tick;
+static int gbal_tick;
+
#define KSEQ_SELF() (&kseq_cpu[PCPU_GET(cpuid)])
#define KSEQ_CPU(x) (&kseq_cpu[(x)])
#define KSEQ_ID(x) ((x) - kseq_cpu)
#define KSEQ_GROUP(x) (&kseq_groups[(x)])
#else /* !SMP */
static struct kseq kseq_cpu;
+
#define KSEQ_SELF() (&kseq_cpu)
#define KSEQ_CPU(x) (&kseq_cpu)
#endif
@@ -279,7 +277,8 @@
#ifdef SMP
static int kseq_transfer(struct kseq *ksq, struct kse *ke, int class);
static struct kse *runq_steal(struct runq *rq);
-static void sched_balance(void *arg);
+static void sched_balance(void);
+static void sched_balance_groups(void);
static void sched_balance_group(struct kseq_group *ksg);
static void sched_balance_pair(struct kseq *high, struct kseq *low);
static void kseq_move(struct kseq *from, int cpu);
@@ -448,16 +447,14 @@
*
*/
static void
-sched_balance(void *arg)
+sched_balance(void)
{
struct kseq_group *high;
struct kseq_group *low;
struct kseq_group *ksg;
- int timo;
int cnt;
int i;
- mtx_lock_spin(&sched_lock);
if (smp_started == 0)
goto out;
low = high = NULL;
@@ -480,24 +477,19 @@
sched_balance_pair(LIST_FIRST(&high->ksg_members),
LIST_FIRST(&low->ksg_members));
out:
- mtx_unlock_spin(&sched_lock);
- timo = random() % (hz * 2);
- callout_reset(&kseq_lb_callout, timo, sched_balance, NULL);
+ bal_tick = ticks + (random() % (hz * 2));
}
static void
-sched_balance_groups(void *arg)
+sched_balance_groups(void)
{
- int timo;
int i;
- mtx_lock_spin(&sched_lock);
+ mtx_assert(&sched_lock, MA_OWNED);
if (smp_started)
for (i = 0; i <= ksg_maxid; i++)
sched_balance_group(KSEQ_GROUP(i));
- mtx_unlock_spin(&sched_lock);
- timo = random() % (hz * 2);
- callout_reset(&kseq_group_callout, timo, sched_balance_groups, NULL);
+ gbal_tick = ticks + (random() % (hz * 2));
}
static void
@@ -514,8 +506,6 @@
high = NULL;
LIST_FOREACH(kseq, &ksg->ksg_members, ksq_siblings) {
load = kseq->ksq_load;
- if (kseq == KSEQ_CPU(0))
- load--;
if (high == NULL || load > high->ksq_load)
high = kseq;
if (low == NULL || load < low->ksq_load)
@@ -544,16 +534,6 @@
transferable = high->ksq_transferable;
high_load = high->ksq_load;
low_load = low->ksq_load;
- /*
- * XXX If we encounter cpu 0 we must remember to reduce it's
- * load by 1 to reflect the swi that is running the callout.
- * At some point we should really fix load balancing of the
- * swi and then this wont matter.
- */
- if (high == KSEQ_CPU(0))
- high_load--;
- if (low == KSEQ_CPU(0))
- low_load--;
} else {
transferable = high->ksq_group->ksg_transferable;
high_load = high->ksq_group->ksg_load;
@@ -873,7 +853,7 @@
ksq = &kseq_cpu[i];
ksg = &kseq_groups[i];
/*
- * Setup a kse group with one member.
+ * Setup a kseq group with one member.
*/
ksq->ksq_transferable = 0;
ksq->ksq_group = ksg;
@@ -920,16 +900,13 @@
}
ksg_maxid = smp_topology->ct_count - 1;
}
- callout_init(&kseq_lb_callout, CALLOUT_MPSAFE);
- callout_init(&kseq_group_callout, CALLOUT_MPSAFE);
- sched_balance(NULL);
/*
* Stagger the group and global load balancer so they do not
* interfere with each other.
*/
+ bal_tick = ticks + hz;
if (balance_groups)
- callout_reset(&kseq_group_callout, hz / 2,
- sched_balance_groups, NULL);
+ gbal_tick = ticks + (hz / 2);
#else
kseq_setup(KSEQ_SELF());
#endif
@@ -1398,6 +1375,13 @@
struct ksegrp *kg;
struct kse *ke;
+ mtx_assert(&sched_lock, MA_OWNED);
+#ifdef SMP
+ if (ticks == bal_tick)
+ sched_balance();
+ if (ticks == gbal_tick)
+ sched_balance_groups();
+#endif
/*
* sched_setup() apparently happens prior to stathz being set. We
* need to resolve the timers earlier in the boot so we can avoid
@@ -1417,7 +1401,6 @@
ke = td->td_kse;
kg = ke->ke_ksegrp;
- mtx_assert(&sched_lock, MA_OWNED);
/* Adjust ticks for pctcpu */
ke->ke_ticks++;
ke->ke_ltick = ticks;
==== //depot/projects/netperf_socket/sys/netinet6/ip6_input.c#6 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.72 2004/04/07 20:46:15 imp Exp $ */
+/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.73 2004/06/02 15:41:18 ume Exp $ */
/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */
/*
@@ -1107,13 +1107,8 @@
struct mbuf *m, **mp;
{
#define IS2292(x, y) ((in6p->in6p_flags & IN6P_RFC2292) ? (x) : (y))
- struct thread *td = curthread; /* XXX */
- int privileged = 0;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
- if (td && !suser(td))
- privileged++;
-
#ifdef SO_TIMESTAMP
if ((in6p->in6p_socket->so_options & SO_TIMESTAMP) != 0) {
struct timeval tv;
@@ -1169,16 +1164,13 @@
}
/*
- * IPV6_HOPOPTS socket option. We require super-user privilege
- * for the option, but it might be too strict, since there might
- * be some hop-by-hop options which can be returned to normal user.
- * See RFC 2292 section 6.
+ * IPV6_HOPOPTS socket option. Recall that we required super-user
+ * privilege for the option (see ip6_ctloutput), but it might be too
+ * strict, since there might be some hop-by-hop options which can be
+ * returned to normal user.
+ * See also RFC 2292 section 6 (or RFC 3542 section 8).
*/
if ((in6p->in6p_flags & IN6P_HOPOPTS) != 0) {
-#ifdef DIAGNOSTIC
- if (!privileged)
- panic("IN6P_HOPOPTS is set for unprivileged socket");
-#endif
/*
* Check if a hop-by-hop options header is contatined in the
* received packet, and if so, store the options as ancillary
@@ -1294,13 +1286,6 @@
if (!(in6p->in6p_flags & IN6P_DSTOPTS))
break;
- /*
- * We also require super-user privilege for
- * the option. See comments on IN6_HOPOPTS.
- */
- if (!privileged)
- break;
-
*mp = sbcreatecontrol((caddr_t)ip6e, elen,
IS2292(IPV6_2292DSTOPTS, IPV6_DSTOPTS),
IPPROTO_IPV6);
==== //depot/projects/netperf_socket/sys/sys/proc.h#9 (text+ko) ====
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)proc.h 8.15 (Berkeley) 5/19/95
- * $FreeBSD: src/sys/sys/proc.h,v 1.376 2004/05/26 12:09:39 tmm Exp $
+ * $FreeBSD: src/sys/sys/proc.h,v 1.377 2004/06/02 07:52:36 tjr Exp $
*/
#ifndef _SYS_PROC_H_
@@ -353,7 +353,6 @@
#define TDF_OWEUPC 0x008000 /* Owe thread an addupc() call at next AST. */
#define TDF_NEEDRESCHED 0x010000 /* Thread needs to yield. */
#define TDF_NEEDSIGCHK 0x020000 /* Thread may need signal delivery. */
-#define TDF_SA 0x040000 /* A scheduler activation based thread. */
#define TDF_UMTXWAKEUP 0x080000 /* Libthr thread must not sleep on a umtx. */
#define TDF_THRWAKEUP 0x100000 /* Libthr thread must not suspend itself. */
#define TDF_DEADLKTREAT 0x800000 /* Lock aquisition - deadlock treatment. */
@@ -365,6 +364,7 @@
#define TDP_UPCALLING 0x0008 /* This thread is doing an upcall. */
#define TDP_COWINPROGRESS 0x0010 /* Snapshot copy-on-write in progress. */
#define TDP_ALTSTACK 0x0020 /* Have alternate signal stack. */
+#define TDP_SA 0x0080 /* A scheduler activation based thread. */
#define TDI_SUSPENDED 0x0001 /* On suspension queue. */
#define TDI_SLEEPING 0x0002 /* Actually asleep! (tricky). */
More information about the p4-projects
mailing list