aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorMatt Traudt <sirmatt@ksu.edu>2017-07-10 10:47:56 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 11:40:59 -0400
commitb2c56eacdd61429f17b9e14db665592ac4453c50 (patch)
treee4c90d91d4cc38be7131cee84a57643ae4cbde0f /src/or
parent91c7bebfa27efe059c29dbeac935942e2cc32c86 (diff)
downloadtor-b2c56eacdd61429f17b9e14db665592ac4453c50.tar.gz
tor-b2c56eacdd61429f17b9e14db665592ac4453c50.zip
sched: Remove vanilla sched options that will be going away
- massive change to src/tgest/test_options.c since the sched options were added all over the place in it - removing the sched options caused some tests to pass/fail in new ways so I assumed current behavior is correct and made them pass again - ex: "ConnLimit must be greater" lines - ex: "Authoritative directory servers must" line - remove test_options_validate__scheduler in prep for new sched tests Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c30
-rw-r--r--src/or/or.h22
2 files changed, 21 insertions, 31 deletions
diff --git a/src/or/config.c b/src/or/config.c
index eb89d6f5ee..a7bc23af59 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -486,9 +486,11 @@ static config_var_t option_vars_[] = {
V(ServerDNSSearchDomains, BOOL, "0"),
V(ServerDNSTestAddresses, CSV,
"www.google.com,www.mit.edu,www.yahoo.com,www.slashdot.org"),
- V(SchedulerLowWaterMark__, MEMUNIT, "100 MB"),
- V(SchedulerHighWaterMark__, MEMUNIT, "101 MB"),
- V(SchedulerMaxFlushCells__, UINT, "1000"),
+ OBSOLETE("SchedulerLowWaterMark__"),
+ OBSOLETE("SchedulerHighWaterMark__"),
+ OBSOLETE("SchedulerMaxFlushCells__"),
+ V(KISTSchedRunInterval, MSEC_INTERVAL, "0 msec"),
+ V(KISTSockBufSizeFactor, DOUBLE, "1.0"),
V(ShutdownWaitLength, INTERVAL, "30 seconds"),
OBSOLETE("SocksListenAddress"),
V(SocksPolicy, LINELIST, NULL),
@@ -1811,11 +1813,14 @@ options_act(const or_options_t *old_options)
return -1;
}
+ /* XXXFORTOR remove set_watermarks */
/* Set up scheduler thresholds */
- scheduler_set_watermarks((uint32_t)options->SchedulerLowWaterMark__,
- (uint32_t)options->SchedulerHighWaterMark__,
- (options->SchedulerMaxFlushCells__ > 0) ?
- options->SchedulerMaxFlushCells__ : 1000);
+ scheduler_set_watermarks(100 * 1024*1024 /* 100 MB */,
+ 101 * 1024*1024 /* 101 MB */,
+ 100);
+
+ /* XXXFORTOR enable notification to sched that the conf might have changed */
+ //scheduler_conf_changed();
/* Set up accounting */
if (accounting_parse_options(options, 0)<0) {
@@ -3112,17 +3117,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
routerset_union(options->ExcludeExitNodesUnion_,options->ExcludeNodes);
}
- if (options->SchedulerLowWaterMark__ == 0 ||
- options->SchedulerLowWaterMark__ > UINT32_MAX) {
- log_warn(LD_GENERAL, "Bad SchedulerLowWaterMark__ option");
- return -1;
- } else if (options->SchedulerHighWaterMark__ <=
- options->SchedulerLowWaterMark__ ||
- options->SchedulerHighWaterMark__ > UINT32_MAX) {
- log_warn(LD_GENERAL, "Bad SchedulerHighWaterMark option");
- return -1;
- }
-
if (options->NodeFamilies) {
options->NodeFamilySets = smartlist_new();
for (cl = options->NodeFamilies; cl; cl = cl->next) {
diff --git a/src/or/or.h b/src/or/or.h
index 5a543b498c..7116fbac76 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4535,19 +4535,6 @@ typedef struct {
/** How long (seconds) do we keep a guard before picking a new one? */
int GuardLifetime;
- /** Low-water mark for global scheduler - start sending when estimated
- * queued size falls below this threshold.
- */
- uint64_t SchedulerLowWaterMark__;
- /** High-water mark for global scheduler - stop sending when estimated
- * queued size exceeds this threshold.
- */
- uint64_t SchedulerHighWaterMark__;
- /** Flush size for global scheduler - flush this many cells at a time
- * when sending.
- */
- int SchedulerMaxFlushCells__;
-
/** Is this an exit node? This is a tristate, where "1" means "yes, and use
* the default exit policy if none is given" and "0" means "no; exit policy
* is 'reject *'" and "auto" (-1) means "same as 1, but warn the user."
@@ -4620,6 +4607,15 @@ typedef struct {
/** Bool (default: 0). Tells Tor to never try to exec another program.
*/
int NoExec;
+
+ /** Have the KIST scheduler run every X milliseconds. If less than zero, do
+ * not use the KIST scheduler but use the old vanilla scheduler instead. If
+ * zero, do what the consensus says and fall back to using KIST as if this is
+ * set to "10 msec" if the consensus doesn't say anything. */
+ int64_t KISTSchedRunInterval;
+
+ /** A multiplier for the KIST per-socket limit calculation. */
+ double KISTSockBufSizeFactor;
} or_options_t;
/** Persistent state for an onion router, as saved to disk. */