From 1b8ceb83c951f1cdea6b71a615a10d33b8adf2b3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 7 Nov 2013 12:15:30 -0500 Subject: Improved circuit queue out-of-memory handler Previously, when we ran low on memory, we'd close whichever circuits had the most queued cells. Now, we close those that have the *oldest* queued cells, on the theory that those are most responsible for us running low on memory, and that those are the least likely to actually drain on their own if we wait a little longer. Based on analysis from a forthcoming paper by Jansen, Tschorsch, Johnson, and Scheuermann. Fixes bug 9093. --- src/or/or.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/or/or.h') diff --git a/src/or/or.h b/src/or/or.h index b8f334ece..462239190 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -912,8 +912,13 @@ typedef struct var_cell_t { typedef struct packed_cell_t { struct packed_cell_t *next; /**< Next cell queued on this circuit. */ char body[CELL_NETWORK_SIZE]; /**< Cell as packed for network. */ + uint32_t inserted_time; /**< Time (in milliseconds since epoch, with high + * bits truncated) when this cell was inserted. */ } packed_cell_t; +/* XXXX This next structure may be obsoleted by inserted_time in + * packed_cell_t */ + /** Number of cells added to a circuit queue including their insertion * time on 10 millisecond detail; used for buffer statistics. */ typedef struct insertion_time_elem_t { -- cgit v1.2.3