Skip to contentSkip to conversation

mm/zswap: avoid unnecessary page scanning

PATCH In review Weijie Yang 3 participants 4 messages Sep 23, 2013 – Oct 11, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 3/3 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
index 1be7b90..cc40e6a 100644
@@ -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 · 1 line
1.7.10.4
Reviewed-by on v3 3/3
#1 lore raw
Quoted 9 lines · Weijie Yang

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.

Signature · 8 lines
Kind regards,
Minchan Kim

--
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>
maintainer
#2 lore raw
In reply to Weijie Yang
Quoted 9 lines · On Mon, 23 Sep 2013 16:21:49 +0800 Weijie Yang <[email protected]> wrote:

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.

As a minor(?) performance tweak, I don't believe this is suitable for -stable backporting, so I took that out. If you believe this was a mistake, please explain why.

#3 lore raw
Quoted 12 lines · Andrew Morton
Quoted 9 lines · On Mon, 23 Sep 2013 16:21:49 +0800 Weijie Yang <[email protected]> wrote:

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.

Quoted 4 lines

As a minor(?) performance tweak, I don't believe this is suitable for -stable backporting, so I took that out. If you believe this was a mistake, please explain why.

Yes. It's never stable stuff.

Signature · 2 lines
Kind regards,
Minchan Kim