From owner-p4-projects@FreeBSD.ORG Wed Feb 7 05:01:34 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 753ED16A403; Wed, 7 Feb 2007 05:01:33 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BCD816A401 for ; Wed, 7 Feb 2007 05:01:32 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 0C90813C48E for ; Wed, 7 Feb 2007 05:01:32 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1751VLO081289 for ; Wed, 7 Feb 2007 05:01:31 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1751VRD081284 for perforce@freebsd.org; Wed, 7 Feb 2007 05:01:31 GMT (envelope-from csjp@freebsd.org) Date: Wed, 7 Feb 2007 05:01:31 GMT Message-Id: <200702070501.l1751VRD081284@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 114152 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 05:01:34 -0000 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); }