kernel - Rewrite the callout_*() API
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 26 Mar 2019 21:11:56 +0000 (14:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 27 Mar 2019 03:32:47 +0000 (20:32 -0700)
commiteb67213abec698ffb555ee926f2761bcb7e95f55
treef80dd28e2beb8af2deb1a6ead514c553674b2133
parentb396bb03905035e2d0e69f9993b2ccc47e77ae73
kernel - Rewrite the callout_*() API

* Rewrite the entire API from scratch and improve compatibility
  with FreeBSD.  This is not an attempt to achieve full API compatibility,
  as FreeBSD's API has unnecessary complexity that coders would frequently
  make mistakes interpreting.

* Remove the IPI mechanisms in favor of fine-grained spin-locks instead.

* Add some robustness features in an attempt to track down corrupted
  callwheel lists due to originating subsystems freeing structures out
  from under an active callout.

* The code supports a full-blown type-stable/adhoc-reuse structural
  separation between the front-end and the back-end, but this feature
  is currently not operational and may be removed at some future point.
  Instead we currently just embed the struct _callout inside the
  struct callout.

* Replace callout_stop_sync() with callout_cancel().

* callout_drain() is now implemented as a synchronous cancel instead
  of an asynchronous stop, which is closer to the FreeBSD API and
  expected operation for ported code (usb stack in particular).  We
  will just have to fix any deadlocks which we come across.

* Retain our callout_terminate() function as the 'better' way to
  stop using a callout, as it will not only cancel the callout but
  also de-flag the structure so it can no longer be used.
48 files changed:
share/man/man9/Makefile
share/man/man9/callout.9
sys/bus/u4b/usbdi.h
sys/dev/crypto/rdrand/rdrand.c
sys/dev/disk/ahci/ahci.c
sys/dev/disk/dm/delay/dm_target_delay.c
sys/dev/disk/mpt/mpt.h
sys/dev/disk/nata/ata-all.c
sys/dev/disk/nata/ata-lowlevel.c
sys/dev/disk/nata/ata-queue.c
sys/dev/disk/nata/chipsets/ata-ahci.c
sys/dev/disk/nata/chipsets/ata-marvell.c
sys/dev/disk/nata/chipsets/ata-siliconimage.c
sys/dev/disk/sili/sili.c
sys/dev/drm/include/linux/workqueue.h
sys/dev/drm/linux_hrtimer.c
sys/dev/misc/ecc/ecc_amd8000.c
sys/dev/misc/ecc/ecc_x3400.c
sys/dev/misc/ipmi/ipmi.c
sys/dev/misc/led/led.c
sys/dev/misc/psm/psm.c
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/iwn/if_iwn.c
sys/dev/netif/oce/oce_if.c
sys/dev/raid/aac/aac.c
sys/dev/raid/ciss/ciss.c
sys/dev/raid/hptrr/hptrr_osm_bsd.c
sys/dev/raid/mfi/mfi.c
sys/dev/raid/mps/mps.c
sys/dev/raid/twa/tw_osl_freebsd.c
sys/dev/virtual/virtio/random/virtio_random.c
sys/dev/virtual/vmware/vmxnet3/if_vmx.c
sys/kern/kern_event.c
sys/kern/kern_exit.c
sys/kern/kern_synch.c
sys/kern/kern_time.c
sys/kern/kern_timeout.c
sys/kern/kern_wdog.c
sys/kern/subr_log.c
sys/kern/subr_taskqueue.c
sys/net/altq/altq_rmclass.c
sys/net/ipfw/ip_fw2.c
sys/netinet/ip_carp.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_timer2.h
sys/netproto/802_11/README.DRAGONFLY
sys/netproto/802_11/wlan/ieee80211_dfs.c
sys/sys/callout.h