On Mon, May 16, 2011 at 5:12 PM, David Daney <ddaney@xxxxxxxxxxxxxxxxxx> 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 MIPS? >> +#ifdef CONFIG_32BIT >> + Â Â Â task_size = TASK_SIZE; >> +#else /* Must be CONFIG_64BIT*/ >> + Â Â Â task_size = test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : >> TASK_SIZE; >> +#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).