linux-mips
[Top] [All Lists]

Re: [PATCH 2.5] SGI O2 framebuffer driver

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 2.5] SGI O2 framebuffer driver
From: Dominic Sweetman <dom@algor.co.uk>
Date: Thu, 12 Dec 2002 12:52:42 +0000
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, Vivien Chappelier <vivienc@nerim.net>, linux-mips@linux-mips.org, Ilya Volynets <ilya@theilya.com>
In-reply-to: <20021212132022.A5060@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.21.0212120004330.2300-100000@melkor> <1039656676.18587.63.camel@irongate.swansea.linux.org.uk> <20021212033307.C22987@linux-mips.org> <1039697045.21231.13.camel@irongate.swansea.linux.org.uk> <20021212132022.A5060@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
Ralf Baechle (ralf@linux-mips.org) writes:

> Flushes are very expensive operations, on the order of 16 cycles per
> cacheline plus memory delay.

Hmm.  Not on most MIPS CPUs; the internal cost of running the
writeback cache-op instructions is typically around 3 clocks per
cache-line.  But this is misleading anyway... too CPU-centric.

The associated memory operations are the slowest thing about cacheops,
always.  Memory accesses (120ns is good) are much, much slower than an
instruction time on a modern CPU (1-5ns).

So for your framebuffer, it's the write which does for you.  If you
use uncached mode and write 32-bit words that's 120ns/word.  You can
get a cacheline-sized burst of 8 words in and out in roughly the same
amount of time.

In most cases this means that cacheing the framebuffer and then
pushing it out will save a whole lot of time.  

It's not absolutely certain: in most MIPS CPUs (write allocate as well
as writeback) you also pay to read in the framebuffer data.  And it
tends to displace all sorts of other useful data from the cache, and
then you have to pay to bring it back again.

But in general the memory operations associated with write-backs and
invalidates are much more costly than the cacheops themselves.

-- 
Dominic Sweetman, 
MIPS Technologies (UK)
The Fruit Farm, Ely Road, Chittering, CAMBS CB5 9PH, ENGLAND
phone: +44 1223 706205 / fax: +44 1223 706250 / swbrd: +44 1223 706200
http://www.algor.co.uk

<Prev in Thread] Current Thread [Next in Thread>