Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1398697pxv; Sat, 10 Jul 2021 03:10:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuI5HsVWIRt9KAaoO8RvBqYex6fgPjFm/mQDCdpHt9HCRWxZY/k835F6oFcSTNzXxQWKCW X-Received: by 2002:a05:6402:17d7:: with SMTP id s23mr22954554edy.305.1625911822316; Sat, 10 Jul 2021 03:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625911822; cv=none; d=google.com; s=arc-20160816; b=YtBlwJjmKTKFlK153UzTNZgA5FeWPKZezFUZy7czMFhsU/2K4zmLKCZCZkkaGHD7bO R6FTdzzqFkRvMj0N6OTgNneBSBKkHQ3UCzSA8TUsX1oNITzx9ZxMnFRm63JCFhsWMWid mO6NiMFTVa6ZHz6qPy6oulhbuxsFkTP44XoHBy1gx4RZLAcFjYxgHMH2NrYxckTZhvSx mo1P/l4mPmb7EbrqW07I7ENglyRyWcH9pPbgTY05EP41wyLxGKDoveTcoouh8ybiGRZS qNPeZ7Lw3XJO80xYQKhSEdFe4pTSynxE/GWzRvshvsdnVLJZDqY0EPj6wcyioP/5Se2F cKqQ== 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=KEmfGzdHULxKGCobxJ+gIglcquvJSB/GYpMWP5IKvuo=; b=ln1W4fe8S0BtPfJoBfuyB9790IHFSSY+hK3mPaOhKoZzMROj7Z7PIe0V4SxvHS7Gac PKrbTFxy46JDJkuFsEE0SaMsbPBzZk0F1YhEyZEsn9/5ZllI9bZGOKvqX73PcAeb5Lf3 01gBU4cHPIG7YtfaTOfYwnnbUsd8kJprPw+SWOMJdxICKOHtWmNSy7q9EUdvzgdokqyz Qzw1v4zDB1z8eBWEhlPfOzs4Rr7AwP8D+EX6ZxUsvZbCQoNSDro5cTrQ7qlJgLjf8BQs A38DsVcYwqVC9z28c5xVtJ19YEiRtTjswzCTZjP1fkezFTItM3chyzJNQKuXOcaXVusD QEcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz26si10322118ejc.747.2021.07.10.03.09.59; Sat, 10 Jul 2021 03:10:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbhGJKGS (ORCPT + 99 others); Sat, 10 Jul 2021 06:06:18 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:10464 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbhGJKGI (ORCPT ); Sat, 10 Jul 2021 06:06:08 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GMQWC5ClWzcbNn; Sat, 10 Jul 2021 18:00:07 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 10 Jul 2021 18:03:21 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , , Subject: [PATCH 5/5] mm/vmscan: fix misleading comment in isolate_lru_pages() Date: Sat, 10 Jul 2021 18:03:29 +0800 Message-ID: <20210710100329.49174-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210710100329.49174-1-linmiaohe@huawei.com> References: <20210710100329.49174-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: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We couldn't know whether the page is being freed elsewhere until we failed to increase the page count. Signed-off-by: Miaohe Lin --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a74760c48bd8..6e26b3c93242 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1891,7 +1891,6 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, */ scan += nr_pages; if (!__isolate_lru_page_prepare(page, mode)) { - /* It is being freed elsewhere */ list_move(&page->lru, src); continue; } @@ -1901,6 +1900,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, * page release code relies on it. */ if (unlikely(!get_page_unless_zero(page))) { + /* It is being freed elsewhere. */ list_move(&page->lru, src); continue; } -- 2.23.0