From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>
Cc: David Hildenbrand <david@redhat.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Matthew Wilcox <willy@infradead.org>, <linux-mm@kvack.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH] mm: shmem: convert to use folio_zero_range()
Date: Thu, 17 Oct 2024 22:25:04 +0800 [thread overview]
Message-ID: <20241017142504.1170208-2-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20241017142504.1170208-1-wangkefeng.wang@huawei.com>
Directly use folio_zero_range() to cleanup code.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/shmem.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index bd5ba016567d..247c0403af83 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2392,11 +2392,7 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,
* it now, lest undo on failure cancel our earlier guarantee.
*/
if (sgp != SGP_WRITE && !folio_test_uptodate(folio)) {
- long i, n = folio_nr_pages(folio);
-
- for (i = 0; i < n; i++)
- clear_highpage(folio_page(folio, i));
- flush_dcache_folio(folio);
+ folio_zero_range(folio, 0, folio_size(folio));
folio_mark_uptodate(folio);
}
--
2.27.0
next prev parent reply other threads:[~2024-10-17 14:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 14:25 [PATCH] mm: shmem: avoid repeated flush dcache in shmem_writepage() Kefeng Wang
2024-10-17 14:25 ` Kefeng Wang [this message]
2024-10-17 15:09 ` [PATCH] mm: shmem: convert to use folio_zero_range() Matthew Wilcox
2024-10-18 5:20 ` Kefeng Wang
2024-10-18 5:23 ` Barry Song
2024-10-18 7:32 ` Kefeng Wang
2024-10-18 7:47 ` Kefeng Wang
2024-10-21 4:15 ` Barry Song
2024-10-21 5:16 ` Kefeng Wang
2024-10-21 5:38 ` Barry Song
2024-10-21 6:09 ` Kefeng Wang
2024-10-21 7:47 ` Barry Song
2024-10-21 7:55 ` Barry Song
2024-10-21 8:14 ` Kefeng Wang
2024-10-21 9:17 ` Barry Song
2024-10-21 15:33 ` Kefeng Wang
2024-10-21 20:32 ` Barry Song
2024-10-22 15:10 ` Kefeng Wang
2024-10-22 22:56 ` Barry Song
2024-10-24 10:10 ` Kefeng Wang
2024-10-25 2:59 ` Huang, Ying
2024-10-25 7:42 ` Kefeng Wang
2024-10-25 7:47 ` Huang, Ying
2024-10-25 10:21 ` Kefeng Wang
2024-10-25 12:21 ` Huang, Ying
2024-10-25 13:35 ` Kefeng Wang
2024-10-28 2:39 ` Huang, Ying
2024-10-28 6:37 ` Kefeng Wang
2024-10-28 11:41 ` Kefeng Wang
2024-10-30 1:26 ` Huang, Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241017142504.1170208-2-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox