[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BANLkTikQxDeHzvs6yw9SiE8M9VN0qNgRcw@mail.gmail.com>
Date: Thu, 28 Apr 2011 00:58:46 +0800
From: Américo Wang <xiyou.wangcong@...il.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Nick Piggin <npiggin@...nel.dk>, paulmck@...ux.vnet.ibm.com,
Andrew Morton <akpm@...ux-foundation.org>, stable@...nel.org,
Greg Kroah-Hartman <gregkh@...e.de>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rcu: fix possible bug in include/linux/pagemap.h
On Wed, Apr 27, 2011 at 12:03 PM, Lai Jiangshan <laijs@...fujitsu.com> wrote:
> 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@...nel.dk>
>>> Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
>>> Reported-by: WANG Cong <amwang@...hat.com>
>>> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
>>
>> Good catch!!!
>>
>> Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
>>
>
>
> Sorry, I forgot to CC it to LKML. Added it.
>
Thanks for fixing this!
The description explains quite well, so I am okay with this patch,
Reviewed-by: WANG Cong <xiyou.wangcong@...il.com>
BTW, you added my company email in Reported-by, but Cc'ed my gmail. ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists