linux-mips
[Top] [All Lists]

Re: patch to support topdown mmap allocation in MIPS

To: Kevin Cernekee <cernekee@gmail.com>
Subject: Re: patch to support topdown mmap allocation in MIPS
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 17 May 2011 17:52:41 +0100
Cc: Jian Peng <jipeng@broadcom.com>, David Daney <ddaney@caviumnetworks.com>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-reply-to: <BANLkTikq04wuK=bz+Lieavmm3oDtoYWKxg@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <E18F441196CA634DB8E1F1C56A50A8743242B54C8A@IRVEXCHCCR01.corp.ad.broadcom.com> <4DD1BD72.2000408@caviumnetworks.com> <BANLkTikq04wuK=bz+Lieavmm3oDtoYWKxg@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, May 16, 2011 at 06:27:17PM -0700, Kevin Cernekee wrote:

> >>  #define COLOUR_ALIGN(addr,pgoff)                              \
> >>        ((((addr) + shm_align_mask)&  ~shm_align_mask) +        \
> >>         (((pgoff)<<  PAGE_SHIFT)&  shm_align_mask))
> 
> I see COLOUR_ALIGN in arch/{arm,mips,sh,sparc} .  All sorts of
> embedded platforms have to worry about cache aliases nowadays.
> 
> Do you think this logic could be folded into the generic
> implementations in mm/mmap.c ?  Or is there something else inside our
> arch_get_unmapped_area* functions that's really, irreparably unique to
> MIPS?

There are always slightly odd architectures such as IA-64 where the page
size depends on the address or PARISC which in most of its cache handling
is about as straight forward as programming in Malbolge.

It should be easy enough to come up with a version however that fits most
architectures and everybody else can just override it just like the default
version of arch_get_unmapped_area.

  Ralf

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