PERFORCE change 143608 for review
Marko Zec
zec at FreeBSD.org
Mon Jun 16 18:14:13 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143608
Change 143608 by zec at zec_tca51 on 2008/06/16 18:13:44
More cosmetic cleanups.
Affected files ...
.. //depot/projects/vimage/src/sys/kern/kern_exit.c#18 edit
.. //depot/projects/vimage/src/sys/kern/kern_fork.c#17 edit
.. //depot/projects/vimage/src/sys/kern/kern_switch.c#14 edit
.. //depot/projects/vimage/src/sys/kern/kern_timeout.c#13 edit
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#62 edit
.. //depot/projects/vimage/src/sys/kern/sched_4bsd.c#22 edit
.. //depot/projects/vimage/src/sys/kern/sys_socket.c#10 edit
.. //depot/projects/vimage/src/sys/kern/uipc_domain.c#12 edit
.. //depot/projects/vimage/src/sys/sys/vimage.h#56 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/kern_exit.c#18 (text+ko) ====
@@ -179,7 +179,6 @@
}
KASSERT(p->p_numthreads == 1,
("exit1: proc %p exiting with %d threads", p, p->p_numthreads));
-
/*
* Wakeup anyone in procfs' PIOCWAIT. They should have a hold
* on our vmspace, so we should block below until they have
@@ -699,7 +698,6 @@
AUDIT_ARG(pid, pid);
q = td->td_proc;
-
if (pid == 0) {
PROC_LOCK(q);
pid = -q->p_pgid;
==== //depot/projects/vimage/src/sys/kern/kern_fork.c#17 (text+ko) ====
@@ -516,8 +516,10 @@
td2->td_sigmask = td->td_sigmask;
td2->td_flags = TDF_INMEM;
- td2->td_vnet = NULL; /* XXX */
- td2->td_vnet_lpush = NULL; /* XXX */
+#ifdef VIMAGE
+ td2->td_vnet = NULL;
+ td2->td_vnet_lpush = NULL;
+#endif
/*
* Duplicate sub-structures as needed.
==== //depot/projects/vimage/src/sys/kern/kern_switch.c#14 (text+ko) ====
@@ -455,7 +455,6 @@
return (NULL);
}
-
/*
* Remove the thread from the queue specified by its priority, and clear the
* corresponding status bit if the queue becomes empty.
==== //depot/projects/vimage/src/sys/kern/kern_timeout.c#13 (text+ko) ====
@@ -121,8 +121,7 @@
* kern_timeout_callwheel_alloc() - kernel low level callwheel initialization
*
* This code is called very early in the kernel initialization sequence,
- * and may be called more then once. This claims some memory for this
- * module and return the start of the remaining memory.
+ * and may be called more then once.
*/
caddr_t
kern_timeout_callwheel_alloc(caddr_t v)
==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#62 (text+ko) ====
@@ -132,16 +132,15 @@
static TAILQ_HEAD(vnet_modlink_head, vnet_modlink) vnet_modlink_head;
static TAILQ_HEAD(vnet_modpending_head, vnet_modlink) vnet_modpending_head;
-void vnet_mod_register(vmi)
- const struct vnet_modinfo *vmi;
+void
+vnet_mod_register(const struct vnet_modinfo *vmi)
{
vnet_mod_register_multi(vmi, NULL, NULL);
}
-void vnet_mod_register_multi(vmi, iarg, iname)
- const struct vnet_modinfo *vmi;
- const void *iarg;
- const char *iname;
+void
+vnet_mod_register_multi(const struct vnet_modinfo *vmi, void *iarg,
+ char *iname)
{
struct vnet_modlink *vml, *vml_iter;
@@ -186,8 +185,8 @@
vnet_mod_complete_registration(vml);
}
-void vnet_mod_complete_registration(vml)
-struct vnet_modlink *vml;
+void
+vnet_mod_complete_registration(struct vnet_modlink *vml)
{
struct vnet_modlink *vml_iter;
@@ -217,16 +216,15 @@
} while (vml_iter != NULL);
}
-void vnet_mod_deregister(vmi)
- const struct vnet_modinfo *vmi;
+void
+vnet_mod_deregister(const struct vnet_modinfo *vmi)
{
vnet_mod_deregister_multi(vmi, NULL, NULL);
}
-void vnet_mod_deregister_multi(vmi, iarg, iname)
- const struct vnet_modinfo *vmi;
- const void *iarg;
- const char *iname;
+void
+vnet_mod_deregister_multi(const struct vnet_modinfo *vmi, void *iarg,
+ char *iname)
{
struct vnet_modlink *vml;
@@ -245,8 +243,8 @@
vi_free(vml, M_VIMAGE);
}
-struct vimage *vnet2vimage(vnet)
- struct vnet *vnet;
+struct vimage *
+vnet2vimage(struct vnet *vnet)
{
struct vimage *vip;
@@ -257,16 +255,15 @@
panic("vnet2vimage"); /* must never happen */
}
-char *vnet_name(vnet)
- struct vnet *vnet;
+char *
+vnet_name(struct vnet *vnet)
{
return(vnet2vimage(vnet)->vi_name);
}
int
-vi_child_of(parent, child)
- struct vimage *parent, *child;
+vi_child_of(struct vimage *parent, struct vimage *child)
{
if (child == parent)
return (0);
@@ -354,10 +351,7 @@
* interface is moved to the parent vnet.
*/
int
-vi_if_move(vi_req, ifp, vip)
- struct vi_req *vi_req;
- struct ifnet *ifp;
- struct vimage *vip;
+vi_if_move(struct vi_req *vi_req, struct ifnet *ifp, struct vimage *vip)
{
struct vimage *new_vip;
struct vnet *new_vnet = NULL;
@@ -498,10 +492,7 @@
int
-vi_td_ioctl(cmd, vi_req, td)
- u_long cmd;
- struct vi_req *vi_req;
- struct thread *td;
+vi_td_ioctl(u_long cmd, struct vi_req *vi_req, struct thread *td)
{
int error;
struct vimage *vip = TD_TO_VIMAGE(td);
@@ -610,9 +601,7 @@
int
-vi_symlookup(lookup, symstr)
- struct kld_sym_lookup *lookup;
- char *symstr;
+vi_symlookup(struct kld_sym_lookup *lookup, char *symstr)
{
struct vnet_modlink *vml;
@@ -792,8 +781,7 @@
return (0);
}
-static int vnet_mod_constructor(vml)
-struct vnet_modlink *vml;
+static int vnet_mod_constructor(struct vnet_modlink *vml)
{
const struct vnet_modinfo *vmi = vml->vml_modinfo;
@@ -823,8 +811,7 @@
return 0;
}
-static int vnet_mod_destructor(vml)
-struct vnet_modlink *vml;
+static int vnet_mod_destructor(struct vnet_modlink *vml)
{
const struct vnet_modinfo *vmi = vml->vml_modinfo;
==== //depot/projects/vimage/src/sys/kern/sched_4bsd.c#22 (text+ko) ====
@@ -102,11 +102,9 @@
((ts)->ts_runq != 0 && (ts)->ts_runq != &runq)
static struct td_sched td_sched0;
-static struct mtx sched_lock;
+struct mtx sched_lock;
-#ifndef VIMAGE
static int sched_tdcnt; /* Total runnable threads in the system. */
-#endif
static int sched_quantum; /* Roundrobin scheduling quantum in ticks. */
#define SCHED_QUANTUM (hz / 10) /* Default sched quantum */
@@ -233,32 +231,19 @@
#endif
static __inline void
-sched_load_add(struct thread *td)
+sched_load_add(void)
{
-
sched_tdcnt++;
CTR1(KTR_SCHED, "global load: %d", sched_tdcnt);
}
static __inline void
-sched_load_rem(struct thread *td)
+sched_load_rem(void)
{
-
sched_tdcnt--;
CTR1(KTR_SCHED, "global load: %d", sched_tdcnt);
}
-#ifdef VIMAGE
-void
-sched_load_reassign(struct vprocg *old, struct vprocg *new)
-{
- mtx_lock_spin(&sched_lock);
- old->_sched_tdcnt--;
- new->_sched_tdcnt++;
- mtx_unlock_spin(&sched_lock);
-}
-#endif
-
/*
* Arrange to reschedule if necessary, taking the priorities and
* schedulers into account.
@@ -448,25 +433,16 @@
static void
schedcpu(void)
{
- register fixpt_t loadfac;
+ register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]);
struct thread *td;
struct proc *p;
struct td_sched *ts;
int awake, realstathz;
-#ifndef VIMAGE
- loadfac = loadfactor(averunnable.ldavg[0]);
-#endif
realstathz = stathz ? stathz : hz;
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
PROC_LOCK(p);
-#ifdef VIMAGE
- if (p->p_ucred != NULL) {
- loadfac = loadfactor(averunnable.ldavg[0]);
- } else
- loadfac = 0;
-#endif
FOREACH_THREAD_IN_PROC(p, td) {
awake = 0;
thread_lock(td);
@@ -637,7 +613,7 @@
hogticks = 2 * sched_quantum;
/* Account for thread0. */
- sched_load_add(&thread0);
+ sched_load_add();
}
/* External interfaces start here */
@@ -739,7 +715,7 @@
thread_unlock(td);
mtx_lock_spin(&sched_lock);
if ((child->td_proc->p_flag & P_NOLOAD) == 0)
- sched_load_rem(td);
+ sched_load_rem();
mtx_unlock_spin(&sched_lock);
}
@@ -939,7 +915,7 @@
}
if ((p->p_flag & P_NOLOAD) == 0)
- sched_load_rem(td);
+ sched_load_rem();
if (newtd)
newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED);
@@ -981,7 +957,7 @@
newtd->td_flags |= TDF_DIDRUN;
TD_SET_RUNNING(newtd);
if ((newtd->td_proc->p_flag & P_NOLOAD) == 0)
- sched_load_add(newtd);
+ sched_load_add();
} else {
newtd = choosethread();
}
@@ -1249,7 +1225,7 @@
}
if ((td->td_proc->p_flag & P_NOLOAD) == 0)
- sched_load_add(td);
+ sched_load_add();
runq_add(ts->ts_runq, td, flags);
}
#else /* SMP */
@@ -1294,7 +1270,7 @@
return;
}
if ((td->td_proc->p_flag & P_NOLOAD) == 0)
- sched_load_add(td);
+ sched_load_add();
runq_add(ts->ts_runq, td, flags);
maybe_resched(td);
}
@@ -1316,7 +1292,7 @@
curthread->td_name);
if ((td->td_proc->p_flag & P_NOLOAD) == 0)
- sched_load_rem(td);
+ sched_load_rem();
runq_remove(ts->ts_runq, td);
TD_SET_CAN_RUN(td);
}
==== //depot/projects/vimage/src/sys/kern/sys_socket.c#10 (text+ko) ====
@@ -287,8 +287,7 @@
fp->f_ops = &badfileops;
fp->f_data = NULL;
- if (so) {
+ if (so)
error = soclose(so);
- }
return (error);
}
==== //depot/projects/vimage/src/sys/kern/uipc_domain.c#12 (text+ko) ====
==== //depot/projects/vimage/src/sys/sys/vimage.h#56 (text+ko) ====
@@ -340,10 +340,8 @@
#ifdef VIMAGE
void vnet_mod_register(const struct vnet_modinfo *);
void vnet_mod_deregister(const struct vnet_modinfo *);
-void vnet_mod_register_multi(const struct vnet_modinfo *, const void *,
- const char *);
-void vnet_mod_deregister_multi(const struct vnet_modinfo *, const void *,
- const char *);
+void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *);
+void vnet_mod_deregister_multi(const struct vnet_modinfo *, void *, char *);
void printcpuinfo(struct vprocg *);
void vi_cpu_acct(void *);
More information about the p4-projects
mailing list