[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a308d13-932a-494e-b116-12e442a6352d@vivo.com>
Date: Wed, 11 Sep 2024 09:14:10 +0800
From: zhiguojiang <justinjiang@...o.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [PATCH] mm: remove redundant if overhead
在 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
Powered by blists - more mailing lists