public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	David Hildenbrand <david@redhat.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: shmem: convert to use folio_zero_range()
Date: Thu, 17 Oct 2024 16:09:31 +0100	[thread overview]
Message-ID: <ZxEoq5ZvdHMoxELh@casper.infradead.org> (raw)
In-Reply-To: <20241017142504.1170208-2-wangkefeng.wang@huawei.com>

On Thu, Oct 17, 2024 at 10:25:04PM +0800, Kefeng Wang wrote:
> Directly use folio_zero_range() to cleanup code.

Are you sure there's no performance regression introduced by this?
clear_highpage() is often optimised in ways that we can't optimise for
a plain memset().  On the other hand, if the folio is large, maybe a
modern CPU will be able to do better than clear-one-page-at-a-time.

IOW, what performance testing have you done with this patch?

>  	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);
>  	}


  reply	other threads:[~2024-10-17 15:09 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 ` [PATCH] mm: shmem: convert to use folio_zero_range() Kefeng Wang
2024-10-17 15:09   ` Matthew Wilcox [this message]
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=ZxEoq5ZvdHMoxELh@casper.infradead.org \
    --to=willy@infradead.org \
    --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=wangkefeng.wang@huawei.com \
    /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