Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp583679pxr; Mon, 11 Apr 2022 01:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMpiD2WzxHnB0JMHH3AXAZz19WkcIaxX6NNCwikUNUCe+PJLbk6b5GwHl11PnKtXAYw9YS X-Received: by 2002:a17:902:cf0d:b0:156:1cc:f08f with SMTP id i13-20020a170902cf0d00b0015601ccf08fmr31071824plg.42.1649666227116; Mon, 11 Apr 2022 01:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649666227; cv=none; d=google.com; s=arc-20160816; b=ddVgelsztuk4ByR3VqGelAiVTztvUkpA/iCVcYFZyMF2yPDdZwYWzqPCPqWgnVYHix o/+N0imznTh3+p+L8hxYArziAfNZv4F7Iz2EEtqsg3CJCpD8vb6vupJJbR+h8JMAR2I6 uB0bS9TbnFYoBFRvVyInLt4nLs3xuYJkiGOyoYalIISr69p599MHpvQc+GHPBhqeTxkQ vTdTv5nK6DOYbiIgYhawP6KDtoKbYV6o/nvoi5CkDeidKki6zGWljj8a18ncPuh5HzRM BjqB76x3B90WH+rhjOLQ4D4RqEuXZKiHFcYrlAAYwruqOYaYSogKFXuQxu9t6P41wLVV H1XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dlEi16P79nYC5loA+0XlQ19A+EN5MtXiJJ6ISOMA3a8=; b=tRFgnYqjqSkQL31nfkAk1iwCEWVfQDz52C0oygBbsOvAnucafk310xmM36BvHj5eYj GyP2Rk1GUEtqpI7fAp0KYy2PcHC2bXhe2fYZ0mhDdEjix7kizNKpTPHXs63xunaLqwj/ dn2Eht9H596ffIEc0kYFzwDXPokA97fV5mYe/r1/fJR26hRxeQMmsE+FTifjGyTNRJci YcOHmLB5zugudoDeD2iDs5UavevNbi6qKPCJVvjT6Hcb5LEGI4HAJRY9di3PuGx9HstE ct/PD4wZq6wu0QOJmh9lWnDcXTt0Jynmy9JQGmmBI2JbUg9d7UcXq7PTR06UvV30jm0w 505w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g189-20020a636bc6000000b0039d678a64e2si1672645pgc.232.2022.04.11.01.36.53; Mon, 11 Apr 2022 01:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241174AbiDIJgj (ORCPT + 99 others); Sat, 9 Apr 2022 05:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239444AbiDIJgh (ORCPT ); Sat, 9 Apr 2022 05:36:37 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E4443B2BF for ; Sat, 9 Apr 2022 02:34:31 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kb9131qk9z1HBPl; Sat, 9 Apr 2022 17:33:59 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 9 Apr 2022 17:34:29 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH v2 1/9] mm/vmscan: add a comment about MADV_FREE pages check in folio_check_dirty_writeback Date: Sat, 9 Apr 2022 17:34:52 +0800 Message-ID: <20220409093500.10329-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220409093500.10329-1-linmiaohe@huawei.com> References: <20220409093500.10329-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MADV_FREE pages check in folio_check_dirty_writeback is a bit hard to follow. Add a comment to make the code clear. Suggested-by: Huang, Ying Signed-off-by: Miaohe Lin --- mm/vmscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index c77d5052f230..4a76be47bed1 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1436,6 +1436,9 @@ 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 + * MADV_FREE anonymous pages are put into inactive file list too. + * They could be mistakenly treated as file lru. So further anon + * test is needed. */ if (!folio_is_file_lru(folio) || (folio_test_anon(folio) && !folio_test_swapbacked(folio))) { -- 2.23.0