All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Amerigo Wang <amwang@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Mel Gorman <mel@csn.ul.ie>, Minchan Kim <minchan.kim@gmail.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: [Patch v2] rcu: update the CONFIG logic in include/linux/pagemap.h
Date: Fri, 8 Apr 2011 09:39:04 -0700	[thread overview]
Message-ID: <20110408163904.GD2277@linux.vnet.ibm.com> (raw)
In-Reply-To: <1302071569-23217-1-git-send-email-amwang@redhat.com>

On Wed, Apr 06, 2011 at 02:32:48PM +0800, Amerigo Wang wrote:
> TREE_RCU depends on !PREEMPT && SMP, when !CONFIG_SMP is true, CONFIG_TREE_RCU
> will be false, thus "!defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)"
> is always false.
> 
> Paul suggested to update the logic to
> !defined(CONFIG_SMP) && defined(CONFIG_TREE_PREEMPT_RCU).

Hello, Amerigo,

Thank you for keeping on top of this one!

But how does this patch handle the #else clauses?

							Thanx, Paul

> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: WANG Cong <amwang@redhat.com>
> 
> ---
>  include/linux/pagemap.h |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index c119506..a296d7c 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -133,10 +133,9 @@ static inline int page_cache_get_speculative(struct page *page)
>  {
>  	VM_BUG_ON(in_interrupt());
> 
> -#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
> -# ifdef CONFIG_PREEMPT
> +#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_PREEMPT_RCU)
> +	/* Must have CONFIG_PREEMPT here, implied by CONFIG_TREE_PREEMPT_RCU. */
>  	VM_BUG_ON(!in_atomic());
> -# endif
>  	/*
>  	 * Preempt must be disabled here - we rely on rcu_read_lock doing
>  	 * this for us.
> @@ -171,10 +170,8 @@ static inline int page_cache_add_speculative(struct page *page, int count)
>  {
>  	VM_BUG_ON(in_interrupt());
> 
> -#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
> -# ifdef CONFIG_PREEMPT
> +#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_PREEMPT_RCU)
>  	VM_BUG_ON(!in_atomic());
> -# endif
>  	VM_BUG_ON(page_count(page) == 0);
>  	atomic_add(count, &page->_count);
> 

      reply	other threads:[~2011-04-08 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06  6:32 [Patch v2] rcu: update the CONFIG logic in include/linux/pagemap.h Amerigo Wang
2011-04-08 16:39 ` Paul E. McKenney [this message]

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=20110408163904.GD2277@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=amwang@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@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.