kernel - callout_init() -> callout_init_mp() in selected cases
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Oct 2011 18:12:17 +0000 (11:12 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Oct 2011 18:12:17 +0000 (11:12 -0700)
* Use callout_init_mp() in numerous cases where the BGL is not
  needed.  There are still a lot more left.

sys/dev/disk/ahci/ahci.c
sys/dev/misc/syscons/syscons.c
sys/dev/netif/e1000/if_em.c
sys/dev/netif/e1000/if_igb.c
sys/dev/netif/em/if_em.c
sys/kern/kern_ktr.c
sys/kern/kern_objcache.c
sys/kern/subr_log.c
sys/kern/uipc_domain.c
sys/platform/pc64/isa/clock.c

index 9c1e909..66f74f1 100644 (file)
@@ -399,7 +399,7 @@ nomem:
                        goto freeport;
                }
 
-               callout_init(&ccb->ccb_timeout);
+               callout_init_mp(&ccb->ccb_timeout);
                ccb->ccb_slot = i;
                ccb->ccb_port = ap;
                ccb->ccb_cmd_hdr = &hdr[i];
index 4dcbc2d..7f60cda 100644 (file)
@@ -379,7 +379,7 @@ sc_attach_unit(int unit, int flags)
      * Finish up the standard attach
      */
     sc->config = flags;
-    callout_init(&sc->scrn_timer_ch);
+    callout_init_mp(&sc->scrn_timer_ch);
     scp = SC_STAT(sc->dev[0]);
     if (sc_console == NULL)    /* sc_console_unit < 0 */
        sc_console = scp;
@@ -3114,7 +3114,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp)
     scp->sc = sc;
     scp->status = 0;
     scp->mode = sc->initial_mode;
-    callout_init(&scp->blink_screen_ch);
+    callout_init_mp(&scp->blink_screen_ch);
     lwkt_gettoken(&tty_token);
     (*vidsw[sc->adapter]->get_info)(sc->adp, scp->mode, &info);
     lwkt_reltoken(&tty_token);
index fbb506f..b0349f4 100644 (file)
@@ -522,8 +522,8 @@ em_attach(device_t dev)
            OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
            em_sysctl_stats, "I", "Statistics");
 
-       callout_init(&adapter->timer);
-       callout_init(&adapter->tx_fifo_timer);
+       callout_init_mp(&adapter->timer);
+       callout_init_mp(&adapter->tx_fifo_timer);
 
        /* Determine hardware and mac info */
        em_identify_hardware(adapter);
index bb4d034..dbbdb8e 100644 (file)
@@ -445,7 +445,7 @@ igb_attach(device_t dev)
            OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
            &igb_enable_aim, 1, "Interrupt Moderation");
 
-       callout_init(&adapter->timer);
+       callout_init_mp(&adapter->timer);
 
        /* Determine hardware and mac info */
        igb_identify_hardware(adapter);
index c319d52..c0704ec 100644 (file)
@@ -431,8 +431,8 @@ em_attach(device_t dev)
 
        adapter->dev = adapter->osdep.dev = dev;
 
-       callout_init(&adapter->timer);
-       callout_init(&adapter->tx_fifo_timer);
+       callout_init_mp(&adapter->timer);
+       callout_init_mp(&adapter->tx_fifo_timer);
 
        /* Determine hardware and mac info */
        error = em_get_hw_info(adapter);
index d10becf..10a207a 100644 (file)
@@ -195,7 +195,7 @@ ktr_sysinit(void *dummy)
                kcpu->ktr_buf = kmalloc(KTR_ENTRIES * sizeof(struct ktr_entry),
                                        M_KTR, M_WAITOK | M_ZERO);
        }
-       callout_init(&ktr_resync_callout);
+       callout_init_mp(&ktr_resync_callout);
        callout_reset(&ktr_resync_callout, hz / 10, ktr_resync_callback, NULL);
 }
 SYSINIT(ktr_sysinit, SI_BOOT2_KLD, SI_ORDER_ANY, ktr_sysinit, NULL);
index b06e032..1a5fbec 100644 (file)
@@ -980,7 +980,7 @@ objcache_init(void)
 {
        spin_init(&objcachelist_spin);
 #if 0
-       callout_init(&objcache_callout);
+       callout_init_mp(&objcache_callout);
        objcache_rebalance_period = 60 * hz;
        callout_reset(&objcache_callout, objcache_rebalance_period,
                      objcache_timer, NULL);
index 755a33d..2c3e350 100644 (file)
@@ -101,10 +101,10 @@ logopen(struct dev_open_args *ap)
        if (log_open)
                return (EBUSY);
        log_open = 1;
-       callout_init(&logsoftc.sc_callout);
+       callout_init_mp(&logsoftc.sc_callout);
        fsetown(p->p_pid, &logsoftc.sc_sigio);  /* signal process only */
        callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second,
-           logtimeout, NULL);
+                     logtimeout, NULL);
        return (0);
 }
 
@@ -209,12 +209,11 @@ logfiltread(struct knote *kn, long hint)
 static void
 logtimeout(void *arg)
 {
-
        if (!log_open)
                return;
        if (msgbuftrigger == 0) {
                callout_reset(&logsoftc.sc_callout,
-                   hz / log_wakeups_per_second, logtimeout, NULL);
+                             hz / log_wakeups_per_second, logtimeout, NULL);
                return;
        }
        msgbuftrigger = 0;
@@ -226,7 +225,7 @@ logtimeout(void *arg)
                logsoftc.sc_state &= ~LOG_RDWAIT;
        }
        callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second,
-           logtimeout, NULL);
+                     logtimeout, NULL);
 }
 
 /*ARGSUSED*/
index a0555c4..df010a1 100644 (file)
@@ -158,8 +158,8 @@ domaininit(void *dummy)
        if (max_linkhdr < 16)           /* XXX */
                max_linkhdr = 16;
 
-       callout_init(&pffasttimo_ch);
-       callout_init(&pfslowtimo_ch);
+       callout_init_mp(&pffasttimo_ch);
+       callout_init_mp(&pfslowtimo_ch);
        callout_reset(&pffasttimo_ch, 1, pffasttimo, NULL);
        callout_reset(&pfslowtimo_ch, 1, pfslowtimo, NULL);
 }
@@ -249,10 +249,11 @@ pfslowtimo(void *arg)
        struct domain *dp;
        struct protosw *pr;
 
-       SLIST_FOREACH(dp, &domains, dom_next)
+       SLIST_FOREACH(dp, &domains, dom_next) {
                for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
                        if (pr->pr_slowtimo)
                                (*pr->pr_slowtimo)();
+       }
        callout_reset(&pfslowtimo_ch, hz / 2, pfslowtimo, NULL);
 }
 
@@ -262,9 +263,10 @@ pffasttimo(void *arg)
        struct domain *dp;
        struct protosw *pr;
 
-       SLIST_FOREACH(dp, &domains, dom_next)
+       SLIST_FOREACH(dp, &domains, dom_next) {
                for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
                        if (pr->pr_fasttimo)
                                (*pr->pr_fasttimo)();
+       }
        callout_reset(&pffasttimo_ch, hz / 5, pffasttimo, NULL);
 }
index 420fce2..2ae238d 100644 (file)
@@ -1048,7 +1048,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
        void *clkdesc = NULL;
        int irq = 0, mixed_mode = 0, error;
 
-       callout_init(&sysbeepstop_ch);
+       callout_init_mp(&sysbeepstop_ch);
 
        if (!selected && i8254_intr_disable)
                goto nointr;