Updates a partial ordering between jobs so that job A will be killed before
job B in low-resource situations. Will be used by the out-of-memory (OOM)
ranking service to tell the kernel which jobs to kill first.
No actual OOM killing happens yet.
Also adds the 'k mx jobs' command which dumps the list of all jobs in
importance order.
This reverts commit b92f1a1, which reverted the original commit f97f9fe.
Changes relative to the original commit:
- Avoids wrapping parent_->jobs_ elements in RefPtrs, thus ensures that
this code won't unintentionally resurrect a job that's in the middle
of destruction.
- Doesn't hold importance_lock_ as long as before, which isn't critical
but wasn't necessary.
Change-Id: I82bbf993349004ee8007c28597bc5a995dd15150
This reverts commit f97f9fe16c.
Reason for revert: Saw a kernel panic (double-acquire of a mutex) in this code on one of the buildbots.
Original change's description:
> [syscalls][jobs] Add mx_job_set_relative_importance
>
> Updates a partial ordering between jobs so that job A will be killed before
> job B in low-resource situations. Will be used by the out-of-memory (OOM)
> ranking service to tell the kernel which jobs to kill first.
>
> No actual OOM killing happens yet.
>
> Also adds the 'k mx jobs' command which dumps the list of all jobs in
> importance order.
>
> Change-Id: I818dd4e6bdb891a6cc4b4468215d23d479fa58f6
TBR=cpu@google.com,swetland@google.com,dbort@google.com
Change-Id: Ia78c261f68f1cdc75e39869730e2644ae4716634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Updates a partial ordering between jobs so that job A will be killed before
job B in low-resource situations. Will be used by the out-of-memory (OOM)
ranking service to tell the kernel which jobs to kill first.
No actual OOM killing happens yet.
Also adds the 'k mx jobs' command which dumps the list of all jobs in
importance order.
Change-Id: I818dd4e6bdb891a6cc4b4468215d23d479fa58f6
This CL removes mx_port_bind() but more importantly
it removes PortClient from the channel, resource and socket
making them faster and easier to reason about.
The only PortV1 customer not in transition is the exception
dispatcher which does not bind().
Change-Id: I48295cc64bba0dd664194eeadb5455b043483b67
1. This acts on handles, not the objects behind them
2. Operations canceled are not limited to just object_wait_*()
Change-Id: I6b116e966217972bc5d77c7e1f90e864ab2c6406
- Update the docs with the two new syscalls
- move the options param of cancel to the end
- add an libmx cancel call
Change-Id: Ib88312c4fd4bd1a7db4adb42830e0b634b792a59
This adds a three-in-one vDSO call to roll together mx_vmar_unmap,
mx_handle_close, and mx_thread_exit so a thread can deallocate the
very same stack it's using to call into the vDSO. With this,
detached threads exiting can do their last bit of cleanup so there
are no leaks and no other thread is required to do it later.
MG-549 #done
Change-Id: I4c872aa847582aa18042b8fca3c22f26f6e52e2a
These act on the object the handle refers to, not the handle itself.
Compatibility wrappers are provided to ensure existing code
continues to compile, link, and run. Later we will deprecate
the wrappers and eventually remove them.
Change-Id: Icf69e75f7e0c060ba6026343f9d26ff9da4317d9
The new fifo objects are actual fifos, not just bookkeeping entities.
They are intended for small control plane packets for shared memory
interfaces and are designed to be cheaper than sockets or channels
(simpler code path, never allocate along read/write, etc), as well
as having a much more understandable and safer interface than the
old "clever" fifo objects.
Change-Id: Ie020c8c841b20c76b98ab8b08ba81601c2f3444b
The fifo object has been judged a failed experiment and soon will
be replaced by a new, better fifo object. This change moves the
original out of the way and updates the only clients (the unified
ethernet driver, client library, and unit test).
Change-Id: I050c5903ba063d30a26b7b72f45000248e472faa
This is a fused write-wait-read syscall for the use of synchronous rpc
callers. The kernel treats the first uint32_t of the outbound message
as a transaction ID and accepts an inbound message with a matching txid
as a reply, completing the transaction.
This allows multi-threaded calling of synchronous rpc transports
with no userspace bookkeeping required and will provide an opportunity
for smarter scheduling of such transactions in the future.
Change-Id: Ifbb92b36618ebf13a6e52c650d16fed9f5071c3a
We no longer need mx_thread_arch_prctl for TLS or for tracing, so we can remove
the syscall altogether.
MG-40 #done
Change-Id: I8b7b38f4382060cba783347c9ca4b52d52f26844
Together with mx_ticks_get, this can be used to calculate the amount of time
elapsed between two calls to the high-precision timer.
MG-392 #done
Change-Id: Ie1660ce546f544043e562c265f4d10c7dc0301f6
This adds a vDSO call for returning the number of high-precision timer ticks
since boot. There's currently one issue: ARMv6 and ARMv7 only support a 32-bit
range.
MG-392 #comment
Change-Id: I0fa83295342a9f4227e8705e3f8fcfbd23274c8c
For compatibility, allow passing a process handle instead of a VMAR
to the vmar_map/unmap/protect calls and add usermode shims that
translate the old syscalls into the new ones.
Change-Id: I9ba29921d45f47d0d068e46e113dac1d139fce52
A kernel fifo is a pair of head/tail pointers that can be shared
between processes to track the state of a fifo.
Change-Id: Ide7c4a3a40b0e71e106b1d23f9419f6dc69fbc4b
This doesn't include debug or DDK syscalls, or syscalls that will go
away in the Grand Resourcening.
Change-Id: Ic25211908d66189c26d0694a8fd0884a6d05069c
This was the only documented syscall that didn't fit the pattern of
documenting mx_foobar() at foobar.md.
Change-Id: I5ad1e4512bea2c5f121ab493961debbb99673d38
The new simplified API is friendlier, easier to use, and easier
to correctly implement in the kernel.
Change-Id: Id376b9fbeb5f4f56ae78f9ca6f5f1f7d63611fba
mx_status_t mx_version_get(char* ver, uint32_t len)
Probably temporary in form but very useful.
The string returned can be used with "git show".
- Print version in MOTD
- Change dot for '-' from MOTD, it does not show in graphical console
Change-Id: Ic777d6c04ce31daa3846a90ec6ec75c5ac820d96
My previous CL (14136) introduced user signals for all objects that are
waitable. This CL adds a new syscall so for two sided objects
the side that gets signal is clear
- object_signal(handle, clear_bits, set_bits) signals the side
attached to the handle
- object_signal_peer(handle, clear_bits, set_bits) signals the
opposite side to the handle
If and object does not have 'other side' the syscall return
is ERR_NOT_SUPPORTED.
This CL does not address the Channel Object which needs
other changes first.
Change-Id: I83a8b0dff3027aa59f64933ba708ac9bccb67d8b
These pages include some things that weren't obvious to me the first
time I tried using these functions.
Change-Id: If40d818deb3b0e257c101e7c33db2034b0409697
If DEPCRECATE_COMPAT_SYSCALLS is defined, flag the compatibility
wrappers with the deprecated attribute.
Enable this in the Magenta build only for now.
Change-Id: I422b1294d9db2e56551eca65dede0e5d83f8b363
Basically like mx_handle_duplicate(), but doesn't duplicate (instead it
invalidates the original source handle) and doesn't require the
"duplicate" right.
This can be used to reduce the rights of a handle (but it yields a new
"replacement" handle), in particular of non-duplicatable handles.
Also fix handle-info-test:
* Actually run handle_rights_test.
* Actually fail correctly (the CHECK macro, which is now gone, returned
__LINE__ on failure)
Change-Id: I4c2724d5aa6a36ebf1e084b2ff329f8da5453804