Commit 1c14a9d4 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the waitinglist hold req instead of sp

parent 611815fa
...@@ -562,6 +562,7 @@ struct req { ...@@ -562,6 +562,7 @@ struct req {
uint8_t hash_always_miss; uint8_t hash_always_miss;
struct sess *sp; struct sess *sp;
VTAILQ_ENTRY(req) w_list;
/* The busy objhead we sleep on */ /* The busy objhead we sleep on */
struct objhead *hash_objhead; struct objhead *hash_objhead;
......
...@@ -419,7 +419,7 @@ HSH_Lookup(struct req *req) ...@@ -419,7 +419,7 @@ HSH_Lookup(struct req *req)
wrk->nwaitinglist = NULL; wrk->nwaitinglist = NULL;
} }
VTAILQ_INSERT_TAIL(&oh->waitinglist->list, VTAILQ_INSERT_TAIL(&oh->waitinglist->list,
req->sp, list); req, w_list);
} }
if (cache_param->diag_bitmap & 0x20) if (cache_param->diag_bitmap & 0x20)
VSLb(req->vsl, SLT_Debug, VSLb(req->vsl, SLT_Debug,
...@@ -469,6 +469,7 @@ static void ...@@ -469,6 +469,7 @@ static void
hsh_rush(struct dstat *ds, struct objhead *oh) hsh_rush(struct dstat *ds, struct objhead *oh)
{ {
unsigned u; unsigned u;
struct req *req;
struct sess *sp; struct sess *sp;
struct waitinglist *wl; struct waitinglist *wl;
...@@ -477,12 +478,14 @@ hsh_rush(struct dstat *ds, struct objhead *oh) ...@@ -477,12 +478,14 @@ hsh_rush(struct dstat *ds, struct objhead *oh)
wl = oh->waitinglist; wl = oh->waitinglist;
CHECK_OBJ_NOTNULL(wl, WAITINGLIST_MAGIC); CHECK_OBJ_NOTNULL(wl, WAITINGLIST_MAGIC);
for (u = 0; u < cache_param->rush_exponent; u++) { for (u = 0; u < cache_param->rush_exponent; u++) {
sp = VTAILQ_FIRST(&wl->list); req = VTAILQ_FIRST(&wl->list);
if (sp == NULL) if (req == NULL)
break; break;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
sp = req->sp;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AZ(sp->wrk); AZ(sp->wrk);
VTAILQ_REMOVE(&wl->list, sp, list); VTAILQ_REMOVE(&wl->list, req, w_list);
DSL(0x20, SLT_Debug, sp->vsl_id, "off waiting list"); DSL(0x20, SLT_Debug, sp->vsl_id, "off waiting list");
if (SES_Schedule(sp)) { if (SES_Schedule(sp)) {
/* /*
......
...@@ -68,7 +68,7 @@ struct objcore *HSH_NewObjCore(struct worker *wrk); ...@@ -68,7 +68,7 @@ struct objcore *HSH_NewObjCore(struct worker *wrk);
struct waitinglist { struct waitinglist {
unsigned magic; unsigned magic;
#define WAITINGLIST_MAGIC 0x063a477a #define WAITINGLIST_MAGIC 0x063a477a
VTAILQ_HEAD(, sess) list; VTAILQ_HEAD(, req) list;
}; };
struct objhead { struct objhead {
......
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