Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2003 20:11:56 -0400
From:      Peter Dufault <dufault@hda.com>
To:        Archie Cobbs <archie@dellroad.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: lots of malloc(M_WAITOK)'s in interrupt context from camisr
Message-ID:  <5AC4B3BA-7AA0-11D7-BD29-000393B2C586@hda.com>
In-Reply-To: <200304292254.h3TMsJ7F072778@arch20m.dellroad.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tuesday, Apr 29, 2003, at 18:54 US/Eastern, Archie Cobbs wrote:

> John Baldwin wrote:
>> If you need to do more work in your interrupt routine than just 
>> wakeups
>> and dinking with registers, you can always wake up a software 
>> interrupt
>> handler or some other random kthread to do things that take a long 
>> amount
>> of time.
>
> Sure you can do that but I'm saying doing that is more complicated
> than necessary in some situations.
>
>>           Sleeping in an interrupt thread would destroy interrupt 
>> latency
>> far worse than it is now.  I'm sure we can all agree that that would 
>> be
>> unacceptable.
>
> I'm only advocating doing it for rare events like device
> insertion/removal, etc.
>
>>                Rather than making the interrupt thread implementation
>> very complex with magical spawning kthreads and such, I would prefer 
>> that
>> driver authors kick up software interrupt threads and the like on 
>> their
>> own and keep the ithread implementation simple.
>
> I'd argue that complexity in one place is preferable to complexity
> in 100 places (ie., every device driver).
>

The issue is promoting not thinking about what context you're working 
in.
It makes sense to have a clean API for kicking off a worker thread, but 
"automagic"
threads that kick in due to lack of thinking out how things work aren't 
ready for prime time.

To do what you're recommending, use a "Permit me to be naive" flag.
That puts the complexity in one place recognizing that it might not be 
the best place.

Peter

Peter Dufault (dufault@hda.com)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5AC4B3BA-7AA0-11D7-BD29-000393B2C586>