]> git.baikalelectronics.ru Git - kernel.git/commit
sh: Don't allocate smaller sized mappings on every iteration
authorMatt Fleming <matt@console-pimps.org>
Tue, 6 Oct 2009 21:22:34 +0000 (21:22 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 9 Oct 2009 02:26:35 +0000 (11:26 +0900)
commitfe8d959641481aef93fd561a4ecdec9b5b3e6865
treea00fa2f5873c331656410bd90b42ac5f7f6a63b2
parentf9db4f67b9cff30f78d0ec249da251574947be79
sh: Don't allocate smaller sized mappings on every iteration

Currently, we've got the less than ideal situation where if we need to
allocate a 256MB mapping we'll allocate four entries like so,

 entry 1: 128MB
 entry 2:  64MB
 entry 3:  16MB
 entry 4:  16MB

This is because as we execute the loop in pmb_remap() we will
progressively try mapping the remaining address space with smaller and
smaller sizes. This isn't good because the size we use on one iteration
may be the perfect size to use on the next iteration, for instance when
the initial size is divisible by one of the PMB mapping sizes.

With this patch, we now only need two entries in the PMB to map 256MB of
address space,

  entry 1: 128MB
  entry 2: 128MB

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/mm/pmb.c