mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Nick Piggin <npiggin@kernel.dk>
Cc: paulmck@linux.vnet.ibm.com,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Américo Wang" <xiyou.wangcong@gmail.com>,
	stable@kernel.org, "Greg Kroah-Hartman" <gregkh@suse.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rcu: fix possible bug  in include/linux/pagemap.h
Date: Wed, 27 Apr 2011 12:03:08 +0800	[thread overview]
Message-ID: <4DB7957C.2070307@cn.fujitsu.com> (raw)
In-Reply-To: <20110425134855.GH2681@linux.vnet.ibm.com>

On 04/25/2011 09:48 PM, Paul E. McKenney wrote:
> On Mon, Apr 25, 2011 at 04:20:37PM +0800, Lai Jiangshan wrote:
>> I read the code and comments written by Nick Piggin(mainly from e286781d),
>> page_cache_get_speculative() is protected by rcu_read_lock(),
>> it may be preempted when preemptible RCU, so we must use get_page_unless_zero()
>> in this situation.
>>
>> In the days of e286781d, we only have CLASSIC_RCU and (old)PREEMPT_RCU,
>> so "defined(CONFIG_CLASSIC_RCU)" means non-preemptible RCU and the code is correct.
>>
>> In the days of b560d8ad, we only have TREE_RCU and TREE_PREEMPT_RCU,
>> so "defined(CONFIG_TREE_RCU)" means non-preemptible RCU and the code is correct.
>>
>> But in nowadays, we have TREE_RCU, TREE_PREEMPT_RCU, TINY_RCU and TINY_PREEMPT_RCU,
>> so the "defined(CONFIG_TREE_RCU)" for non-preemptible RCU is incorrect, and it may causes bugs.
>> we should use "!defined(CONFIG_PREEMPT_RCU)" for non-preemptible RCU code block.
>>
>> CC: Nick Piggin <npiggin@kernel.dk>
>> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>> Reported-by: WANG Cong <amwang@redhat.com>
>> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> 
> Good catch!!!
> 
> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 


Sorry, I forgot to CC it to LKML. Added it.


Hi, Nick Piggin,

Could you review it?

Thanks,
Lai

       reply	other threads:[~2011-04-27  4:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4DB52ED5.6070800@cn.fujitsu.com>
     [not found] ` <20110425134855.GH2681@linux.vnet.ibm.com>
2011-04-27  4:03   ` Lai Jiangshan [this message]
2011-04-27 16:58     ` Américo Wang

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=4DB7957C.2070307@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=stable@kernel.org \
    --cc=xiyou.wangcong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®