On Wed, Feb 5, 2014 at 4:11 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote: > On Wed, Feb 05, 2014 at 09:25:46AM +0800, Liu Ping Fan wrote: >> When doing some numa tests on powerpc, I triggered an oops bug. I find >> it is caused by using page->_last_cpupid. It should be initialized as >> "-1 & LAST_CPUPID_MASK", but not "-1". Otherwise, in task_numa_fault(), >> we will miss the checking (last_cpupid == (-1 & LAST_CPUPID_MASK)). >> And finally cause an oops bug in task_numa_group(), since the online cpu is >> less than possible cpu. > > >> diff --git a/include/linux/mm.h b/include/linux/mm.h >> index a7b4e31..ddc66df4 100644 >> --- a/include/linux/mm.h >> +++ b/include/linux/mm.h >> @@ -727,7 +727,7 @@ static inline int page_cpupid_last(struct page *page) >> } >> static inline void page_cpupid_reset_last(struct page *page) >> { >> - page->_last_cpupid = -1; >> + page->_last_cpupid = -1 & LAST_CPUPID_MASK; >> } >> #else >> static inline int page_cpupid_last(struct page *page) > > OK, the changelog explained this part, and that makes sense I suppose. > > >> diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h >> index da52366..3cbaa20 100644 >> --- a/include/linux/page-flags-layout.h >> +++ b/include/linux/page-flags-layout.h >> @@ -69,15 +69,15 @@ >> #define LAST__CPU_MASK ((1 << LAST__CPU_SHIFT)-1) >> >> #define LAST_CPUPID_SHIFT (LAST__PID_SHIFT+LAST__CPU_SHIFT) >> + >> +#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT > BITS_PER_LONG - NR_PAGEFLAGS >> +#define LAST_CPUPID_NOT_IN_PAGE_FLAGS >> +#endif >> #else >> #define LAST_CPUPID_SHIFT 0 >> #endif >> >> -#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS >> #define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT >> -#else >> -#define LAST_CPUPID_WIDTH 0 >> -#endif >> >> /* >> * We are going to use the flags for the page to node mapping if its in >> @@ -87,8 +87,4 @@ >> #define NODE_NOT_IN_PAGE_FLAGS >> #endif >> >> -#if defined(CONFIG_NUMA_BALANCING) && LAST_CPUPID_WIDTH == 0 >> -#define LAST_CPUPID_NOT_IN_PAGE_FLAGS >> -#endif >> - >> #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ > > But what's this all about? And why does PPC end up needing the > not-in-page-flags case? Since ppc needs to support a large physical address region, up to 2^46 but small section size (2^24). So when NR_CPUS grows up, it is easily to cause not-in-page-flags. Regards, Fan -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>