Changeset 4597 for trunk/varnish-cache

Show
Ignore:
Timestamp:
03/01/10 10:44:42 (5 months ago)
Author:
kristian
Message:

Read the epoll-timeout thread in the right place

With level-triggered epoll, this should take care of the cpu-spinning that
we saw in #644, but needs to be confirmed.

Location:
trunk/varnish-cache
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c

    r4552 r4597  
    161161        struct epoll_event ev[NEEV], *ep; 
    162162        struct sess *sp; 
     163        char junk; 
    163164        double deadline; 
    164165        int dotimer, i, n; 
     
    179180                        if (ep->data.ptr == dotimer_pipe && 
    180181                            (ep->events == EPOLLIN || ep->events == EPOLLPRI)) 
     182                        { 
     183                                assert(read(dotimer_pipe[0], &junk, 1)); 
    181184                                dotimer = 1; 
    182                         else 
     185                        } else 
    183186                                vca_eev(ep); 
    184187                } 
     
    209212{ 
    210213        char ticker = 'R'; 
    211         char junk; 
    212214 
    213215        THR_SetName("cache-epoll-sess_timeout_ticker"); 
     
    218220                assert(write(dotimer_pipe[1], &ticker, 1)); 
    219221                TIM_sleep(100 * 1e-3); 
    220                 assert(read(dotimer_pipe[0], &junk, 1)); 
    221222        } 
    222223        return NULL; 
  • trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c

    r4430 r4597  
    11/* 
    2  * $Id: vcc_gen_fixed_token.tcl 4428 2010-01-06 17:38:59Z tfheen $ 
     2 * $Id$ 
    33 * 
    44 * NB:  This file is machine generated, DO NOT EDIT! 
     
    160160        /* ../../include/vcl.h */ 
    161161 
    162         vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4428 2010-01-06 17"); 
    163         vsb_cat(sb, ":38:59Z tfheen $\n *\n * NB:  This file is machine gen"); 
    164         vsb_cat(sb, "erated, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixe"); 
    165         vsb_cat(sb, "d_token.tcl instead\n */\n\nstruct sess;\n"); 
     162        vsb_cat(sb, "/*\n * $Id$\n *\n * NB:  This file is machine generate"); 
     163        vsb_cat(sb, "d, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_tok"); 
     164        vsb_cat(sb, "en.tcl instead\n */\n\nstruct sess;\n"); 
    166165        vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n"); 
    167166        vsb_cat(sb, "typedef void vcl_fini_f(struct cli *);\n"); 
     
    228227        vsb_cat(sb, "SE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFT"); 
    229228        vsb_cat(sb, "WARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n"); 
    230         vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 4428 2010-01-06 17:"); 
    231         vsb_cat(sb, "38:59Z tfheen $\n *\n * Runtime support for compiled V"); 
    232         vsb_cat(sb, "CL programs.\n *\n * XXX: When this file is changed, l"); 
    233         vsb_cat(sb, "ib/libvcl/vcc_gen_fixed_token.tcl\n"); 
    234         vsb_cat(sb, " * XXX: *MUST* be rerun.\n */\n"); 
    235         vsb_cat(sb, "\nstruct sess;\nstruct vsb;\nstruct cli;\n"); 
    236         vsb_cat(sb, "struct director;\nstruct VCL_conf;\n"); 
    237         vsb_cat(sb, "struct sockaddr;\n\n/*\n * A backend probe specificati"); 
    238         vsb_cat(sb, "on\n */\n\nextern const void * const vrt_magic_string_"); 
    239         vsb_cat(sb, "end;\n\nstruct vrt_backend_probe {\n"); 
     229        vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id$\n *\n"); 
     230        vsb_cat(sb, " * Runtime support for compiled VCL programs.\n"); 
     231        vsb_cat(sb, " *\n * XXX: When this file is changed, lib/libvcl/vcc_"); 
     232        vsb_cat(sb, "gen_fixed_token.tcl\n * XXX: *MUST* be rerun.\n"); 
     233        vsb_cat(sb, " */\n\nstruct sess;\nstruct vsb;\n"); 
     234        vsb_cat(sb, "struct cli;\nstruct director;\n"); 
     235        vsb_cat(sb, "struct VCL_conf;\nstruct sockaddr;\n"); 
     236        vsb_cat(sb, "\n/*\n * A backend probe specification\n"); 
     237        vsb_cat(sb, " */\n\nextern const void * const vrt_magic_string_end;"); 
     238        vsb_cat(sb, "\n\nstruct vrt_backend_probe {\n"); 
    240239        vsb_cat(sb, "\tconst char\t*url;\n\tconst char\t*request;\n"); 
    241240        vsb_cat(sb, "\tdouble\t\ttimeout;\n\tdouble\t\tinterval;\n"); 
     
    313312        /* ../../include/vrt_obj.h */ 
    314313 
    315         vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4428 2010-01-06 17"); 
    316         vsb_cat(sb, ":38:59Z tfheen $\n *\n * NB:  This file is machine gen"); 
    317         vsb_cat(sb, "erated, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixe"); 
    318         vsb_cat(sb, "d_token.tcl instead\n */\n\nstruct sockaddr * VRT_r_cl"); 
    319         vsb_cat(sb, "ient_ip(const struct sess *);\n"); 
    320         vsb_cat(sb, "struct sockaddr * VRT_r_server_ip(struct sess *);\n"); 
    321         vsb_cat(sb, "const char * VRT_r_server_hostname(struct sess *);\n"); 
    322         vsb_cat(sb, "const char * VRT_r_server_identity(struct sess *);\n"); 
    323         vsb_cat(sb, "int VRT_r_server_port(struct sess *);\n"); 
    324         vsb_cat(sb, "const char * VRT_r_req_request(const struct sess *);\n"); 
    325         vsb_cat(sb, "void VRT_l_req_request(const struct sess *, const char"); 
    326         vsb_cat(sb, " *, ...);\nconst char * VRT_r_req_url(const struct ses"); 
    327         vsb_cat(sb, "s *);\nvoid VRT_l_req_url(const struct sess *, const c"); 
    328         vsb_cat(sb, "har *, ...);\nconst char * VRT_r_req_proto(const struc"); 
    329         vsb_cat(sb, "t sess *);\nvoid VRT_l_req_proto(const struct sess *, "); 
    330         vsb_cat(sb, "const char *, ...);\nvoid VRT_l_req_hash(struct sess *"); 
    331         vsb_cat(sb, ", const char *);\nstruct director * VRT_r_req_backend("); 
    332         vsb_cat(sb, "struct sess *);\nvoid VRT_l_req_backend(struct sess *,"); 
    333         vsb_cat(sb, " struct director *);\nint VRT_r_req_restarts(const str"); 
    334         vsb_cat(sb, "uct sess *);\ndouble VRT_r_req_grace(struct sess *);\n"); 
    335         vsb_cat(sb, "void VRT_l_req_grace(struct sess *, double);\n"); 
     314        vsb_cat(sb, "/*\n * $Id$\n *\n * NB:  This file is machine generate"); 
     315        vsb_cat(sb, "d, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_tok"); 
     316        vsb_cat(sb, "en.tcl instead\n */\n\nstruct sockaddr * VRT_r_client_"); 
     317        vsb_cat(sb, "ip(const struct sess *);\nstruct sockaddr * VRT_r_serv"); 
     318        vsb_cat(sb, "er_ip(struct sess *);\nconst char * VRT_r_server_hostn"); 
     319        vsb_cat(sb, "ame(struct sess *);\nconst char * VRT_r_server_identit"); 
     320        vsb_cat(sb, "y(struct sess *);\nint VRT_r_server_port(struct sess *"); 
     321        vsb_cat(sb, ");\nconst char * VRT_r_req_request(const struct sess *"); 
     322        vsb_cat(sb, ");\nvoid VRT_l_req_request(const struct sess *, const "); 
     323        vsb_cat(sb, "char *, ...);\nconst char * VRT_r_req_url(const struct"); 
     324        vsb_cat(sb, " sess *);\nvoid VRT_l_req_url(const struct sess *, con"); 
     325        vsb_cat(sb, "st char *, ...);\nconst char * VRT_r_req_proto(const s"); 
     326        vsb_cat(sb, "truct sess *);\nvoid VRT_l_req_proto(const struct sess"); 
     327        vsb_cat(sb, " *, const char *, ...);\nvoid VRT_l_req_hash(struct se"); 
     328        vsb_cat(sb, "ss *, const char *);\nstruct director * VRT_r_req_back"); 
     329        vsb_cat(sb, "end(struct sess *);\nvoid VRT_l_req_backend(struct ses"); 
     330        vsb_cat(sb, "s *, struct director *);\nint VRT_r_req_restarts(const"); 
     331        vsb_cat(sb, " struct sess *);\ndouble VRT_r_req_grace(struct sess *"); 
     332        vsb_cat(sb, ");\nvoid VRT_l_req_grace(struct sess *, double);\n"); 
    336333        vsb_cat(sb, "const char * VRT_r_req_xid(struct sess *);\n"); 
    337334        vsb_cat(sb, "unsigned VRT_r_req_esi(struct sess *);\n"); 
  • trunk/varnish-cache/lib/libvcl/vcc_obj.c

    r4430 r4597  
    11/* 
    2  * $Id: vcc_gen_fixed_token.tcl 4428 2010-01-06 17:38:59Z tfheen $ 
     2 * $Id$ 
    33 * 
    44 * NB:  This file is machine generated, DO NOT EDIT!