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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 53602C5519F for ; Sun, 22 Nov 2020 12:38:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 896E22080A for ; Sun, 22 Nov 2020 12:38:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QtJc18e2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 896E22080A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BA7586B006E; Sun, 22 Nov 2020 07:38:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B31216B0070; Sun, 22 Nov 2020 07:38:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1FFA6B0071; Sun, 22 Nov 2020 07:38:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 708936B006E for ; Sun, 22 Nov 2020 07:38:25 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EE4528249980 for ; Sun, 22 Nov 2020 12:38:24 +0000 (UTC) X-FDA: 77512007328.17.deer57_5c0658f2735c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id D430C180D0181 for ; Sun, 22 Nov 2020 12:38:24 +0000 (UTC) X-HE-Tag: deer57_5c0658f2735c X-Filterd-Recvd-Size: 3396 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Sun, 22 Nov 2020 12:38:22 +0000 (UTC) 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: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; > }