+ mm-zswap-fix-the-lack-of-page-lru-flag-in-zswap_writeback_entry.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: zswap: fix the lack of page lru flag in zswap_writeback_entry
has been added to the -mm mm-unstable branch.  Its filename is
     mm-zswap-fix-the-lack-of-page-lru-flag-in-zswap_writeback_entry.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-zswap-fix-the-lack-of-page-lru-flag-in-zswap_writeback_entry.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Zhongkun He <hezhongkun.hzk@xxxxxxxxxxxxx>
Subject: mm: zswap: fix the lack of page lru flag in zswap_writeback_entry
Date: Tue, 24 Oct 2023 22:27:06 +0800

The zswap_writeback_entry() will add a page to the swap cache, decompress
the entry data into the page, and issue a bio write to write the page back
to the swap device.  Move the page to the tail of lru list through
SetPageReclaim(page) and folio_rotate_reclaimable().

Currently, about half of the pages will fail to move to the tail of lru
list because there is no LRU flag in page which is not in the LRU list but
the cpu_fbatches.  So fix it.

Link: https://lkml.kernel.org/r/20231024142706.195517-1-hezhongkun.hzk@xxxxxxxxxxxxx
Signed-off-by: Zhongkun He <hezhongkun.hzk@xxxxxxxxxxxxx>
Cc: Dan Streetman <ddstreet@xxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Nhat Pham <nphamcs@xxxxxxxxx>
Cc: Seth Jennings <sjenning@xxxxxxxxxx>
Cc: Vitaly Wool <vitaly.wool@xxxxxxxxxxxx>
Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/zswap.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/mm/zswap.c~mm-zswap-fix-the-lack-of-page-lru-flag-in-zswap_writeback_entry
+++ a/mm/zswap.c
@@ -1139,6 +1139,11 @@ static int zswap_writeback_entry(struct
 	/* move it to the tail of the inactive list after end_writeback */
 	SetPageReclaim(page);
 
+	if (!PageLRU(page)) {
+		/* drain lru cache to help folio_rotate_reclaimable() */
+		lru_add_drain();
+	}
+
 	/* start writeback */
 	__swap_writepage(page, &wbc);
 	put_page(page);
_

Patches currently in -mm which might be from hezhongkun.hzk@xxxxxxxxxxxxx are

mm-zswap-fix-the-lack-of-page-lru-flag-in-zswap_writeback_entry.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux