From owner-freebsd-current Thu Oct 25 11:50:54 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id E5CC537B42B for ; Thu, 25 Oct 2001 11:50:22 -0700 (PDT) Received: (qmail 12974 invoked from network); 25 Oct 2001 18:50:17 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 25 Oct 2001 18:50:17 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011025113139.A56942@iguana.aciri.org> Date: Thu, 25 Oct 2001 03:59:43 -0700 (PDT) From: John Baldwin To: Luigi Rizzo Subject: RE: where is the idle_loop in current ? Cc: current@freebsd.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 25-Oct-01 Luigi Rizzo wrote: > I have some code (in stable) which is invoked from the idle > loop, see below. I was trying to port it to CURRENT, but > cannot find where the idle_loop (or idlethread ?) has gone. > Any pointers ? A grep for idlethread did not return > anything that i could parse. > > Furthermore, what kind of locking should i use instead of > splimp() (the procedures called by ether_input() are a > stripped down, bounded-execution-time version of the > interrupt service routines for ethernet adapters). kern_idle.c. However, it cannot use any blocking locks if you invoke it from idle_loop(). You could also consider using a low priority kernel thread which is what the vm zeroing code does. So far the network stack is not locked, so leave the splimp's in as place holders and ensure your kthread acquires Giant around ether_poll(). > thanks > luigi > > --- i386/i386/swtch.s 2001/07/26 02:29:10 1.89.2.4 > +++ i386/i386/swtch.s 2001/10/23 04:00:27 > @@ -246,6 +246,15 @@ > call _procrunnable > testl %eax,%eax > CROSSJUMP(jnz, sw1a, jz) > +#ifdef XORP_ETHER_POLLING > + incl idle_done > + call ether_poll > + sti > + nop > + cli > + testl %eax, %eax > + jnz idle_loop > +#endif > call _vm_page_zero_idle > testl %eax, %eax > jnz idle_loop > > > --- i386/isa/intr_machdep.c 2001/08/24 17:39:12 1.29.2.3 > +++ i386/isa/intr_machdep.c 2001/10/24 02:03:55 > > int > +ether_poll(void) > +{ > + static int i; > + > + int s = splimp(); > + if (i >= pr_next) > + i = 0 ; > + if (pr[i].handler) > + (*pr[i].handler)(pr[i].argument, 2); > + i++ ; > + splx(s); > + return 1; /* more polling */ > +} > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message