tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 9.1: boot-time delay? [WORKAROUND FOUND]



>> How heavily is hztoms used?

> [18 uses]

That's...almost none, seems to me.  And these

> sys/dev/ic/mvsata.c:      timeout = mstohz(timeout + hztoms(1) - 1);
> sys/dev/ic/mvsata.c:              ata_delay(chp, hztoms(1), "mvsata_edma2", wflags);
> sys/dev/sdmmc/if_bwfm_sdio.c:     sdmmc_pause(hztoms(1)*1000, NULL);

look to me like bugs waiting to happen - and the first one looks as
though it might even be related to the bug that got us talking about
this; it changes the units of the number in timeout (from ms to hz) in
just the sort of way that could have led to what I saw.

The last, it seems to me, really should be hztoms(1000).

And these

> sys/dev/i2c/tsllux.c:     if (ms < hztoms(1)) {
> sys/dev/pci/ixgbe/ixgbe_netbsd.c: else if ((us / 1000) >= hztoms(1)) {

might be as well; I'd have to read more context.

> sys/dev/usb/if_axe.c:     usbd_delay_ms(sc->axe_un.un_udev, hztoms(y));           \
> sys/external/bsd/drm2/include/linux/jiffies.h:    return hztoms(j);
> sys/external/bsd/drm2/include/linux/sched.h:                      unsigned ms = hztoms(MIN((unsigned long)timeout,
> sys/kern/sched_4bsd.c:    int rttsms = hztoms(sched_rrticks);
> sys/kern/sched_m2.c:      int rttsms = hztoms(sched_rrticks);
> sys/kern/sched_m2.c:      newsize = hztoms(min_ts);
> sys/kern/sched_m2.c:      newsize = hztoms(max_ts);

These might be as well, but they look at least slightly more
reasonable.

> sys/dev/usb/if_axe.c:             usbd_delay_ms(un->un_udev, hztoms(hz / 32));
> sys/dev/usb/if_axe.c:             usbd_delay_ms(un->un_udev, hztoms(hz / 32));
> sys/dev/usb/if_axe.c:     usbd_delay_ms(un->un_udev, hztoms(hz / 32));
> sys/dev/usb/if_axe.c:     usbd_delay_ms(un->un_udev, hztoms(hz / 32));

And these are not only bugs waiting to happen (consider HZ=25), they're
extremely peculiar.  Why hztoms(hz/32) rather than just 30, or 31, or
whatever?  Weird.

Would it be useful for me to send-pr this, or is it more likely to be
something nobody would do anything with?

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index