From: Rik Faith <faith@precisioninsight.com>
To: James Simmons <jsimmons@edgeglobal.com>
Cc: Linux MM <linux-mm@kvack.org>
Subject: Re: MMIO regions
Date: Sun, 10 Oct 1999 07:24:58 -0400 [thread overview]
Message-ID: <199910101124.HAA32129@light.alephnull.com> (raw)
In-Reply-To: <Pine.LNX.4.10.9910061633250.29637-100000@imperial.edgeglobal.com>
On 7 Oct 99 19:40:32 GMT, James Simmons <jsimmons@edgeglobal.com> wrote:
> On Mon, 4 Oct 1999, Stephen C. Tweedie wrote:
> > On Mon, 4 Oct 1999 14:29:14 -0400 (EDT), James Simmons
> > <jsimmons@edgeglobal.com> said:
> >
> > > Okay. But none of this prevents a rogue app from hosing your system. Such
> > > a process doesn't have to bother with locks or semaphores.
> >
> > And we talked about this before. You _can_ make such a guarantee, but
> > it is hideously expensive especially on SMP. You either protect the
> > memory or the CPU against access by the other app, and that requires
> > either scheduler or VM interrupts between CPUs.
>
> No VM stuff. I think the better approach is with the scheduler. The nice
> thing about the schedular is the schedular lock. I'm assuming durning
> is lock no other process on any CPU can be resceduled. Its during the lock
> that I can test to see if a process is using a MMIO region that already in
> use by another process. If it is then skip this process. If not weight
> this process with the others. If a process is slected to be the next
> executed process then lock the mmio region.
If I understand what you are saying, there are serious performance
implications for direct-rendering clients (in addition to the added
scheduler overhead, which will negatively impact overall system
performance).
I believe you are saying:
1) There are n processes, each of which has the MMIO region mmap'd.
2) The scheduler will only schedule one of these processes at a time,
even on an SMP system. [I'm assuming this is what you mean by "in
use", since the scheduler can't know about actual MMIO writes -- it
has to assume that a mapped region is a region that is "in use",
even if it isn't (e.g., a threaded program may have the MMIO region
mapped in n-1 threads, but may only direct render in 1 thread).]
On MMIO-based graphics cards (i.e., those that do not use traditional DMA),
a direct-rendering client will intersperse relatively long periods of
computation with relatively short periods of MMIO writes. In your scheme,
one of these clients will run for a whole time slice before the other one
runs (i.e., they will run in alternate time slices, even on an SMP system
with sufficient processors to run both simultaneously). Because actual
MMIO writes take up a relatively small fraction of that time slice,
rendering performance will potentially decrease by a factor of 2 (or more,
if more CPUs are available). This is significant, especially since many
high-end OpenGL applications are threaded and expect to be able to run
simultaneously on SMP systems.
The cooperative locking system used by the DRI (see
http://precisioninsight.com/dr/locking.html) allows direct-rendering
clients to perform fine-grain locking only when the MMIO region is actually
being written. The overhead for this system is extremely low (about 2
instructions to lock, and 1 instruction to unlock). Cooperative locking
like this allows several threads that all map the same MMIO region to run
simultaneously on an SMP system.
--
Rik Faith: faith@precisioninsight.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
next prev parent reply other threads:[~1999-10-10 11:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-04 14:38 James Simmons
1999-10-04 15:31 ` Stephen C. Tweedie
1999-10-04 15:52 ` James Simmons
1999-10-04 16:02 ` Benjamin C.R. LaHaise
1999-10-04 17:27 ` James Simmons
1999-10-04 17:56 ` Benjamin C.R. LaHaise
1999-10-04 18:26 ` James Simmons
1999-10-04 19:19 ` Stephen C. Tweedie
1999-10-06 20:15 ` James Simmons
1999-10-11 17:09 ` Stephen C. Tweedie
1999-10-11 17:26 ` Jeff Garzik
1999-10-11 23:14 ` James Simmons
1999-10-11 17:57 ` James Simmons
1999-10-04 16:11 ` Stephen C. Tweedie
1999-10-04 18:29 ` James Simmons
1999-10-04 19:35 ` Stephen C. Tweedie
1999-10-07 19:40 ` James Simmons
1999-10-10 11:24 ` Rik Faith [this message]
1999-10-10 14:03 ` Eric W. Biederman
1999-10-10 18:46 ` Rik Faith
1999-10-11 0:21 ` James Simmons
1999-10-11 10:59 ` Rik Faith
1999-10-11 3:38 ` Eric W. Biederman
1999-10-10 14:21 ` James Simmons
1999-10-11 17:22 ` Stephen C. Tweedie
1999-10-04 16:58 ` Marcus Sundberg
1999-10-04 18:27 ` James Simmons
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=199910101124.HAA32129@light.alephnull.com \
--to=faith@precisioninsight.com \
--cc=jsimmons@edgeglobal.com \
--cc=linux-mm@kvack.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