Skip to content

Commit

Permalink
mm/memcg: revise the using condition of lock_page_lruvec function series
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
alexshi authored and torvalds committed Feb 24, 2021
1 parent fff66b7 commit d7e3aba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit d7e3aba

Please sign in to comment.