LWKT message ports contain a number of function pointers which abstract
commit96b9773225185899a9a59e87f82f1d1b17a4aafb
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 05:51:29 +0000 (24 05:51 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 24 May 2007 05:51:29 +0000 (24 05:51 +0000)
tree12be38f0f378158f915230628c4d4c6321ead467
parent8237391c0a9536ee00d800067a7ba33b07f2b744
LWKT message ports contain a number of function pointers which abstract
their backend operation.

* Add a new function, mp_getport(), which takes over the functionality
  of lwkt_getport().

* Formalize the default backend and rename it the 'thread' port backend, used
  when a message port will only be drained by a single thread.  This backend
  is able to use critical sections and IPI messages to handle races.

* Fix a small timing window in the thread port backend where replying a
  synchronous message request from a different cpu may fail to wake up
  the originator who is waiting for the message completion.

* Abstract-out the message port initialization code and clean up related
  code pollution.

* Add a new backend called the 'spin' port backend.  This backend can be
  used if a message port might be drained by several different threads.
  For example, this would allow us to use a message port as part of a
  file pointer / file descriptor construct.

* Add a boot-time tunable, lwkt.use_spin_port (defaults to off) which
  forces spin ports to be used instead of thread ports for the per-thread
  message port.  This is used only for debugging.
sys/dev/acpica5/Osd/OsdSchedule.c
sys/kern/lwkt_msgport.c
sys/kern/lwkt_thread.c
sys/net/netisr.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_usrreq.c
sys/sys/msgport.h
sys/sys/msgport2.h