summaryrefslogtreecommitdiff
path: root/src/or/scheduler.c
AgeCommit message (Collapse)Author
2017-11-17Fix a wide commentNick Mathewson
2017-11-17Only log about lost KIST support onceMatt Traudt
2017-11-06Fix a 32-bit formatting warningNick Mathewson
2017-11-02sched: Rate limit scheduler_bug_occurred()David Goulet
Just in case we end up hitting a SCHED_BUG() multiple times, rate limit the log warning. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-02sched: Use SCHED_BUG() macro in schedulerDavid Goulet
When a BUG() occurs, this macro will print extra information about the state of the scheduler and the given channel if any. This will help us greatly to fix future bugs in the scheduler especially when they occur rarely. Fixes #23753 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-03sched: Implement SCHED_BUG()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25Merge branch 'bug23539_032_01_squashed'Nick Mathewson
2017-09-25Whitespace fix.Nick Mathewson
2017-09-25sched: Make KISTSchedRunInterval non negativeDavid Goulet
Fixes #23539. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-22Fix check-spaces and a weird copyright.Nick Mathewson
2017-09-22Remove unused chosen_scheduler_type variable.Nick Mathewson
2017-09-22sched: move code to respect commentsMatt Traudt
The diff is confusing, but were two static scheduler functions that needed moving to static comment block. No code change. Thanks dgoulet for original commit
2017-09-22sched: only log when scheduler type changesMatt Traudt
Closes 23552. Thanks dgoulet for original impl
2017-09-21sched: Hard exit if we can't select a schedulerDavid Goulet
Fixes #23581 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-19sched: reorder code to fit comment bodies; comment typosMatt Traudt
Closes 23560
2017-09-19fix typos/etc found while starting to look at schedulerRoger Dingledine
2017-09-19sched: Allow the new sched to react to new consMatt Traudt
2017-09-19Avoid a compilation warning on macOS in scheduler_ev_add()teor
This warning is caused by a different tv_usec data type on macOS compared to the system on which the patch was developed. Fixes 23575 on 0.3.2.1-alpha.
2017-09-18sched: BUG() on event_add() and log_warn next_runDavid Goulet
It is highly unlikely to happen but if so, we need to know and why. The warning with the next_run values could help. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15sched: Revert IF_BUG_ONCE() to tor_assert()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Define SCHEDULER_KIST_PRIVATE for more encapsulationDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Improve logging if KIST is disabledDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Fix unit tests with latest scheduler changesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Make the scheduler object staticDavid Goulet
Each type of scheduler implements its own static scheduler_t object and returns a reference to it. This commit also makes it a const pointer that is it can only change inside the scheduler type subsystem but not outside for extra protection. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Don't expose the global scheduler libevent objectDavid Goulet
Instead, add wrappers to do the needed action the different scheduler needs with the libevent object. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Always call on_channel_free() regardless of stateDavid Goulet
A channel can bounce in the scheduler and bounce out with the IDLE state which means that if it came in the scheduler once, it has socket information that needs to be freed from the global hash table. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Add Schedulers torrc optionDavid Goulet
This option is a list of possible scheduler type tor can use ordered by priority. Its default value is "KIST,KISTLite,Vanilla" which means that KIST will be used first and if unavailable will fallback to KISTLite and so on. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: change most asserts to non-fatal BUGsMatt Traudt
2017-09-15sched: rename scheduler to the_schedulerMatt Traudt
2017-09-15sched: switch to monotonic time; add/fix comments, style, and logs msgsMatt Traudt
2017-09-15sched: Detect KIST support at compile timeDavid Goulet
Add a detection for the KIST scheduler in our build system and set HAVE_KIST_SUPPORT if available. Adapt the should use kist function with this new compile option. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Implement the KIST schedulerMatt Traudt
Closes #12541 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-07consensus: Add a generic notification function on new consensusMatt Traudt
Some groundwork for the KIST scheduler implementation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-03Switch to offsetof()Neel Chauhan
2017-03-15Run the copyright update script.Nick Mathewson
2016-10-26Whitespace fixesNick Mathewson
2016-10-20Turn scheduler.c documentation into doxygen.Nick Mathewson
2016-07-28Merge branch 'bug18902_squashed'Nick Mathewson
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-07-04Raise libevent dependency to 2.0.10-stable or newerSebastian Hahn
Only some very ancient distributions don't ship with Libevent 2 anymore, even the oldest supported Ubuntu LTS version has it. This allows us to get rid of a lot of compat code.
2016-02-27Update the copyright year.Nick Mathewson
2015-02-06Fix scheduler compilation on targets where char is unsigned.Yawning Angel
Per discussion with nickm, the `dir` argument should be a int rather than a signed char. Fixes bug #14764.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-22Coverity complained that we were not checking this return valueNick Mathewson
2014-11-28Fix a signed/unsigned comparison warning in scheduler_runNick Mathewson
2014-11-27One more, appease "make check-spaces"Nick Mathewson
2014-10-07Make queue thresholds and flush size for global scheduler into config optionsAndrea Shepard
2014-09-30Make scheduler_compare_channels() mockableAndrea Shepard
2014-09-30Make scheduler_run() mockableAndrea Shepard