linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* a question of split_huge_page
@ 2020-07-09 15:11 Alex Shi
  2020-07-09 15:50 ` Matthew Wilcox
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Shi @ 2020-07-09 15:11 UTC (permalink / raw)
  To: Johannes Weiner, Kirill A. Shutemov, Matthew Wilcox, Linux-MM,
	linux-kernel, Hugh Dickins

Hi Kirill & Matthew,

In the func call chain, from split_huge_page() to lru_add_page_tail(),
Seems tail pages are added to lru list at line 963, but in this scenario
the head page has no lru bit and isn't set the bit later. Why we do this?
or do I miss sth?

Many Thanks
Alex


938 void lru_add_page_tail(struct page *page, struct page *page_tail,
 939                        struct lruvec *lruvec, struct list_head *list)
 940 {
 941         VM_BUG_ON_PAGE(!PageHead(page), page);
 942         VM_BUG_ON_PAGE(PageCompound(page_tail), page);
 943         VM_BUG_ON_PAGE(PageLRU(page_tail), page);
 944         lockdep_assert_held(&lruvec_pgdat(lruvec)->lru_lock);
 945
 946         if (!list)
 947                 SetPageLRU(page_tail);
 948
 949         if (likely(PageLRU(page)))
 950                 list_add_tail(&page_tail->lru, &page->lru);
 951         else if (list) {
 952                 /* page reclaim is reclaiming a huge page */
 953                 get_page(page_tail);
 954                 list_add_tail(&page_tail->lru, list);
 955         } else {
 956                 /*
 957                  * Head page has not yet been counted, as an hpage,
 958                  * so we must account for each subpage individually.
 959                  *
 960                  * Put page_tail on the list at the correct position
 961                  * so they all end up in order.
 962                  */
 963                 add_page_to_lru_list_tail(page_tail, lruvec,
 964                                           page_lru(page_tail));
 965         }
 966 }

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-10 17:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 15:11 a question of split_huge_page Alex Shi
2020-07-09 15:50 ` Matthew Wilcox
2020-07-09 16:07   ` Kirill A. Shutemov
2020-07-10  4:51     ` Alex Shi
2020-07-10  5:28       ` Mika Penttilä
2020-07-10  7:00         ` Alex Shi
2020-07-10  7:22           ` Mika Penttilä
2020-07-10  9:34         ` Alex Shi
2020-07-10 12:56           ` Joerg Roedel
2020-07-10 17:29           ` Yang Shi
2020-07-10 10:33       ` Kirill A. Shutemov
2020-07-10 14:23         ` Alex Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).