linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@osdl.org>, Hugh Dickins <hugh@veritas.com>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Linux Memory Management <linux-mm@kvack.org>,
	"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [patch] mm: mremap correct rmap accounting
Date: Mon, 29 Jan 2007 21:27:19 +0000	[thread overview]
Message-ID: <20070129212719.GA12262@linux-mips.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0701291216340.3611@woody.linux-foundation.org>

On Mon, Jan 29, 2007 at 12:18:29PM -0800, Linus Torvalds wrote:

(adding Maciej who is using R4000 for much of his MIPS hacking to cc ...)

> > Can we convert those bits of mips to just have a single zero-page, like
> > everyone else?
> > 
> > Is that trick a correctness thing, or a performance thing?  If the latter,
> > how useful is it, and how common are the chips which use it?
> 
> It was a performance thing, iirc. Apparently a fairly big deal: pages 
> kicking each other out of the cache due to idiotic cache design. But I 
> forget any details.

R4000 and R4400 SC and MC versions suffer from virtual aliases but have a
hardware mechanism to detect them and will throw a virtual coherency
exception if so.  So in theory for these processors the entire burden of
handling cache aliases can be left to like ten lines of exception handling
code.  A real world machine may encounter millions of these exceptions in
a relativly short time which sucks performancewise, so aliasing avoidance
by careful selection of addresses and cacheflushes is needed.

So to make that more explicit, it's not needed for correctness but it's
a performance - and sometimes a fairly big one - thing.

(The easy solution for the issue would be raising the pagesize to the next
higher supported values, 16kB or 64kB.  Now for the true idiocy of this
exception-based scheme - it happens that the hardware checks three bits for
aliasing as if the CPU had 32kB direct mapped caches even though these
types only have 8kB (R4000) rsp 16kB (R4400) primary caches.  This means
ramping up the page size to 16kB wouldn't suffice - it would have to be
64kB to eleminate aliases which is impractical for memory reasons on many
systems.

Anyway, no other MIPS processor has this "virtual coherency exception"
and so I don't have an affected system at hand right now.  So I hacked
a 2.6.20-rc6 kernel for another machine to do R4x00 style ZERO_PAGE
handling - and the system did survive a quick 10min testing just fine
until a test case which Nick had mailed to me killed the system as
predicted.  I blame obsoletion of the chips and lucky choice of workload
for this issue only ever having been reported once and that report was
probably ignored because it was sufficiently obscure.

> MIPS in general is a f*cking pain in the *ss. They have a few chips that 
> are sane, but just an incredible amount of totally braindamaged ones. 
> They're not the only ones with virtual caches, but they're certainly 
> well-represented there. Sad.

Eh...  MIPS isn't the architecture with VIVT data caches.  It's other
arch maintainers that get their sleep robbed by truly st00pid caches.

  Ralf

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-01-29 21:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 14:19 [patch] mm: mremap correct rmap accounting Nick Piggin
2007-01-23 20:55 ` Hugh Dickins
2007-01-23 23:49   ` Nick Piggin
2007-01-29  3:31   ` Nick Piggin
2007-01-29  6:40     ` Andrew Morton
2007-01-29  6:57       ` Nick Piggin
2007-01-29 19:08     ` Hugh Dickins
2007-01-29 19:27       ` Linus Torvalds
2007-01-29 20:03         ` Andrew Morton
2007-01-29 20:18           ` Linus Torvalds
2007-01-29 21:27             ` Ralf Baechle [this message]
2007-01-29 20:10         ` Hugh Dickins
2007-01-29 20:22           ` Linus Torvalds
2007-01-29 20:38             ` Hugh Dickins
2007-01-29 21:24               ` Hugh Dickins
2007-01-30  1:00                 ` Nick Piggin
2007-01-30 14:24                 ` Carsten Otte
2007-01-30 16:41                   ` Ralf Baechle
2007-01-30 17:35                     ` Carsten Otte
2007-01-30 15:47                 ` Carsten Otte
2007-01-30 22:04                   ` Hugh Dickins
2007-01-31 13:51                     ` Carsten Otte
2007-01-31 13:59                     ` Carsten Otte
2007-01-31 16:31                       ` Hugh Dickins
2007-02-01 16:21                         ` Carsten Otte

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=20070129212719.GA12262@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-mm@kvack.org \
    --cc=macro@linux-mips.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).