From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27385C433F5 for ; Tue, 29 Mar 2022 13:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237472AbiC2NsO (ORCPT ); Tue, 29 Mar 2022 09:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbiC2NsM (ORCPT ); Tue, 29 Mar 2022 09:48:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17BB15B876 for ; Tue, 29 Mar 2022 06:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LVM8/zLJslUWU774mFRXpF4whJP7o7SpdBwBGDgrE1E=; b=NTLQHhm2OFEqgEMEBYH+PcPMYt uacVr5+r+x+zIlfd/uh4dKQ+dVufKKe0qCZkeslTfpiJEPpib1GntVGPQ2WJl2IMkI9WHTc0c8bJ2 WZDdzUHDUi247hYn1tV643r50aOvOOoU+G3w1pBilLTGtiAisv7amrYPbPbaASWQa5wjUVbePH0Tp 0rs0X+ziqnrScpOkSHH2KpWqPS1h3HekcJOvXACnVgcUsR1Ue4RCFMrCVlXiAiYSbZe1/091v7psK JDre4RlMNZTNsFgm1YqcBsfb0WTqgxzuGkQe25OgE0wpM9DlG8e03mqeyMSbcs8H8l62XxqIbrHwS dTL0RcKg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZCAt-000KG5-Og; Tue, 29 Mar 2022 13:46:19 +0000 Date: Tue, 29 Mar 2022 14:46:19 +0100 From: Matthew Wilcox To: Miaohe Lin Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] mm/vmscan: remove redundant folio_test_swapbacked check when folio is file lru Message-ID: References: <20220329132619.18689-1-linmiaohe@huawei.com> <20220329132619.18689-2-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220329132619.18689-2-linmiaohe@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 29, 2022 at 09:26:12PM +0800, Miaohe Lin wrote: > When folio is file lru, folio_test_swapbacked is guaranteed to be true. So > it's unnecessary to check it here again. No functional change intended. ummm ... is your logic right here? The condition is: if (!a || (b && !c)) I don't see how it follows that a => c means we can do any simplification at all. > Signed-off-by: Miaohe Lin > --- > mm/vmscan.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 1678802e03e7..7c1a9713bfc9 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1434,8 +1434,7 @@ static void folio_check_dirty_writeback(struct folio *folio, > * Anonymous pages are not handled by flushers and must be written > * from reclaim context. Do not stall reclaim based on them > */ > - if (!folio_is_file_lru(folio) || > - (folio_test_anon(folio) && !folio_test_swapbacked(folio))) { > + if (!folio_is_file_lru(folio) || folio_test_anon(folio)) { > *dirty = false; > *writeback = false; > return; > -- > 2.23.0 > >