Good points. I cannot access working system now and will investigate it further tomorrow. On May 16, 2011, at 6:27 PM, "Kevin Cernekee" <cernekee@xxxxxxxxx> wrote: > 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). >