Re: [patch] context-switching overhead in X, ioport(), 2.6.8.1

From: David S. Miller
Date: Sat Aug 21 2004 - 23:48:02 EST



FWIW, I would recommend a sparse bitmap implementation for the
ioport stuff. Something simple like:

struct set_ent {
u32 pos;
u32 bits;
struct set_ent *next;
};

static inline int is_set(struct set_ent *head, int pos)
{
while (head != NULL) {
if (pos >= head->pos) {
if (pos < head->pos + 32) {
if (head->bits &
(1 << (pos - head->pos)))
return 1;
}
break;
}

head = head->next;
}
return 0;
}

You get the idea.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/