From: zhiguojiang <justinjiang@vivo.com>
To: Matthew Wilcox <willy@infradead.org>
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: Wed, 11 Sep 2024 09:14:10 +0800 [thread overview]
Message-ID: <4a308d13-932a-494e-b116-12e442a6352d@vivo.com> (raw)
In-Reply-To: <ZuBtvW9TWCnHte4V@casper.infradead.org>
在 2024/9/11 0:03, Matthew Wilcox 写道:
> 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.
Ok, Is it necessary to add comments here to explain and avoid readers'
misunderstandings? E.g. 'Avoid 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);
>> }
Thanks
Zhiguo
next prev parent reply other threads:[~2024-09-11 1:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 14:39 Zhiguo Jiang
2024-09-10 16:03 ` Matthew Wilcox
2024-09-11 1:14 ` zhiguojiang [this message]
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=4a308d13-932a-494e-b116-12e442a6352d@vivo.com \
--to=justinjiang@vivo.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=opensource.kernel@vivo.com \
--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