Re: [PATCH v1 01/14] include/linux/memcontrol.h: do not warn in page_memcg_rcu() if !CONFIG_MEMCG

2021-03-13 Thread Yu Zhao
On Sat, Mar 13, 2021 at 03:09:18PM +, Matthew Wilcox wrote: > On Sat, Mar 13, 2021 at 12:57:34AM -0700, Yu Zhao wrote: > > We want to make sure the rcu lock is held while using > > page_memcg_rcu(). But having a WARN_ON_ONCE() in page_memcg_rcu() when > > !CONFIG_MEMCG is superfluous because of

Re: [PATCH v1 01/14] include/linux/memcontrol.h: do not warn in page_memcg_rcu() if !CONFIG_MEMCG

2021-03-13 Thread Matthew Wilcox
On Sat, Mar 13, 2021 at 12:57:34AM -0700, Yu Zhao wrote: > We want to make sure the rcu lock is held while using > page_memcg_rcu(). But having a WARN_ON_ONCE() in page_memcg_rcu() when > !CONFIG_MEMCG is superfluous because of the following legit use case: > > memcg = lock_page_memcg(page1) >

[PATCH v1 01/14] include/linux/memcontrol.h: do not warn in page_memcg_rcu() if !CONFIG_MEMCG

2021-03-13 Thread Yu Zhao
We want to make sure the rcu lock is held while using page_memcg_rcu(). But having a WARN_ON_ONCE() in page_memcg_rcu() when !CONFIG_MEMCG is superfluous because of the following legit use case: memcg = lock_page_memcg(page1) (rcu_read_lock() if CONFIG_MEMCG=y) do something to page1 if