Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jan 2006 09:03:17 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        kamal kc <kamal_ckk@yahoo.com>
Subject:   Re: rescheduling tasks using swi_add()
Message-ID:  <200601110903.18120.jhb@freebsd.org>
In-Reply-To: <20060111121304.62832.qmail@web30013.mail.mud.yahoo.com>
References:  <20060111121304.62832.qmail@web30013.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> =A0<>< =A0http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601110903.18120.jhb>