From: liu ping fan <qemulist@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-mm@kvack.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>, Mel Gorman <mgorman@suse.de>
Subject: Re: [PATCH] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS
Date: Thu, 6 Feb 2014 08:53:15 +0800 [thread overview]
Message-ID: <CAJnKYQmv3gwGXS9_HbFa6igT5d-=mGj26DX7oUbSdwZWRmr5TA@mail.gmail.com> (raw)
In-Reply-To: <20140205081148.GI2936@laptop.programming.kicks-ass.net>
On Wed, Feb 5, 2014 at 4:11 PM, Peter Zijlstra <peterz@infradead.org> 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@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-02-06 0:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 1:25 Liu Ping Fan
2014-02-05 8:11 ` Peter Zijlstra
2014-02-06 0:53 ` liu ping fan [this message]
2014-02-13 23:20 ` Andrew Morton
2014-02-26 7:52 ` Aneesh Kumar K.V
2014-02-27 23:41 ` Andrew Morton
2014-02-28 2:54 ` liu ping fan
2014-02-28 4:47 ` Aneesh Kumar K.V
2014-02-28 5:28 ` [PATCH V2] " Aneesh Kumar K.V
2014-02-28 6:36 ` [PATCH] " liu ping fan
2014-02-28 9:04 ` Aneesh Kumar K.V
2014-02-26 7:32 ` Aneesh Kumar K.V
2014-02-26 8:21 ` liu ping fan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJnKYQmv3gwGXS9_HbFa6igT5d-=mGj26DX7oUbSdwZWRmr5TA@mail.gmail.com' \
--to=qemulist@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox