mm/zswap: avoid unnecessary page scanning
Subsystems (2)
PATCH v2 3/4 mm/zswap: avoid unnecessary page scanning
add SetPageReclaim before __swap_writepage so that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before.
--- mm/zswap.c | 3 +++ 1 file changed, 3 insertions(+)
mm/zswap.c +3 -0
@@ -556,6 +556,9 @@ static int zswap_writeback_entry(struct zbud_pool *pool, unsigned long handle)SetPageUptodate (page); } +/* move it to the tail of the inactive list after end_writeback */ +SetPageReclaim (page); +/* start writeback */ __swap_writepage (page, &wbc, end_swap_bio_write);page_cache_release (page);
Signature · 8 lines
1.7.10.4 -- 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 5 lines · Weijie Yang
add SetPageReclaim before
__swap_writepageso that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before.Signed-off-by Weijie Yang <[email protected]>
Quoted 19 lines
--- mm/zswap.c | 3 +++ 1 file changed, 3 insertions(+)mm/zswap.c +3
-0@@ -556,6 +556,9 @@ static int zswap_writeback_entry(struct zbud_pool *pool, unsigned long handle)SetPageUptodate (page); } +/* move it to the tail of the inactive list after end_writeback */ +SetPageReclaim (page); +/* start writeback */ __swap_writepage (page, &wbc, end_swap_bio_write);page_cache_release (page);
Signature · 8 lines
Regards, -Bob -- 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 5 lines · Weijie Yang
add SetPageReclaim before
__swap_writepageso that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before.Signed-off-by Weijie Yang <[email protected]>
--
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 · Seth Jennings
Quoted 5 lines · Weijie Yang
add SetPageReclaim before
__swap_writepageso that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before.Signed-off-by Weijie Yang <[email protected]>Acked-by Seth Jennings <[email protected]>
Below is a reply from Mel in original thread "[PATCHv11 3/4] zswap: add to mm/"
------------------
Review
Quoted 6 lines
(quoted diff) +6
-0+ /* start writeback */ + SetPageReclaim(page); + __swap_writepage(page, &wbc, end_swap_bio_write); + page_cache_release(page); + zswap_written_back_pages++; +
SetPageReclaim? Why?. If the page is under writeback then why do you not mark it as that? Do not free pages that are currently under writeback obviously. It's likely that it was PageWriteback you wanted in zbud.c too.
--------------------
Signature · 8 lines
Regards, -Bob -- 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 22 lines · Bob Liu
Quoted 9 lines · Seth Jennings
Quoted 5 lines · Weijie Yang
add SetPageReclaim before
__swap_writepageso that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before.Signed-off-by Weijie Yang <[email protected]>Acked-by Seth Jennings <[email protected]>Below is a reply from Mel in original thread "[PATCHv11 3/4] zswap: add to
mm/"
------------------Review
Quoted 6 lines
(quoted diff) +6
-0+ /* start writeback */ + SetPageReclaim(page); + __swap_writepage(page, &wbc, end_swap_bio_write); + page_cache_release(page); + zswap_written_back_pages++; +
Quoted 4 lines
SetPageReclaim? Why?. If the page is under writeback then why do you not mark it as that? Do not free pages that are currently under writeback obviously. It's likely that it was PageWriteback you wanted in
zbud.ctoo.
--------------------
Thanks for reminding this.
The purpose of using this flag in PATCHv11 and this patch is different.
In PATCHv11, it was repurposed to protect zbud page against free, and now it is replaced with zhdr->under_reclaim.
In this patch, this flag is for its original purpose(to be reclaimed asap)
Quoted 3 lines
--
Regards,
-Bob
--
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>