mm, THP, swap: Delay splitting THP during swap out
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Review int add_to_swap(struct page *page, struct list_head *list) · line 230
Quoted 12 lines
(quoted diff) +7
-0@@ -187,6 +221,14 @@ int add_to_swap(struct page *page, struct list_head *list) VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(!PageUptodate(page), page); + if (unlikely(PageTransHuge(page))) { + err = add_to_swap_trans_huge(page, list); + if (err < 0) + return 0; + else if (err > 0) + return err; + /* fallback to split firstly if return 0 */
switch (err) and add vm event count according to the meaning of err?
Review int add_to_swap(struct page *page, struct list_head *list) · line 231
Quoted 1 line
(quoted diff) +1
-0+ }
thanks
Hillf
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Hi, Hill,
Thanks for comments!
Quoted 5 lines · Hillf Danton
Quoted 5 lines
(quoted diff) +0
-0@@ -187,6 +221,14 @@ int add_to_swap(struct page *page, struct list_head *list) VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(!PageUptodate(page), page);
Quoted 9 lines
Review int add_to_swap(struct page *page, struct list_head *list) · line 230
Quoted 7 lines
(quoted diff) +7
-0+ if (unlikely(PageTransHuge(page))) { + err = add_to_swap_trans_huge(page, list); + if (err < 0) + return 0; + else if (err > 0) + return err; + /* fallback to split firstly if return 0 */switch (err) and add vm event count according to the meaning of err?
Yes. switch(err) looks better, I will change it.
For vm event, I found for now there are only two vm event for swap:
PSWPIN and PSWPOUT. There are counted when page and read from or write to the block device. So I think we have no existing vm event to count here.
Best Regards,
Huang, Ying
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Ying
For vm event, I found for now there are only two vm event for swap:
PSWPIN and PSWPOUT. There are counted when page and read from or write to the block device. So I think we have no existing vm event to count here.
I think the point still stands that we should ensure that we have proper instrumentation to see when huge swap is being used and if/how pages are being split during the process.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Dave Hansen
Quoted 4 lines · Ying
For vm event, I found for now there are only two vm event for swap:
PSWPIN and PSWPOUT. There are counted when page and read from or write to the block device. So I think we have no existing vm event to count here.I think the point still stands that we should ensure that we have proper instrumentation to see when huge swap is being used and if/how pages are being split during the process.
Sounds reasonable to me. I think we can count the event that a huge swap entry is allocated and put into swap cache successfully, say THP_SWPCACHE. I am not good at naming, so feel free to suggest a better name.
And this patchset is just the first step of THP swap support. In the near future, the THP splitting during swapping out could be further delayed after writing the THP to the block device. At that time, we will have a THP_SWPOUT vm event for THP swapping out. Then the THP_SWPCACHE event may appear unnecessary? If so, we add the event now and remove it at that time?
Best Regards,
Huang, Ying
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>