Linux filesystem development
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Zhiguo Jiang <justinjiang@vivo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH] mm: remove redundant if overhead
Date: Tue, 10 Sep 2024 17:03:09 +0100	[thread overview]
Message-ID: <ZuBtvW9TWCnHte4V@casper.infradead.org> (raw)
In-Reply-To: <20240910143945.1123-1-justinjiang@vivo.com>

On Tue, Sep 10, 2024 at 10:39:45PM +0800, Zhiguo Jiang wrote:
> Remove redundant if judgment overhead.

It's not redundant; it avoids dirtying the cacheline if the folio
is already marked as dirty.

>  bool noop_dirty_folio(struct address_space *mapping, struct folio *folio)
>  {
> -	if (!folio_test_dirty(folio))
> -		return !folio_test_set_dirty(folio);
> -	return false;
> +	return !folio_test_set_dirty(folio);
>  }

  reply	other threads:[~2024-09-10 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 14:39 [PATCH] mm: remove redundant if overhead Zhiguo Jiang
2024-09-10 16:03 ` Matthew Wilcox [this message]
2024-09-11  1:14   ` zhiguojiang
2024-09-11  1:34     ` Matthew Wilcox

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=ZuBtvW9TWCnHte4V@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=justinjiang@vivo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=opensource.kernel@vivo.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