aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shi <[email protected]>2021-02-24 12:03:47 -0800
committerLinus Torvalds <[email protected]>2021-02-24 13:38:29 -0800
commitd7e3aba583e6d13a81932597c5ee8da3c8b6af04 (patch)
treec47f75ec338254fe58aa5bdba3057792bc8ca115
parentfff66b79a19c9b3f2aa02b0a32fe598977c89eea (diff)
mm/memcg: revise the using condition of lock_page_lruvec function series
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! Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Alex Shi <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Vladimir Davydov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memcontrol.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f27e862a6845..2b13b2cf5dcb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1346,10 +1346,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)
{