Date: Wed, 7 Feb 2007 05:01:31 GMT From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 114152 for review Message-ID: <200702070501.l1751VRD081284@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114152 Change 114152 by csjp@csjp_rnd01 on 2007/02/07 05:01:04 Annotate that in the future before we issue wakesup, we might do something like: (1) Check to see if this descriptor is operating in immediate mode (2) Check to see if the holder buffer is NULL (3) Check to see if we are waking up any sleepers We do not need to check the store buffer, as the fact that it has data in it at this point in the code is invariant. If the following conditions are true, then rotate the buffer. This will save userspace from issuing an ioctl(2) potentially per wakeup. Affected files ... .. //depot/projects/zcopybpf/src/sys/net/bpf.c#14 edit Differences ... ==== //depot/projects/zcopybpf/src/sys/net/bpf.c#14 (text+ko) ==== @@ -1760,6 +1760,11 @@ (*cpfn)(d, d->bd_sbuf, curlen + hdrlen, pkt, hdr.bh_caplen); d->bd_slen = curlen + totlen; + /* + * XXXCSJP we could probably save a syscall per wakeup if we check the + * d->bd_immediate flag, hold buffer status and rotate the buffers + * before the wakeup. + */ if (do_wakeup) bpf_wakeup(d); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702070501.l1751VRD081284>