Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp186275pxu; Sun, 22 Nov 2020 04:42:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX2Au19HR6+6jAmMnpzF+9w97TbtGK9aaVRGsnKSQ5UFe0YZPNV+BOtjgxIOR2xG2kDZ2t X-Received: by 2002:a17:906:3953:: with SMTP id g19mr27270981eje.151.1606048921828; Sun, 22 Nov 2020 04:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606048921; cv=none; d=google.com; s=arc-20160816; b=xiquF/lucUGryxDhc2EHutOIZUTBaxyN2VTKRRJvDvl9bfX859Kv9OJjKgtVXmeI3s ec/SSH79EFKLpXVFm6QC5Txfn6o+P9LnCFGmGqjxfvBgI21xb7FgKSiTpWLXfwgBrQaS JooBn6VGASiTJunSooxAGtZkUX8e3reNtcoM3KL+2G8WRfY33w/W2REsDn6uOXKrIPJn R6FrK6vaTdE4LdzrXDvd3jXnaiaXorZEc+oclkXjSu2iPAZPpz2rHmHlQWkZEKh3yFMt z4j5AHaaLZudjy4qGX4uJB2TJ882TcyWaJbIwTTo8d993hA8HtFs01i3v2oV4qTHkKKt kNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5mvrRco+6zDGbq0cuOCU8qWHo3zdUAHcOoBWofVG+/0=; b=i1pYVq/aoYa0NHbw70uyiWUdSjt6hmSlV+YFg3Y9CXOJGyS7FOuJwchZ63iBCx3vho GNRldQoxDlyAjeK/zCRopBDuw63vKIvXP0X3bWKIRKRIWNmd3zHsxbyKCxsbmVHdjTbM sRbfFTfBVW7XYaT1WP/VVqYNpPj0HPpJa5OLB/KKz3V3/8iK01hRBqdRdPQMSI4QVBsH DxGlh2BfSA672UEdfa8frakVyfsJMKnSRe1o64tK23EUHKk6nLut3sIsdi3z+ZQfYdbU p8XV1Jr1/sM2zp+6drGpysPFyUhaAWfYiviRcpcO+hl7R6/OGCQdp0sXjlFnVIbf/wh4 lVWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QtJc18e2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id go10si5356335ejc.656.2020.11.22.04.41.39; Sun, 22 Nov 2020 04:42:01 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QtJc18e2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727766AbgKVMi3 (ORCPT + 99 others); Sun, 22 Nov 2020 07:38:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727424AbgKVMi1 (ORCPT ); Sun, 22 Nov 2020 07:38:27 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79704C0613CF for ; Sun, 22 Nov 2020 04:38:27 -0800 (PST) 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=5mvrRco+6zDGbq0cuOCU8qWHo3zdUAHcOoBWofVG+/0=; b=QtJc18e2apC1W/CyNfkvR0zpEP Fw/0fegddaFknahWzsUFAeu9F2rAzuiR3z1/uknYKyZjUH+nIuerKGiSvfPSGByafKI4sL8ZeUEWa N7U1feR2h05JO4TUetarLx8/qL2jmGWlwSRMMqQSkMDjJaovi2n5r9av3X/mInUSnkNsKyrQxoX8b /iI2xFjhJKXo7HTPY9pUgt5t2kmjWOZxVwnfp+Mx9sVsTLmywRJo8dlfLAvZcYQwIvXrCVn1Mwl29 fVpqpghkhf3iFzbYFkkwE7UZXg1RSe7q+GjVc2K/SQ+DE88uwbyg944g3u3xM8KE34kgFwxOGWyLp 6tCYilaA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgoau-0001qG-HR; Sun, 22 Nov 2020 12:35:52 +0000 Date: Sun, 22 Nov 2020 12:35:52 +0000 From: Matthew Wilcox To: Alex Shi Cc: Andrew Morton , Hugh Dickins , Yu Zhao , Vlastimil Babka , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH next] mm/vmscan: __isolate_lru_page_prepare clean up Message-ID: <20201122123552.GF4327@casper.infradead.org> References: <1605859413-53864-1-git-send-email-alex.shi@linux.alibaba.com> <20201120151307.4d9e3ef092ba01a325db7ce2@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 22, 2020 at 08:00:19PM +0800, Alex Shi wrote: > mm/compaction.c | 2 +- > mm/vmscan.c | 69 +++++++++++++++++++++++-------------------------- > 2 files changed, 34 insertions(+), 37 deletions(-) How is it possible you're changing the signature of a function without touching a header file? Surely __isolate_lru_page_prepare() must be declared in mm/internal.h ? > +++ b/mm/vmscan.c > @@ -1536,19 +1536,17 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone, > * page: page to consider > * mode: one of the LRU isolation modes defined above > * > - * returns 0 on success, -ve errno on failure. > + * returns ture on success, false on failure. "true". > @@ -1674,35 +1672,34 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, > * only when the page is being freed somewhere else. > */ > scan += nr_pages; > - switch (__isolate_lru_page_prepare(page, mode)) { > - case 0: > + if (!__isolate_lru_page_prepare(page, mode)) { > + /* else it is being freed elsewhere */ I don't think the word "else" helps here. Just /* It is being freed elsewhere */ > + if (!TestClearPageLRU(page)) { > /* > + * This page may in other isolation path, > + * but we still hold lru_lock. > */ I don't think this comment helps me understand what's going on here. Maybe: /* Another thread is already isolating this page */ > + put_page(page); > list_move(&page->lru, src); > + continue; > }