diff options
author | Alex Shi <alex.shi@linux.alibaba.com> | 2021-02-24 23:03:47 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-25 00:38:29 +0300 |
commit | d7e3aba583e6d13a81932597c5ee8da3c8b6af04 (patch) | |
tree | c47f75ec338254fe58aa5bdba3057792bc8ca115 /mm | |
parent | fff66b79a19c9b3f2aa02b0a32fe598977c89eea (diff) | |
download | linux-d7e3aba583e6d13a81932597c5ee8da3c8b6af04.tar.xz |
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 <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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 9 |
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) { |