diff options
author | Paul Turner <[email protected]> | 2011-07-21 09:43:32 -0700 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2011-08-14 12:03:31 +0200 |
commit | a9cf55b2861057a213e610da2fec52125439a11d (patch) | |
tree | 6c0caf35a6e8fbba7325227f11029f5f4d4cbf7e /lib/memory-notifier-error-inject.c | |
parent | 58088ad0152ba4b7997388c93d0ca208ec1ece75 (diff) |
sched: Expire invalid runtime
Since quota is managed using a global state but consumed on a per-cpu basis
we need to ensure that our per-cpu state is appropriately synchronized.
Most importantly, runtime that is state (from a previous period) should not be
locally consumable.
We take advantage of existing sched_clock synchronization about the jiffy to
efficiently detect whether we have (globally) crossed a quota boundary above.
One catch is that the direction of spread on sched_clock is undefined,
specifically, we don't know whether our local clock is behind or ahead
of the one responsible for the current expiration time.
Fortunately we can differentiate these by considering whether the
global deadline has advanced. If it has not, then we assume our clock to be
"fast" and advance our local expiration; otherwise, we know the deadline has
truly passed and we expire our local runtime.
Signed-off-by: Paul Turner <[email protected]>
Reviewed-by: Hidetoshi Seto <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions