Fixes bug 22883.
--- /dev/null
+ o Major bugfixes (relay, performance):
+
+ - Perform circuit handshake operations at a higher priority than we use
+ for consensus diff creation and compression. This should prevent
+ circuits from starving when a relay or bridge receive a new consensus,
+ especially on lower-powered machines. Fixes bug 22883; bugfix on
+ 0.3.1.1-alpha.
+
goto err;
workqueue_entry_t *work;
- work = cpuworker_queue_work(consensus_diff_worker_threadfn,
+ work = cpuworker_queue_work(WQ_PRI_LOW,
+ consensus_diff_worker_threadfn,
consensus_diff_worker_replyfn,
job);
if (!work)
if (background_compression) {
workqueue_entry_t *work;
- work = cpuworker_queue_work(consensus_compress_worker_threadfn,
+ work = cpuworker_queue_work(WQ_PRI_LOW,
+ consensus_compress_worker_threadfn,
consensus_compress_worker_replyfn,
job);
if (!work) {
/** DOCDOC */
MOCK_IMPL(workqueue_entry_t *,
-cpuworker_queue_work,(workqueue_reply_t (*fn)(void *, void *),
+cpuworker_queue_work,(workqueue_priority_t priority,
+ workqueue_reply_t (*fn)(void *, void *),
void (*reply_fn)(void *),
void *arg))
{
tor_assert(threadpool);
- return threadpool_queue_work(threadpool,
- fn,
- reply_fn,
- arg);
+ return threadpool_queue_work_priority(threadpool,
+ priority,
+ fn,
+ reply_fn,
+ arg);
}
/** Try to tell a cpuworker to perform the public key operations necessary to
memwipe(&req, 0, sizeof(req));
++total_pending_tasks;
- queue_entry = threadpool_queue_work(threadpool,
+ queue_entry = threadpool_queue_work_priority(threadpool,
+ WQ_PRI_HIGH,
cpuworker_onion_handshake_threadfn,
cpuworker_onion_handshake_replyfn,
job);
void cpuworkers_rotate_keyinfo(void);
struct workqueue_entry_s;
enum workqueue_reply_t;
+enum workqueue_priority_t;
MOCK_DECL(struct workqueue_entry_s *, cpuworker_queue_work, (
+ enum workqueue_priority_t priority,
enum workqueue_reply_t (*fn)(void *, void *),
void (*reply_fn)(void *),
void *arg));
void *arg;
} fake_work_queue_ent_t;
static struct workqueue_entry_s *
-mock_cpuworker_queue_work(enum workqueue_reply_t (*fn)(void *, void *),
+mock_cpuworker_queue_work(workqueue_priority_t prio,
+ enum workqueue_reply_t (*fn)(void *, void *),
void (*reply_fn)(void *),
void *arg)
{
+ (void) prio;
+
if (! fake_cpuworker_queue)
fake_cpuworker_queue = smartlist_new();