[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240209142901.126894-6-da.gomez@samsung.com>
Date: Fri, 9 Feb 2024 14:29:03 +0000
From: Daniel Gomez <da.gomez@...sung.com>
To: "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"brauner@...nel.org" <brauner@...nel.org>, "jack@...e.cz" <jack@...e.cz>,
"hughd@...gle.com" <hughd@...gle.com>, "akpm@...ux-foundation.org"
<akpm@...ux-foundation.org>
CC: "dagmcr@...il.com" <dagmcr@...il.com>, "linux-fsdevel@...r.kernel.org"
<linux-fsdevel@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"willy@...radead.org" <willy@...radead.org>, "hch@...radead.org"
<hch@...radead.org>, "mcgrof@...nel.org" <mcgrof@...nel.org>, Pankaj Raghav
<p.raghav@...sung.com>, "gost.dev@...sung.com" <gost.dev@...sung.com>,
"Daniel Gomez" <da.gomez@...sung.com>
Subject: [RFC PATCH 5/9] shmem: clear_highpage() if block is not uptodate
clear_highpage() is called for all the subpages (blocks) in a large
folio when the folio is not uptodate. Do clear the subpages only when
they are not uptodate.
Signed-off-by: Daniel Gomez <da.gomez@...sung.com>
---
mm/shmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 614cda767298..b6f9a60b179b 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2253,7 +2253,8 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,
long i, n = folio_nr_pages(folio);
for (i = 0; i < n; i++)
- clear_highpage(folio_page(folio, i));
+ if (!shmem_is_block_uptodate(folio, i))
+ clear_highpage(folio_page(folio, i));
flush_dcache_folio(folio);
shmem_set_range_uptodate(folio, 0, folio_size(folio));
}
--
2.43.0
Powered by blists - more mailing lists