Re: convert netisr to real softinterrupt

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mark Kettenis
Date: Thursday, November 25, 2010 - 3:23 pm

> Date: Thu, 25 Nov 2010 12:30:39 +0000

Especially on MP kernels.


The hppa and i386/amd64 approach are rather similar.  Both do an
atomic load and clear, which happens to be the only atomic instruction
available on hppa, and is easy to implement as an atomic swap with 0
on i386/amd64.  But implementing this operation on other architectures
shouldn't be much more difficult, and should work just as well as the
proposed code that uses atomic_clearbits_int().  The MI code would
look something like:

void
netintr(void *unused)
{
	int n;

	n = atomic_load_and_clear(&netisr);
#define DONETISR(bit, fn)			\
		do {				\
			if (n & 1 << (bit))	\
				fn();		\
		} while ( /* CONSTCOND */ 0)
#include <net/netisr_dispatch.h>
}
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
convert netisr to real softinterrupt, Claudio Jeker, (Wed Nov 24, 9:06 am)
Re: convert netisr to real softinterrupt, Mike Belopuhov, (Wed Nov 24, 9:42 am)
Re: convert netisr to real softinterrupt, Claudio Jeker, (Thu Nov 25, 3:50 am)
Re: convert netisr to real softinterrupt, Mike Belopuhov, (Thu Nov 25, 4:21 am)
Re: convert netisr to real softinterrupt, Owain Ainsworth, (Thu Nov 25, 5:30 am)
Re: convert netisr to real softinterrupt, Henning Brauer, (Thu Nov 25, 5:41 am)
Re: convert netisr to real softinterrupt, Claudio Jeker, (Thu Nov 25, 9:02 am)
Re: convert netisr to real softinterrupt, Henning Brauer, (Thu Nov 25, 11:12 am)
Re: convert netisr to real softinterrupt, Henning Brauer, (Thu Nov 25, 11:13 am)
Re: convert netisr to real softinterrupt, Mark Kettenis, (Thu Nov 25, 3:23 pm)
Re: convert netisr to real softinterrupt, Owain Ainsworth, (Thu Nov 25, 3:45 pm)
Re: convert netisr to real softinterrupt, Claudio Jeker, (Mon Dec 20, 7:45 am)