Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 May 2002 02:44:23 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/dev/wi wi_hostap.c
Message-ID:  <20020501020252.W11154-100000@gamplex.bde.org>
In-Reply-To: <200204291904.g3TJ4TD65196@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 29 Apr 2002, Warner Losh wrote:

> imp         2002/04/29 12:04:29 PDT
>
>   Modified files:
>     sys/dev/wi           wi_hostap.c
>   Log:
>   splsoftnet is spelled splimp in FreeBSD rather than splnet.  splimp is
>   used to protect the rest of the driver.  This is a no-op commit to current,
>   but is needed for the MFC.

Er, this is perfectly backwards in at least the log message.  splsoftnet
in NetBSD is spelled splnet in FreeBSD.  splnet in NetBSD is spelled splimp
in FreeBSD.  Changing splnet to splimp just increases interrupt latency.

This file also misuses splsoftclock.  splsoftclock has different
semantics in FreeBSD.  Using it is at best a hack except in the one
place where it has the correct semantics (in hardclock() in RELENG_4),
and even in that place its use is dubious -- it only works right on
some machines, not including i386's (so it is not used on i386's).
Drivers should use a device-specific spl to mask softclock interrupts
(splnet for network drivers).

More details: splsoftclock in NetBSD raises the priority to that of
softclock (timeouts), but in FreeBSD it _sets_ the priority that of
softclock.  Since softclock (at lease in FreeBSD) is lower than all other
priorities except 0, splsoftclock in only raises the priority if the
priority is 0; it has no effect if the priority is already softclock and
_lowers_ the priority otherwise.  Lowering the priority is usually wrong.

splsoftclock is misused in about 10 other files in RELENG_4.  Only its
use in apm is obviously wrong (it is just the wong spl there -- splclock
should be used, and splsoftclock defeats any splclock in callers).

>   MFC after: 1 day

Doesn't seem to be long enough for finding bugs, especially when the bugs
are no-ops in -current.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020501020252.W11154-100000>