commit | 7953c611dfdb7d8fd78141477495efc1c8788f03 | [log] [tgz] |
---|---|---|
author | Barret Rhoden <brho@cs.berkeley.edu> | Fri Aug 30 15:17:00 2019 -0400 |
committer | Barret Rhoden <brho@cs.berkeley.edu> | Tue Oct 01 10:17:01 2019 -0400 |
tree | 628080708e5a278e754fa3644311d2f7d8c565d2 | |
parent | 2b96cf6deaf2c3e64b4da946bbfe470b3dac93bf [diff] |
alarm: do not wait for unset when resetting an alarm reset_alarm_* are racy. Concurrent resetters can both unset, then both set, and set_alarm can't be called on an alarm that is already set. Right now, the only thing going for reset_alarm is that it makes sure the alarm has stopped before we set it again. That seems to prevent the race between reset_alarm for the handler and an external function, but does nothing for the race between two random functions. But actually, the handlers can't call reset_alarm (prior to this commit); unset will block on the handler finishing, which is a deadlock. (cv_wait->can_block will catch this). Basically, handlers needed to use set_alarm to rearm, since they know they aren't on the tchain anymore. Hokey. set_alarm works outside a handler too (and not the old __set_alarm vs set_alarm nonsense), but that's only for when you know a handler isn't armed. A lot of code wants to use reset_alarm, which is similar to Linux's mod_timer. It's better to have all of those functions callable in any context - particularly the most useful one. This commit doesn't fix the race between unset and set yet. Instead, has us unset without waiting for the handler to finish before setting. This makes it usable in alarm handlers. You may then worry - can't this alarm get rearmed and run on another tchain (cpu) concurrently, and then we're racing on alarm state? No - if the alarm was currently running, it was presumably on the same tchain that we're putting it on - otherwise the caller was bugged. If it's on the same tchain, then we're OK, since we know a given tchain processes alarms in order. A note on naming issues: nosync vs sync, and what's the default can get sorted out in a future commit. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
Akaros is an open source, GPL-licensed operating system for manycore architectures. Its goal is to provide better support for parallel and high-performance applications in the datacenter. Unlike traditional OSs, which limit access to certain resources (such as cores), Akaros provides native support for application-directed resource management and 100% isolation from other jobs running on the system.
Although not yet integrated as such, it is designed to operate as a low-level node OS with a higher-level Cluster OS, such as Mesos, governing how resources are shared amongst applications running on each node. Its system call API and “Many Core Process” abstraction better match the requirements of a Cluster OS, eliminating many of the obstacles faced by other systems when trying to isolate simultaneously running processes. Moreover, Akaros’s resource provisioning interfaces allow for node-local decisions to be made that enforce the resource allocations set up by a Cluster OS. This can be used to simplify global allocation decisions, reduce network communication, and ultimately promote more efficient sharing of resources. There is limited support for such functionality on existing operating systems.
Akaros is still very young, but preliminary results show that processes running on Akaros have an order of magnitude less noise than on Linux, as well as fewer periodic signals, resulting in better CPU isolation. Additionally, its non-traditional threading model has been shown to outperform the Linux NPTL across a number of representative application workloads. This includes a 3.4x faster thread context switch time, competitive performance for the NAS parallel benchmark suite, and a 6% increase in throughput over nginx for a simple thread-based webserver we wrote. We are actively working on expanding Akaros's capabilities even further.
Visit us at akaros.org
Instructions on installation and getting started with Akaros can be found in GETTING_STARTED.md
Our current documentation is very lacking, but it is slowly getting better over time. Most documentation is typically available in the Documentation/ directory. However, many of these documents are outdated, and some general cleanup is definitely in order.
Send an email to akaros+subscribe@googlegroups.com.
Or visit our google group and click “Join Group”
Create a new issue here.
brho
hangs out (usually alone) in #akaros on irc.freenode.net
. The other devs may pop in every now and then.
Instructions on contributing can be found in Documentation/Contributing.md.
The Akaros repository contains a mix of code from different projects across a few top-level directories. The kernel is in kern/
, userspace libraries are in user/
, and a variety of tools can be found in tools/
, including the toolchain.
The Akaros kernel is licensed under the GNU General Public License, version 2. Our kernel is made up of code from a number of other systems. Anything written for the Akaros kernel is licensed “GPLv2 or later”. However, other code, such as from Linux and Plan 9, are licensed GPLv2, without the “or later” clause. There is also code from BSD, Xen, JOS, and Plan 9 derivatives. As a whole, the kernel is licensed GPLv2.
Note that the Plan 9 code that is a part of Akaros is also licensed under the Lucent Public License. The University of California, Berkeley, has been authorised by Alcatel-Lucent to release all Plan 9 software previously governed by the Lucent Public License, Version 1.02 under the GNU General Public License, Version 2. Akaros derives its Plan 9 code from this UCB release. For more information, see LICENSE-plan9 or here.
Our user code is likewise from a mix of sources. All code written for Akaros, such as user/parlib/
, is licensed under the GNU LGPLv2.1, or later. Plan 9 libraries, including user/iplib
and user/ndblib
are licensed under the LGPLv2.1, but without the “or later”. See each library for details.
Likewise, tools/
is a collection of various code. All of our contributions to existing code bases, such as GCC, glibc, and busybox, are licensed under their respective projects' licenses.