* Re: [PATCH] rcu: fix possible bug in include/linux/pagemap.h [not found] ` <20110425134855.GH2681@linux.vnet.ibm.com> @ 2011-04-27 4:03 ` Lai Jiangshan 2011-04-27 16:58 ` Américo Wang 0 siblings, 1 reply; 2+ messages in thread From: Lai Jiangshan @ 2011-04-27 4:03 UTC (permalink / raw) To: Nick Piggin Cc: paulmck, Andrew Morton, Américo Wang, stable, Greg Kroah-Hartman, LKML 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rcu: fix possible bug in include/linux/pagemap.h 2011-04-27 4:03 ` [PATCH] rcu: fix possible bug in include/linux/pagemap.h Lai Jiangshan @ 2011-04-27 16:58 ` Américo Wang 0 siblings, 0 replies; 2+ messages in thread From: Américo Wang @ 2011-04-27 16:58 UTC (permalink / raw) To: Lai Jiangshan Cc: Nick Piggin, paulmck, Andrew Morton, stable, Greg Kroah-Hartman, LKML On Wed, Apr 27, 2011 at 12:03 PM, Lai Jiangshan <laijs@cn.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@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. > Thanks for fixing this! The description explains quite well, so I am okay with this patch, Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> BTW, you added my company email in Reported-by, but Cc'ed my gmail. ;-) ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-27 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4DB52ED5.6070800@cn.fujitsu.com>
[not found] ` <20110425134855.GH2681@linux.vnet.ibm.com>
2011-04-27 4:03 ` [PATCH] rcu: fix possible bug in include/linux/pagemap.h Lai Jiangshan
2011-04-27 16:58 ` Américo Wang
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.