kernel - Implement new callout*() core

Operating Systems / DragonFlyBSD - Matthew Dillon [apollo.backplane.com] - 25 November 2014 12:15 UTC

- Rewrite the callout*() function core to run more efficiently. This has a much better mechanism for locking a callout to a cpu and for dealing with synchronous waits for callbacks to complete.

The IPI busy/wait loop has been removed for remote-cpu operations. The code now blocks normally and callers will have to understand that. This will make it a lot easier to debug races.

- Add callout_init_lk() which implements auto-locking similar to FreeBSD. Several FreeBSD mechanisms already depend on it and it will make porting easier. And it works pretty well.

- Preparation for a more synchronous interface.

- Note that the new API is roughly similar to the old except callout_reset() now issues a synchronous stop instead of an asynchronous stop. Soon we will also switch around the function names to make MP operation and synchronous operation the default across the board.

d0f829f kernel - Implement new callout*() core
sys/kern/kern_timeout.c | 822 ++++++++++++++++++++++++++++++++------------
sys/netinet/sctp_callout.h | 2 +
sys/sys/callout.h | 128 ++++++-
3 files changed, 716 insertions(+), 236 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share