Annoyance with recent parallelism in rc.d

Alexey Shuvaev shuvaev at physik.uni-wuerzburg.de
Tue Feb 17 14:06:00 PST 2009


On Tue, Feb 17, 2009 at 10:13:58AM +0900, Pyun YongHyeon wrote:
> Would you try attached patch? I don't like the patch but it may
> reduce number of link state change message generated by dhclient.
> 
Seems to be so. Not sure it solves the problem entirely:

[snip]
/dev/ad6p8: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad6p8: clean, 5999509 free (41045 frags, 744808 blocks, 0.5% fragmentation)

msk0: link state changed to DOWN
Starting Network: lo0 msk0.
Removing stale Samba tdb files:  done
Feb 17 21:49:22  ntpd[1295]: getaddrinfo: "wrzx03.rz.uni-wuerzburg.de" invalid h
ost address, ignored
Feb 17 21:49:22  ntpd[1295]: getaddrinfo: "wep4001.physik.uni-wuerzburg.de" inva
lid host address, ignored
Configuring syscons: blanktime screensaver.
Configuring jails:.
Starting jails:.
moused: unable to open /dev/ums0: Device busy

Tue Feb 17 21:49:23 CET 2009

FreeBSD/amd64 (wep4035) (ttyv0)

login:

After all I have ntpd running & connected to upstream ntp server.
This is without synchronous_dhclient="YES" in rc.conf.
I have some feeling that the problem is not localized to msk driver only,
so... if you don't like the patch I'm ok to live with synchronous dhclient.

Alexey.

> Index: sys/dev/msk/if_msk.c
> ===================================================================
> --- sys/dev/msk/if_msk.c	(revision 188700)
> +++ sys/dev/msk/if_msk.c	(working copy)
> @@ -943,8 +943,11 @@
>  			else {
>  				MSK_IF_LOCK(sc_if);
>  				ifp->if_mtu = ifr->ifr_mtu;
> -				if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
> +				if ((ifp->if_drv_flags &
> +				    IFF_DRV_RUNNING) != 0) {
> +					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  					msk_init_locked(sc_if);
> +				}
>  				MSK_IF_UNLOCK(sc_if);
>  			}
>  		}
> @@ -2726,6 +2729,7 @@
>  			if_printf(sc_if->msk_ifp, "watchdog timeout "
>  			   "(missed link)\n");
>  		ifp->if_oerrors++;
> +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  		msk_init_locked(sc_if);
>  		return;
>  	}
> @@ -2750,6 +2754,7 @@
>  
>  	if_printf(ifp, "watchdog timeout\n");
>  	ifp->if_oerrors++;
> +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  	msk_init_locked(sc_if);
>  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
>  		taskqueue_enqueue(taskqueue_fast, &sc_if->msk_tx_task);
> @@ -2828,8 +2833,10 @@
>  	mskc_reset(sc);
>  	for (i = 0; i < sc->msk_num_port; i++) {
>  		if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL &&
> -		    ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0))
> +		    ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) {
> +			sc->msk_if[i]->msk_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  			msk_init_locked(sc->msk_if[i]);
> +		}
>  	}
>  	sc->msk_suspended = 0;
>  
> @@ -3515,6 +3522,9 @@
>  	sc = sc_if->msk_softc;
>  	mii = device_get_softc(sc_if->msk_miibus);
>  
> +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
> +		return;
> +
>  	error = 0;
>  	/* Cancel pending I/O and free all Rx/Tx buffers. */
>  	msk_stop(sc_if);



More information about the freebsd-current mailing list