Change instances of callout_init that specify MPSAFE behaviour to
use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear.
This commit is contained in:
parent
9d6f37e490
commit
c06eb4e293
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119137
@ -2289,7 +2289,7 @@ dc_attach(device_t dev)
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE);
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE ? CALLOUT_MPSAFE : 0);
|
||||
|
||||
#ifdef SRM_MEDIA
|
||||
sc->dc_srm_media = 0;
|
||||
|
@ -487,8 +487,7 @@ hifn_attach(device_t dev)
|
||||
if (sc->sc_flags & (HIFN_HAS_PUBLIC | HIFN_HAS_RNG))
|
||||
hifn_init_pubrng(sc);
|
||||
|
||||
/* NB: 1 means the callout runs w/o Giant locked */
|
||||
callout_init(&sc->sc_tickto, 1);
|
||||
callout_init(&sc->sc_tickto, CALLOUT_MPSAFE);
|
||||
callout_reset(&sc->sc_tickto, hz, hifn_tick, sc);
|
||||
|
||||
return (0);
|
||||
@ -687,8 +686,7 @@ hifn_init_pubrng(struct hifn_softc *sc)
|
||||
sc->sc_rnghz = hz / 100;
|
||||
else
|
||||
sc->sc_rnghz = 1;
|
||||
/* NB: 1 means the callout runs w/o Giant locked */
|
||||
callout_init(&sc->sc_rngto, 1);
|
||||
callout_init(&sc->sc_rngto, CALLOUT_MPSAFE);
|
||||
callout_reset(&sc->sc_rngto, sc->sc_rnghz, hifn_rng, sc);
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ patm_attach(device_t dev)
|
||||
mtx_init(&sc->tst_lock, "tst lock", NULL, MTX_DEF);
|
||||
cv_init(&sc->vcc_cv, "vcc_close");
|
||||
|
||||
callout_init(&sc->tst_callout, 1);
|
||||
callout_init(&sc->tst_callout, CALLOUT_MPSAFE);
|
||||
|
||||
sysctl_ctx_init(&sc->sysctl_ctx);
|
||||
|
||||
|
@ -96,8 +96,7 @@ rndtest_attach(device_t dev)
|
||||
#if __FreeBSD_version < 500000
|
||||
callout_init(&rsp->rs_to);
|
||||
#else
|
||||
/* NB: 1 means the callout runs w/o Giant locked */
|
||||
callout_init(&rsp->rs_to, 1);
|
||||
callout_init(&rsp->rs_to, CALLOUT_MPSAFE);
|
||||
#endif
|
||||
} else
|
||||
device_printf(dev, "rndtest_init: no memory for state block\n");
|
||||
|
@ -441,8 +441,7 @@ safe_attach(device_t dev)
|
||||
#endif
|
||||
safe_rng_init(sc);
|
||||
|
||||
/* NB: 1 means the callout runs w/o Giant locked */
|
||||
callout_init(&sc->sc_rngto, 1);
|
||||
callout_init(&sc->sc_rngto, CALLOUT_MPSAFE);
|
||||
callout_reset(&sc->sc_rngto, hz*safe_rnginterval, safe_rng, sc);
|
||||
}
|
||||
#endif /* SAFE_NO_RNG */
|
||||
|
@ -462,8 +462,7 @@ ubsec_attach(device_t dev)
|
||||
sc->sc_rnghz = hz / 100;
|
||||
else
|
||||
sc->sc_rnghz = 1;
|
||||
/* NB: 1 means the callout runs w/o Giant locked */
|
||||
callout_init(&sc->sc_rngto, 1);
|
||||
callout_init(&sc->sc_rngto, CALLOUT_MPSAFE);
|
||||
callout_reset(&sc->sc_rngto, sc->sc_rnghz, ubsec_rng, sc);
|
||||
skip_rng:
|
||||
;
|
||||
|
@ -386,8 +386,8 @@ proc0_init(void *dummy __unused)
|
||||
|
||||
bcopy("swapper", p->p_comm, sizeof ("swapper"));
|
||||
|
||||
callout_init(&p->p_itcallout, 1);
|
||||
callout_init(&td->td_slpcallout, 1);
|
||||
callout_init(&p->p_itcallout, CALLOUT_MPSAFE);
|
||||
callout_init(&td->td_slpcallout, CALLOUT_MPSAFE);
|
||||
|
||||
/* Create credentials. */
|
||||
p->p_ucred = crget();
|
||||
|
@ -592,7 +592,7 @@ fork1(td, flags, pages, procp)
|
||||
PGRP_UNLOCK(p1->p_pgrp);
|
||||
LIST_INIT(&p2->p_children);
|
||||
|
||||
callout_init(&p2->p_itcallout, 1);
|
||||
callout_init(&p2->p_itcallout, CALLOUT_MPSAFE);
|
||||
|
||||
#ifdef KTRACE
|
||||
/*
|
||||
|
@ -1337,7 +1337,7 @@ thread_link(struct thread *td, struct ksegrp *kg)
|
||||
td->td_kse = NULL;
|
||||
|
||||
LIST_INIT(&td->td_contested);
|
||||
callout_init(&td->td_slpcallout, 1);
|
||||
callout_init(&td->td_slpcallout, CALLOUT_MPSAFE);
|
||||
TAILQ_INSERT_HEAD(&p->p_threads, td, td_plist);
|
||||
TAILQ_INSERT_HEAD(&kg->kg_threads, td, td_kglist);
|
||||
p->p_numthreads++;
|
||||
|
@ -652,7 +652,7 @@ sched_setup(dummy)
|
||||
void *dummy;
|
||||
{
|
||||
callout_init(&loadav_callout, 0);
|
||||
callout_init(&lbolt_callout, 1);
|
||||
callout_init(&lbolt_callout, CALLOUT_MPSAFE);
|
||||
|
||||
/* Kick off timeout driven events by calling first time. */
|
||||
loadav(NULL);
|
||||
|
@ -1337,7 +1337,7 @@ thread_link(struct thread *td, struct ksegrp *kg)
|
||||
td->td_kse = NULL;
|
||||
|
||||
LIST_INIT(&td->td_contested);
|
||||
callout_init(&td->td_slpcallout, 1);
|
||||
callout_init(&td->td_slpcallout, CALLOUT_MPSAFE);
|
||||
TAILQ_INSERT_HEAD(&p->p_threads, td, td_plist);
|
||||
TAILQ_INSERT_HEAD(&kg->kg_threads, td, td_kglist);
|
||||
p->p_numthreads++;
|
||||
|
@ -403,7 +403,7 @@ sched_setup(void *dummy)
|
||||
sched_quantum = SCHED_QUANTUM;
|
||||
hogticks = 2 * sched_quantum;
|
||||
|
||||
callout_init(&schedcpu_callout, 1);
|
||||
callout_init(&schedcpu_callout, CALLOUT_MPSAFE);
|
||||
callout_init(&roundrobin_callout, 0);
|
||||
|
||||
/* Kick off timeout driven events by calling first time. */
|
||||
|
@ -569,7 +569,7 @@ sched_setup(void *dummy)
|
||||
kseq_cpu[i].ksq_cpus = cg->cg_count;
|
||||
}
|
||||
}
|
||||
callout_init(&kseq_lb_callout, 1);
|
||||
callout_init(&kseq_lb_callout, CALLOUT_MPSAFE);
|
||||
kseq_balance(NULL);
|
||||
#else
|
||||
kseq_setup(KSEQ_SELF());
|
||||
|
@ -355,7 +355,7 @@ bpfopen(dev, flags, fmt, td)
|
||||
mac_create_bpfdesc(td->td_ucred, d);
|
||||
#endif
|
||||
mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF);
|
||||
callout_init(&d->bd_callout, 1);
|
||||
callout_init(&d->bd_callout, CALLOUT_MPSAFE);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ syncache_init(void)
|
||||
/* Initialize the timer queues. */
|
||||
for (i = 0; i <= SYNCACHE_MAXREXMTS; i++) {
|
||||
TAILQ_INIT(&tcp_syncache.timerq[i]);
|
||||
callout_init(&tcp_syncache.tt_timerq[i], 1);
|
||||
callout_init(&tcp_syncache.tt_timerq[i], CALLOUT_MPSAFE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2289,7 +2289,7 @@ dc_attach(device_t dev)
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE);
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE ? CALLOUT_MPSAFE : 0);
|
||||
|
||||
#ifdef SRM_MEDIA
|
||||
sc->dc_srm_media = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user