]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add get control plane AQ
authorAlan T. DeKok <aland@freeradius.org>
Thu, 15 Dec 2016 15:18:15 +0000 (10:18 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 15 Dec 2016 15:18:15 +0000 (10:18 -0500)
src/util/worker.c
src/util/worker.h

index b7b3c8dc6f71ee5f3fdd6f05ce57143901071fc1..01a4f5867ab38d12ca9c323c8768bb49ee1b58fc 100644 (file)
@@ -231,7 +231,7 @@ static REQUEST *fr_worker_decode_request(fr_worker_t *worker, fr_time_t now)
         *      Note that the message "when" time MUST be copied from
         *      the original recv time.  We use "when" here, instead
         *      of *cd->request.recv_time, on the odd chance that a
-        *      new packet arrived while we were getting aroudn to
+        *      new packet arrived while we were getting around to
         *      processing this message.
         */
        request->channel = cd->channel.ch;
@@ -639,7 +639,7 @@ fr_worker_t *fr_worker_create(TALLOC_CTX *ctx, uint32_t num_transports, fr_trans
        worker->kq = fr_event_list_kq(worker->el);
        rad_assert(worker->kq >= 0);
 
-       worker->aq_control = fr_atomic_queue_create(worker, 128);
+       worker->aq_control = fr_atomic_queue_create(worker, 1024);
        if (!worker->aq_control) {
                talloc_free(worker);
                return NULL;
@@ -669,12 +669,23 @@ fr_worker_t *fr_worker_create(TALLOC_CTX *ctx, uint32_t num_transports, fr_trans
 /** Get the KQ for the worker
  *
  * @param[in] worker the worker data structure
+ * @return kq
  */
 int fr_worker_kq(fr_worker_t *worker)
 {
        return worker->kq;
 }
 
+/** Get the control-plane queue for the worker
+ *
+ * @param[in] worker the worker data structure
+ * @return the atomic queue for the control plane
+ */
+fr_atomic_queue_t *fr_worker_control_plane(fr_worker_t *worker)
+{
+       return worker->aq_control;
+}
+
 /** Signal a worker to exit
  *
  *  WARNING: This may be called from another thread!  Care is required.
@@ -744,8 +755,17 @@ void fr_worker(fr_worker_t *worker)
  */
 void worker_resume_request(REQUEST *request)
 {
+       /*
+        *      The request is no longer in the "yielded" list.  But
+        *      it isn't resumed (yet) so we don't add CPU time for
+        *      it.
+        */
        FR_DLIST_REMOVE(request->tracking.list);
 
+       /*
+        *      It's runnable again.
+        */
        (void) fr_heap_insert(request->runnable, request);
 }
 #endif
+
index 33e7aa4a80c6797cdf5b84cc257c991e4bdec819..f9ea67bc1a79c4fa64b64f2af63944bfbe0afe4a 100644 (file)
@@ -46,6 +46,7 @@ typedef struct fr_worker_t fr_worker_t;
 fr_worker_t *fr_worker_create(TALLOC_CTX *ctx, uint32_t num_transports, fr_transport_t **transports);
 void fr_worker_destroy(fr_worker_t *worker) CC_HINT(nonnull);
 int fr_worker_kq(fr_worker_t *worker) CC_HINT(nonnull);
+fr_atomic_queue_t *fr_worker_control_plane(fr_worker_t *worker) CC_HINT(nonnull);
 void fr_worker(fr_worker_t *worker) CC_HINT(nonnull);
 void fr_worker_exit(fr_worker_t *worker) CC_HINT(nonnull);