From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 11 14:20:27 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C087B16A41F for ; Wed, 11 Jan 2006 14:20:27 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A1A043D49 for ; Wed, 11 Jan 2006 14:20:26 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 5794941 for multiple; Wed, 11 Jan 2006 09:18:49 -0500 Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0BEKM4C071494; Wed, 11 Jan 2006 09:20:22 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 11 Jan 2006 09:03:17 -0500 User-Agent: KMail/1.8.3 References: <20060111121304.62832.qmail@web30013.mail.mud.yahoo.com> In-Reply-To: <20060111121304.62832.qmail@web30013.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200601110903.18120.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1238/Wed Jan 11 05:19:06 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: kamal kc Subject: Re: rescheduling tasks using swi_add() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2006 14:20:27 -0000 On Wednesday 11 January 2006 07:13 am, kamal kc wrote: > dear everybody, > > i had previous thread going on about the cpu load > average. and had some discussion regarding it. i have > a newer thing to discuss on so i started this thread. > > as i mentioned earlier i had put some code in the > bridge.c > that performed compression which took a long time and > hence > i got a high number of interface interrupts (irq22: xl > interrupts). > > so i thought of rescheduling the compression tasks > without > blocking the bridge function. i found this function > swi_add() > which i could use to add software interrupt handlers > that > could be run at a later time without causing high > interface > interrupts. > > the man page discussed the swi_add() and swi_sched() > functions. > > what i don't understand is, how do i register my > handler > function ?? > if i use the swi_add() for that purpose what > do i use for the void *arg argument. > > and how can i dispatch control to the software > interrupt handler ?? > the swi_sched() uses only the cookie and the flags > arguments. > there is no way i can pass arguments to my handler > function .. > > i guess most of you are familiar with this and can > help me > out ...... Queue a task to a taskqueue. Behind the scenes that will invoke a swi_add = if=20 you use the taskqueue_swi queue. However, given that you want to do some=20 rather complicated work, you'd be better off creating a dedicated taskqueue= =20 thread and queueing tasks off to it I think. =2D-=20 John Baldwin =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org