Commit 7b68f637 authored by Nils Goroll's avatar Nils Goroll

we missed to account no_thread from esi_level > 0

solve by moving the accumulation to the destructor
parent 0f099684
......@@ -40,10 +40,16 @@
#include "debug.h"
#include "VSC_pesi.h"
#include "pesi_tree.h"
#include "pesi_flags.h"
#include "pesi.h"
/* shared with vmod code */
struct lock stats_lock;
struct VSC_pesi *stats;
/* ------------------------------------------------------------
* pesi tasks
*
......@@ -115,6 +121,12 @@ pesi_destroy(struct pesi **pesip)
CHECK_OBJ_NOTNULL(pesi->pecx, PECX_MAGIC);
TAKE_OBJ_NOTNULL(pesi_tree, &pesi->pesi_tree, PESI_TREE_MAGIC);
if (pesi->no_thread != 0) {
Lck_Lock(&stats_lock);
stats->no_thread += pesi->no_thread;
Lck_Unlock(&stats_lock);
}
Lck_Lock(&pesi_tree->task_lock);
VTAILQ_REMOVE(&pesi_tree->task_head, pesi, list);
......
......@@ -52,8 +52,6 @@
#include "foreign/qdef.h"
#include "vqueue.h"
#include "VSC_pesi.h"
#include "debug.h"
#include "vdp_pesi.h"
#include "node.h"
......@@ -83,8 +81,6 @@ static void vped_close_vdp(struct req *, int, const struct vdp *);
static void assert_vdp_next_not(struct req *, const struct vdp *);
/* shared with vmod code */
struct lock stats_lock;
struct VSC_pesi *stats;
struct VSC_lck *lck_bytes_tree, *lck_pesi_tree;
struct mempool *mempool = NULL;
......@@ -758,12 +754,6 @@ vdp_pesi_fini(struct req *req, void **priv)
CHECK_OBJ_NOTNULL(bytes_tree, BYTES_TREE_MAGIC);
assert(bytes_tree == pesi_tree->tree);
if (pesi->no_thread != 0) {
Lck_Lock(&stats_lock);
stats->no_thread += pesi->no_thread;
Lck_Unlock(&stats_lock);
}
pesi_destroy(&pesi);
task_fini(pesi_tree, pesi);
......
......@@ -29,8 +29,6 @@
* interfaces shared between vdp_pesi.c and vmod_pesi.c
*/
extern struct lock stats_lock;
extern struct VSC_pesi *stats;
extern struct VSC_lck *lck_bytes_tree, *lck_pesi_tree;
extern const struct vdp VDP_pesi;
......
......@@ -45,6 +45,10 @@
#define VFAIL(ctx, fmt, ...) \
VRT_fail((ctx), "vdp pesi failure: " fmt, __VA_ARGS__)
/* in pesi.c */
extern struct lock stats_lock;
extern struct VSC_pesi *stats;
/* VMOD shared object globals */
static unsigned loadcnt = 0, warmcnt = 0;
static struct vsc_seg *vsc_seg = NULL, *pesi_vsc_seg = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment