r780 - in trunk/varnish-cache: . bin/varnishd

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Aug 10 09:11:27 CEST 2006


In message <ujrhd0ldqj1.fsf at cat.linpro.no>, Dag-Erling =?iso-8859-1?Q?Sm=F8rgra
v?= writes:

>Even so, the behaviour I was seeing was far worse than I expected: CPU
>usage was pegged at 100% (almost all of it in system time) even with
>no clients; strace confirmed that nothing else was going on than a
>ping from the management process every three seconds.

Did it stay in the kernel or did it do a lot of system calls ?

What was the return value of poll(2) ?

The timeout argument is probably more suspect than the fd.

>I don't know if
>this has anything to do with passing in bogus pollfds (with fd = -1);
>a colleague looked through the kernel source while I was working on
>the epoll code and could not find anything to indicate that this
>should be a problem.

fd = -1 is specifically allowed:

	If the value of fd is less than 0, events shall be ignored,
	and revents shall be set to 0 in that entry on return from
	poll().


Poll(2) suffers from the same discrepancy as select(2): you have
to do the entire setup on every call, no state is retained in the
kernel.

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list