Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
0841b654
Commit
0841b654
authored
Sep 17, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move vca_return_session() to Pool_Wait()
parent
c1059952
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
33 deletions
+31
-33
cache.h
bin/varnishd/cache.h
+1
-1
cache_acceptor.c
bin/varnishd/cache_acceptor.c
+0
-29
cache_center.c
bin/varnishd/cache_center.c
+2
-2
cache_pool.c
bin/varnishd/cache_pool.c
+26
-0
cache_waiter.h
bin/varnishd/cache_waiter.h
+2
-1
No files found.
bin/varnishd/cache.h
View file @
0841b654
...
...
@@ -645,7 +645,6 @@ struct vbc {
/* Prototypes etc ----------------------------------------------------*/
/* cache_acceptor.c */
void
vca_return_session
(
struct
sess
*
sp
);
void
VCA_Prep
(
struct
sess
*
sp
);
void
VCA_Init
(
void
);
void
VCA_Shutdown
(
void
);
...
...
@@ -840,6 +839,7 @@ void PipeSession(struct sess *sp);
void
Pool_Init
(
void
);
int
Pool_QueueSession
(
struct
sess
*
sp
);
void
Pool_Work_Thread
(
void
*
priv
,
struct
worker
*
w
);
void
Pool_Wait
(
struct
sess
*
sp
);
#define WRW_IsReleased(w) ((w)->wrw.wfd == NULL)
int
WRW_Error
(
const
struct
worker
*
w
);
...
...
bin/varnishd/cache_acceptor.c
View file @
0841b654
...
...
@@ -40,9 +40,6 @@
#include "vcli.h"
#include "cli_priv.h"
#include "cache.h"
#include "cache_waiter.h"
static
void
*
waiter_priv
;
pthread_t
VCA_thread
;
static
struct
timeval
tv_sndtimeo
;
...
...
@@ -296,25 +293,6 @@ vca_acct(void *arg)
}
/*--------------------------------------------------------------------*/
void
vca_return_session
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
AZ
(
sp
->
obj
);
AZ
(
sp
->
vcl
);
assert
(
sp
->
fd
>=
0
);
/*
* Set nonblocking in the worker-thread, before passing to the
* acceptor thread, to reduce syscall density of the latter.
*/
if
(
VTCP_nonblocking
(
sp
->
fd
))
SES_Close
(
sp
,
"remote closed"
);
waiter
->
pass
(
waiter_priv
,
sp
);
}
/*--------------------------------------------------------------------*/
static
void
...
...
@@ -325,14 +303,7 @@ ccf_start(struct cli *cli, const char * const *av, void *priv)
(
void
)
av
;
(
void
)
priv
;
AN
(
waiter
);
AN
(
waiter
->
name
);
AN
(
waiter
->
init
);
AN
(
waiter
->
pass
);
waiter_priv
=
waiter
->
init
();
AZ
(
pthread_create
(
&
VCA_thread
,
NULL
,
vca_acct
,
NULL
));
VSL
(
SLT_Debug
,
0
,
"Acceptor is %s"
,
waiter
->
name
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache_center.c
View file @
0841b654
...
...
@@ -108,7 +108,7 @@ cnt_wait(struct sess *sp)
sp
->
wrk
->
stats
.
sess_herd
++
;
SES_Charge
(
sp
);
sp
->
wrk
=
NULL
;
vca_return_session
(
sp
);
Pool_Wait
(
sp
);
return
(
1
);
}
if
(
i
==
1
)
{
...
...
@@ -398,7 +398,7 @@ cnt_done(struct sess *sp)
}
sp
->
wrk
->
stats
.
sess_herd
++
;
sp
->
wrk
=
NULL
;
vca_return_session
(
sp
);
Pool_Wait
(
sp
);
return
(
1
);
}
...
...
bin/varnishd/cache_pool.c
View file @
0841b654
...
...
@@ -54,9 +54,12 @@
#include "vcl.h"
#include "cli_priv.h"
#include "cache.h"
#include "cache_waiter.h"
#include "stevedore.h"
#include "hash_slinger.h"
static
void
*
waiter_priv
;
VTAILQ_HEAD
(
workerhead
,
worker
);
/* Number of work requests queued in excess of worker threads available */
...
...
@@ -454,6 +457,27 @@ wrk_herder_thread(void *priv)
NEEDLESS_RETURN
(
NULL
);
}
/*--------------------------------------------------------------------
* Wait for another request
*/
void
Pool_Wait
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
AZ
(
sp
->
obj
);
AZ
(
sp
->
vcl
);
assert
(
sp
->
fd
>=
0
);
/*
* Set nonblocking in the worker-thread, before passing to the
* acceptor thread, to reduce syscall density of the latter.
*/
if
(
VTCP_nonblocking
(
sp
->
fd
))
SES_Close
(
sp
,
"remote closed"
);
waiter
->
pass
(
waiter_priv
,
sp
);
}
/*--------------------------------------------------------------------*/
void
...
...
@@ -464,6 +488,8 @@ Pool_Init(void)
AZ
(
pthread_cond_init
(
&
herder_cond
,
NULL
));
Lck_New
(
&
herder_mtx
,
lck_herder
);
waiter_priv
=
waiter
->
init
();
wrk_addpools
(
params
->
wthread_pools
);
AZ
(
pthread_create
(
&
tp
,
NULL
,
wrk_herdtimer_thread
,
NULL
));
AZ
(
pthread_detach
(
tp
));
...
...
bin/varnishd/cache_waiter.h
View file @
0841b654
...
...
@@ -53,11 +53,12 @@ extern const struct waiter waiter_kqueue;
extern
const
struct
waiter
waiter_ports
;
#endif
extern
const
struct
waiter
waiter_poll
;
/* cache_session.c */
void
SES_Handle
(
struct
sess
*
sp
,
int
status
);
/* cache_waiter.c */
extern
const
struct
waiter
waiter_poll
;
const
char
*
WAIT_GetName
(
void
);
void
WAIT_tweak_waiter
(
struct
cli
*
cli
,
const
char
*
arg
);
void
WAIT_Init
(
void
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment