linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Peng Zhang <zhangpeng362@huawei.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	wangkefeng.wang@huawei.com, sunnanyong@huawei.com
Subject: Re: [PATCH] mm/secretmem: use a folio in secretmem_fault()
Date: Sat, 12 Aug 2023 04:53:54 +0100	[thread overview]
Message-ID: <ZNcCUsK1z/iPSa8f@casper.infradead.org> (raw)
In-Reply-To: <20230812015835.3041694-1-zhangpeng362@huawei.com>

On Sat, Aug 12, 2023 at 09:58:35AM +0800, Peng Zhang wrote:
> From: ZhangPeng <zhangpeng362@huawei.com>
> 
> Saves three implicit call to compound_head().

I count four!

>  		if (err) {
> -			put_page(page);
> +			folio_put(folio);
>  			ret = vmf_error(err);

One.

>  
> -		__SetPageUptodate(page);
> -		err = add_to_page_cache_lru(page, mapping, offset, gfp);
> +		__folio_mark_uptodate(folio);
> +		err = filemap_add_folio(mapping, folio, offset, gfp);

Two, three.

>  		if (unlikely(err)) {
> -			put_page(page);
> +			folio_put(folio);

Four!

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>


  reply	other threads:[~2023-08-12  3:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12  1:58 Peng Zhang
2023-08-12  3:53 ` Matthew Wilcox [this message]
2023-08-12  6:24   ` zhangpeng (AS)

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=ZNcCUsK1z/iPSa8f@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=sunnanyong@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=zhangpeng362@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