On Sat, 2 Dec 2006 14:47:24 -0500 (EST) Daniel Eischen <deischen_at_freebsd.org> wrote: > > ume_at_ said that I don't know it is right. Old resolver codes > > and RPC didn't use _kqueue. In fact, there are some kqueue > > in some libc codes. > Yes, I saw them (see my previous email from a few days ago)... > Are you using cached? You have to change all kevent()'s in > net/nscachedcli.c to _kevent(). Yes, I'm using cached. I did change all kevent and kqueue to _kevent and _kqueue in net/nscachedcli.c, and test cvsync. Please see following patch. But I don't feel improvement:-(. # ktrace -tcnisuw -i /usr/local/bin/cvsync -4 -v 'cvsync://cvsync.allbsd.org/freebsd-src/rcs/?prefix=/home/ncvs' Parsing a URI cvsync://cvsync.allbsd.org/freebsd-src/rcs/?prefix=/home/ncvs... Connecting to cvsync.allbsd.org port 7777 Connected to 133.31.130.35 port 7777 Protocol: 0.24 Hash: MD5 Exchanging collection list... collection name "freebsd-src" release "rcs" umask 022 Compression: none Trying to establish the multiplexed channel... Running... Updating (collection freebsd-src/rcs) /home/ncvs/src/games/fortune/datfiles/.cvsync.CxmYNn: Unknown error: 0 Updater(RCS): UPDATE: /home/ncvs/src/games/fortune/datfiles/freebsd-tips,v Updater: RCS Error Socket Error: recv: 2 residue 2 Receiver Error: recv DirScan: Finalizer Error Mux(SEND) Error: not running: 1 FileScan(RCS): UPDATE /home/ncvs/src/sys/dev/mii/miivar.h,v FileScan: RCS Error Failed # --- lib/libc/include/un-namespace.h.orig Wed Mar 29 03:48:49 2006 +++ lib/libc/include/un-namespace.h Sat Dec 2 13:06:22 2006 _at__at_ -57,6 +57,7 _at__at_ #undef getsockname #undef getsockopt #undef ioctl +#undef kqueue #undef kevent #undef listen #undef nanosleep _at__at_ -234,6 +235,7 _at__at_ #endif #ifdef _SYS_EVENT_H_ +int _kqueue(void); int _kevent(int, const struct kevent *, int, struct kevent *, int, const struct timespec *); #endif --- lib/libc/net/nscachedcli.c.orig Wed May 3 08:02:32 2006 +++ lib/libc/net/nscachedcli.c Sun Dec 3 14:44:35 2006 _at__at_ -72,7 +72,7 _at__at_ timeout.tv_nsec = 0; result = 0; do { - nevents = kevent(connection->write_queue, NULL, 0, &eventlist, + nevents = _kevent(connection->write_queue, NULL, 0, &eventlist, 1, &timeout); if ((nevents == 1) && (eventlist.filter == EVFILT_WRITE)) { s_result = _write(connection->sockfd, data + result, _at__at_ -114,7 +114,7 _at__at_ timeout.tv_nsec = 0; result = 0; do { - nevents = kevent(connection->read_queue, NULL, 0, &eventlist, + nevents = _kevent(connection->read_queue, NULL, 0, &eventlist, 1, &timeout); if (nevents == 1 && eventlist.filter == EVFILT_READ) { s_result = _read(connection->sockfd, data + result, _at__at_ -170,16 +170,16 _at__at_ EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD, NOTE_LOWAT, sizeof(int), NULL); - res = kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); + res = _kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); - nevents = kevent(connection->write_queue, NULL, 0, &eventlist, 1, + nevents = _kevent(connection->write_queue, NULL, 0, &eventlist, 1, NULL); if (nevents == 1 && eventlist.filter == EVFILT_WRITE) { result = (_sendmsg(connection->sockfd, &cred_hdr, 0) == -1) ? -1 : 0; EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); - kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); + _kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL); return (result); } else return (-1); _at__at_ -220,17 +220,17 _at__at_ retval->sockfd = client_socket; - retval->write_queue = kqueue(); + retval->write_queue = _kqueue(); assert(retval->write_queue != -1); EV_SET(&eventlist, retval->sockfd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); - res = kevent(retval->write_queue, &eventlist, 1, NULL, 0, NULL); + res = _kevent(retval->write_queue, &eventlist, 1, NULL, 0, NULL); - retval->read_queue = kqueue(); + retval->read_queue = _kqueue(); assert(retval->read_queue != -1); EV_SET(&eventlist, retval->sockfd, EVFILT_READ, EV_ADD, 0, 0, NULL); - res = kevent(retval->read_queue, &eventlist, 1, NULL, 0, NULL); + res = _kevent(retval->read_queue, &eventlist, 1, NULL, 0, NULL); return (retval); } --- lib/libc/resolv/res_send.c.orig Tue Oct 24 23:41:43 2006 +++ lib/libc/resolv/res_send.c Sat Dec 2 13:07:23 2006 _at__at_ -328,8 +328,8 _at__at_ terrno = ETIMEDOUT; #ifdef USE_KQUEUE - if ((kq = kqueue()) < 0) { - Perror(statp, stderr, "kqueue", errno); + if ((kq = _kqueue()) < 0) { + Perror(statp, stderr, "_kqueue", errno); return (-1); } #endif
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:03 UTC