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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC795C07E9C for ; Mon, 12 Jul 2021 08:09:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CFD86193A for ; Mon, 12 Jul 2021 08:09:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344725AbhGLILw (ORCPT ); Mon, 12 Jul 2021 04:11:52 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:34020 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346856AbhGLHbK (ORCPT ); Mon, 12 Jul 2021 03:31:10 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1CE101FF47; Mon, 12 Jul 2021 07:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1626074902; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GsR+/kf2MQIKkT4AEOPSXhgaTzxJXolcASGv+64IaZE=; b=qYasrGN+M6vKCQgO5rEVQBAy7nJOyNX9lj1oOpP+05lX43oLlldaxRrhw9Ya7bmCVq/M5v Mwjn0JomVMxNyZsNm3j4eMpVZdr4L/5M+4pl/k2ni44DeZtFziXBO1r6gSeKv+oMxurUYt bk5Il6CrvsJIl52nan2ZuBnnvd5OALI= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id DE557A4725; Mon, 12 Jul 2021 07:28:21 +0000 (UTC) Date: Mon, 12 Jul 2021 09:28:21 +0200 From: Michal Hocko To: Miaohe Lin Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, vbabka@suse.cz, axboe@kernel.dk, iamjoonsoo.kim@lge.com, alexs@kernel.org, apopple@nvidia.com, willy@infradead.org, minchan@kernel.org, david@redhat.com, shli@fb.com, hillf.zj@alibaba-inc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] mm/vmscan: fix misleading comment in isolate_lru_pages() Message-ID: References: <20210710100329.49174-1-linmiaohe@huawei.com> <20210710100329.49174-6-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210710100329.49174-6-linmiaohe@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 10-07-21 18:03:29, Miaohe Lin wrote: > We couldn't know whether the page is being freed elsewhere until we failed > to increase the page count. This is moving a hard to understand comment from one place to another. If anything this would benefit from what that elsewhere might be typically or simply drop the comment altogether. > > 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 -- Michal Hocko SUSE Labs