All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Liu Ping Fan <qemulist@gmail.com>
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: Wed, 5 Feb 2014 09:11:48 +0100	[thread overview]
Message-ID: <20140205081148.GI2936@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <1391563546-26052-1-git-send-email-pingfank@linux.vnet.ibm.com>

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?

--
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>

  reply	other threads:[~2014-02-05  8:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05  1:25 [PATCH] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS Liu Ping Fan
2014-02-05  8:11 ` Peter Zijlstra [this message]
2014-02-06  0:53   ` liu ping fan
2014-02-13 23:20 ` Andrew Morton
2014-02-13 23:20   ` Andrew Morton
2014-02-26  7:52   ` Aneesh Kumar K.V
2014-02-26  7:52     ` Aneesh Kumar K.V
2014-02-27 23:41     ` Andrew Morton
2014-02-27 23:41       ` Andrew Morton
2014-02-28  2:54       ` liu ping fan
2014-02-28  2:54         ` liu ping fan
2014-02-28  4:47       ` Aneesh Kumar K.V
2014-02-28  4:47         ` Aneesh Kumar K.V
2014-02-28  5:28         ` [PATCH V2] " Aneesh Kumar K.V
2014-02-28  5:28           ` Aneesh Kumar K.V
2014-02-28  5:28           ` Aneesh Kumar K.V
2014-02-28  6:36         ` [PATCH] " liu ping fan
2014-02-28  6:36           ` liu ping fan
2014-02-28  9:04           ` Aneesh Kumar K.V
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=20140205081148.GI2936@laptop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=paulus@samba.org \
    --cc=qemulist@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.