Skip to content

Commit

Permalink
LWKT message ports contain a number of function pointers which abstract
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthew Dillon committed May 24, 2007
1 parent f4cf4cb commit fb0f29c
Show file tree
Hide file tree
Showing 8 changed files with 542 additions and 171 deletions.
5 changes: 2 additions & 3 deletions sys/dev/acpica5/Osd/OsdSchedule.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.28 2004/05/06 02:18:58 njl Exp $ * $FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.28 2004/05/06 02:18:58 njl Exp $
* $DragonFly: src/sys/dev/acpica5/Osd/OsdSchedule.c,v 1.8 2007/05/23 08:57:10 dillon Exp $ * $DragonFly: src/sys/dev/acpica5/Osd/OsdSchedule.c,v 1.9 2007/05/24 05:51:28 dillon Exp $
*/ */


/* /*
Expand Down Expand Up @@ -80,8 +80,7 @@ struct lwkt_port acpi_afree_rport;
int int
acpi_task_thread_init(void) acpi_task_thread_init(void)
{ {
lwkt_initport(&acpi_afree_rport, NULL); lwkt_initport_replyonly(&acpi_afree_rport, acpi_autofree_reply);
acpi_afree_rport.mp_replyport = acpi_autofree_reply;
kthread_create(acpi_task_thread, NULL, &acpi_task_td, kthread_create(acpi_task_thread, NULL, &acpi_task_td,
0, 0, "acpi_task"); 0, 0, "acpi_task");
return (0); return (0);
Expand Down
Loading

0 comments on commit fb0f29c

Please sign in to comment.