[Top] [All Lists]

Re: patch to support topdown mmap allocation in MIPS

To: Jian Peng <>, David Daney <>
Subject: Re: patch to support topdown mmap allocation in MIPS
From: Kevin Cernekee <>
Date: Mon, 16 May 2011 18:27:17 -0700
Cc: "" <>, Ralf Baechle <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tOYvDOUFzlZUbskSkl0xgPvPTU0PLeKfMO0ly5uDEzg=; b=hkHe9tw5UZiWc0jVVHNYFD1WwL14UWJ+Wqj9O0GzL3CoN/4+vF7PsBM6FJ+xNPk/sj v1jNmtEhMl/rcBy+brnevTisDedYSJWRyOiyvVz8WepQzUyFyMQwH49qmUK8Qgdh04pM wHVQt7quNgKhdmGFkd+JfX5htEgqo38+h1e9o=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=guQreLhK67RvubHDTafsGfgVBHYp3DKEJx9Xh72TL1QhN200jmtOnZTzjUmg12LKxF h/+qbIDvhg929EQ2r+3mOwU0mHkQzZGF7egG98e/7R0eFCcvPW2IujxpUssI8jOeAaVY HcdGQ0Yv7FlsYNrsBH6RhCwDXMFnpCdF7IrAE=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
On Mon, May 16, 2011 at 5:12 PM, David Daney <> wrote:
> On 05/16/2011 02:09 PM, Jian Peng 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

>> +#ifdef CONFIG_32BIT
>> +       task_size = TASK_SIZE;
>> +#else /* Must be CONFIG_64BIT*/
>> +       task_size = test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 :
>> +#endif

Can the "#else" clause and "task_size" local variable be eliminated?
TASK_SIZE now performs this check automatically (although that wasn't
always the case).

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