mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix various comment typos in ewma patch; found by arma.
This commit is contained in:
parent
2c672f73bf
commit
1292a9ddfe
@ -1083,7 +1083,7 @@ typedef struct or_connection_t {
|
|||||||
* cell_ewma algorithm for choosing circuits, we can remove active_circuits.
|
* cell_ewma algorithm for choosing circuits, we can remove active_circuits.
|
||||||
*/
|
*/
|
||||||
smartlist_t *active_circuit_pqueue;
|
smartlist_t *active_circuit_pqueue;
|
||||||
/** The tick on which the ciell_ewma_t's in active_circuit_pqueue last had
|
/** The tick on which the cell_ewma_ts in active_circuit_pqueue last had
|
||||||
* their ewma values rescaled. */
|
* their ewma values rescaled. */
|
||||||
unsigned active_circuit_pqueue_last_recalibrated;
|
unsigned active_circuit_pqueue_last_recalibrated;
|
||||||
struct or_connection_t *next_with_same_id; /**< Next connection with same
|
struct or_connection_t *next_with_same_id; /**< Next connection with same
|
||||||
@ -2018,7 +2018,7 @@ typedef struct {
|
|||||||
unsigned last_adjusted_tick;
|
unsigned last_adjusted_tick;
|
||||||
/** The EWMA of the cell count. */
|
/** The EWMA of the cell count. */
|
||||||
double cell_count;
|
double cell_count;
|
||||||
/** True iff this is a the cell count for a circuit's previous
|
/** True iff this is the cell count for a circuit's previous
|
||||||
* connection. */
|
* connection. */
|
||||||
unsigned int is_for_p_conn : 1;
|
unsigned int is_for_p_conn : 1;
|
||||||
/** The position of the circuit within the or connection's priority
|
/** The position of the circuit within the or connection's priority
|
||||||
|
@ -1787,9 +1787,10 @@ cell_ewma_to_circuit(cell_ewma_t *ewma)
|
|||||||
|
|
||||||
Conceptually, we take an exponentially weighted mean average of the number
|
Conceptually, we take an exponentially weighted mean average of the number
|
||||||
of cells a circuit has sent, and allow active circuits (those with cells to
|
of cells a circuit has sent, and allow active circuits (those with cells to
|
||||||
relay) to send cells in order of their exponentially-weighted mean average
|
relay) to send cells in reverse order of their exponentially-weighted mean
|
||||||
(EWMA) cell count. [That is, a cell sent N seconds ago 'counts' F^N times
|
average (EWMA) cell count. [That is, a cell sent N seconds ago 'counts'
|
||||||
as much as a cell sent now, for 0<F<1.0.]
|
F^N times as much as a cell sent now, for 0<F<1.0, and we favor the
|
||||||
|
circuit that has sent the fewest cells]
|
||||||
|
|
||||||
If 'double' had infinite precision, we could do this simply by counting a
|
If 'double' had infinite precision, we could do this simply by counting a
|
||||||
cell sent at startup as having weight 1.0, and a cell sent N seconds later
|
cell sent at startup as having weight 1.0, and a cell sent N seconds later
|
||||||
@ -1816,8 +1817,10 @@ cell_ewma_to_circuit(cell_ewma_t *ewma)
|
|||||||
* consensus or a configuration setting. */
|
* consensus or a configuration setting. */
|
||||||
#define EWMA_DEFAULT_SCALE_FACTOR 0.9
|
#define EWMA_DEFAULT_SCALE_FACTOR 0.9
|
||||||
|
|
||||||
/** Given a timeval 'now', compute the cell_ewma tick in which it occurs
|
/** Given a timeval <b>now</b>, compute the cell_ewma tick in which it occurs
|
||||||
* and the fraction of the tick that has elapsed before
|
* and the fraction of the tick that has elapsed between the start of the tick
|
||||||
|
* and <b>now</b>. Return the former and store the latter in
|
||||||
|
* *<b>remainder_out</b>.
|
||||||
*
|
*
|
||||||
* These tick values are not meant to be shared between Tor instances, or used
|
* These tick values are not meant to be shared between Tor instances, or used
|
||||||
* for other purposes. */
|
* for other purposes. */
|
||||||
@ -2205,7 +2208,7 @@ connection_or_flush_from_first_active_circuit(or_connection_t *conn, int max,
|
|||||||
if (streams_blocked && queue->n <= CELL_QUEUE_LOWWATER_SIZE)
|
if (streams_blocked && queue->n <= CELL_QUEUE_LOWWATER_SIZE)
|
||||||
set_streams_blocked_on_circ(circ, conn, 0); /* unblock streams */
|
set_streams_blocked_on_circ(circ, conn, 0); /* unblock streams */
|
||||||
|
|
||||||
/* Did we just ran out of cells on this circuit's queue? */
|
/* Did we just run out of cells on this circuit's queue? */
|
||||||
if (queue->n == 0) {
|
if (queue->n == 0) {
|
||||||
log_debug(LD_GENERAL, "Made a circuit inactive.");
|
log_debug(LD_GENERAL, "Made a circuit inactive.");
|
||||||
make_circuit_inactive_on_conn(circ, conn);
|
make_circuit_inactive_on_conn(circ, conn);
|
||||||
|
Loading…
Reference in New Issue
Block a user