New issue
Advanced search Search tips

Issue 863078 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 1
Type: Bug



Sign in to add a comment

Mojo: Support basic quota management and signaling

Project Member Reported by roc...@chromium.org, Jul 12

Issue description

Per discussions with security, Mojo should expose a basic ability to impose and monitor quotas on its primitives.

As a starting point we should support receive queue length and memory size quotas on message pipe endpoints.

Exceeding a quota should raise a signal on its handle so that monitoring can be done efficiently using the existing Mojo traps API, with no need to schedule further async work in response.
 
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0db0bcf5fb39232fc705cc34b4c617ec463f0092

commit 0db0bcf5fb39232fc705cc34b4c617ec463f0092
Author: Ken Rockot <rockot@chromium.org>
Date: Thu Jul 12 22:01:12 2018

Mojo: Add basic quota API

Introduces MojoSetQuota and MojoQueryQuota to support basic quota
management and signaling on Mojo primitives. Initially the only
quotas supported are receive queue length and memory size, only on
message pipe endpoints.

Various superfluous or overly specific test expectations around
signaling state have been adjusted to accomodate addition of a new
signal. Specifically, a lot of tests needlessly validate the exact
value of "satisfiable signals" on handles, when in reality either
those expectations already have sufficiently generic coverage
elsewhere, or the test really only cares about specific signals
being satisfiable or unsatisfiable.

Bug: 863078
Change-Id: I59217b5cfaceb790ceccd6e30443c4647c352c30
Reviewed-on: https://chromium-review.googlesource.com/1135449
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574744}
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/BUILD.gn
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/core.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/core.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/core_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/dispatcher.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/dispatcher.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/embedder_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/entrypoints.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/handle_signals_state.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/message_pipe_dispatcher.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/message_pipe_dispatcher.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/message_pipe_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/event.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/event.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/message_queue.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/message_queue.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/node.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/node.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/user_message.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/ports/user_message.h
[add] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/quota_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/signals_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/user_message_impl.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/core/user_message_impl.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/core.h
[add] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/quota.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/tests/core_api_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/thunks.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/c/system/types.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/cpp/system/handle_signals_state.h
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/cpp/system/tests/core_unittest.cc
[modify] https://crrev.com/0db0bcf5fb39232fc705cc34b4c617ec463f0092/mojo/public/cpp/system/tests/wait_unittest.cc

Cc: dcheng@chromium.org
Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows
Any updates? My hackery around history state is showing its limitations.
Cc: kinuko@chromium.org
Owner: rockot@google.com

Sign in to add a comment