Skip to content

Commit

Permalink
mm/page_reporting.c: drop stale list head check in page_reporting_cycle
Browse files Browse the repository at this point in the history
list_for_each_entry_safe() guarantees that we will never stumble over the
list head; "&page->lru != list" will always evaluate to true.  Let's
simplify.

[[email protected]: Changelog refinements]

Signed-off-by: Wei Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Alexander Duyck <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
weiyang-linux authored and torvalds committed Oct 16, 2020
1 parent c7df08f commit 58f6f03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/page_reporting.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone,
* the new head of the free list before we release the
* zone lock.
*/
if (&page->lru != list && !list_is_first(&page->lru, list))
if (!list_is_first(&page->lru, list))
list_rotate_to_front(&page->lru, list);

/* release lock before waiting on report processing */
Expand Down

0 comments on commit 58f6f03

Please sign in to comment.