public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org,
	rlrevell@joe-job.com
Subject: Re: [patch] context-switching overhead in X, ioport(), 2.6.8.1
Date: Sat, 21 Aug 2004 21:46:32 -0700	[thread overview]
Message-ID: <20040821214632.62d58e40.davem@redhat.com> (raw)
In-Reply-To: <20040821135516.GA3872@elte.hu>


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.

  reply	other threads:[~2004-08-22  4:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-21 13:55 [patch] context-switching overhead in X, ioport(), 2.6.8.1 Ingo Molnar
2004-08-22  4:46 ` David S. Miller [this message]
2004-08-22  5:42   ` Ryan Cumming
2004-08-22  6:00     ` Lee Revell
2004-08-22  6:06       ` Ryan Cumming
     [not found] <2vEzI-Vw-17@gated-at.bofh.it>
2004-08-22 12:16 ` Andi Kleen
2004-08-22 12:00   ` Alan Cox
2004-08-22 14:23     ` Andi Kleen
2004-08-22 14:47       ` Alan Cox
2004-08-22 17:31       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040821214632.62d58e40.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rlrevell@joe-job.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox