linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] mm/memcg: revise the using condition of lock_page_lruvec function series
@ 2020-12-22  5:20 Alex Shi
  2020-12-22  5:20 ` [PATCH v2 2/3] mm/memcg: remove rcu locking for " Alex Shi
  2020-12-22  5:20 ` [PATCH v2 3/3] mm/compaction: remove rcu_read_lock during page compaction Alex Shi
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Shi @ 2020-12-22  5:20 UTC (permalink / raw)
  To: hughd
  Cc: Johannes Weiner, Michal Hocko, Vladimir Davydov, Andrew Morton,
	cgroups, linux-mm, linux-kernel

lock_page_lruvec() and its variants are safe to use under the same
conditions as commit_charge(): add lock_page_memcg() to the comment.

Polished with Hugh Dickins' suggestions, thanks!

Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: cgroups@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
 mm/memcontrol.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b80328f52fb4..8d400efc81b9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1345,10 +1345,11 @@ void lruvec_memcg_debug(struct lruvec *lruvec, struct page *page)
  * lock_page_lruvec - lock and return lruvec for a given page.
  * @page: the page
  *
- * This series functions should be used in either conditions:
- * PageLRU is cleared or unset
- * or page->_refcount is zero
- * or page is locked.
+ * These functions are safe to use under any of the following conditions:
+ * - page locked
+ * - PageLRU cleared
+ * - lock_page_memcg()
+ * - page->_refcount is zero
  */
 struct lruvec *lock_page_lruvec(struct page *page)
 {
-- 
2.29.GIT



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-22  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-22  5:20 [PATCH v2 1/3] mm/memcg: revise the using condition of lock_page_lruvec function series Alex Shi
2020-12-22  5:20 ` [PATCH v2 2/3] mm/memcg: remove rcu locking for " Alex Shi
2020-12-22  8:00   ` Alex Shi
2020-12-22  5:20 ` [PATCH v2 3/3] mm/compaction: remove rcu_read_lock during page compaction Alex Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).