From: Alex Shi Date: Thu, 31 Dec 2020 22:04:07 +0000 (+0000) Subject: mm/memcg: revise the using condition of lock_page_lruvec function series X-Git-Tag: howlett/maple_spf/20210104~163 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=de3dc4b7861cf1b86df58884501b8f320b62235c;p=users%2Fjedix%2Flinux-maple.git 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/1608614453-10739-1-git-send-email-alex.shi@linux.alibaba.com Signed-off-by: Alex Shi Acked-by: Hugh Dickins Cc: Hugh Dickins Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Signed-off-by: Andrew Morton --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2eefa7539976..1b8decffc5f6 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) {