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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC860C433EF for ; Tue, 29 Mar 2022 02:23:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A16A8D0002; Mon, 28 Mar 2022 22:23:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4274E8D0001; Mon, 28 Mar 2022 22:23:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C86D8D0002; Mon, 28 Mar 2022 22:23:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 17FBB8D0001 for ; Mon, 28 Mar 2022 22:23:01 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BEF5A8249980 for ; Tue, 29 Mar 2022 02:23:00 +0000 (UTC) X-FDA: 79295826120.23.699AC2F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 98E3C40004 for ; Tue, 29 Mar 2022 02:22:59 +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=HNgSyPoGUj80vPzBlsxCechK1rmOwMq8hDhkmhfmcvc=; b=Hi098owmI1hCJhuPxfqhVEymK9 cTrdD2fZMhd+pD53YJP+q9km4hEBipm1lpf1MTLL/O7QVayJGONlWRJl0SEexALt+ATU5TOUBwFfl X0GgSgjTr3cJk0iIMfhZnz36/JNw8w8J9fGEIYTrafLp1tj+owZS4e/vbUEHWnIRBwqnZxEWVVN6P qCZ3P3Rli3wngH/U4msBfyWz9QEjkhBOcWZLmSExB5Axrsz7/trM5KBy2oHaGX96c94bBRRedW2dS Ag6xV+I558CBRg1FDpfvo2UtHZW7pWj77cmT49Tu216DadfX3/5riUvhT9v4M6BB1kFvm1EYCH75t hBgovl5Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZ1VT-00HTZg-Ct; Tue, 29 Mar 2022 02:22:51 +0000 Date: Tue, 29 Mar 2022 03:22:51 +0100 From: Matthew Wilcox To: Wei Yang Cc: "Huang, Ying" , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mgorman@techsingularity.net Subject: Re: [PATCH 2/2] mm/vmscan: make sure wakeup_kswapd with managed zone Message-ID: References: <20220327024101.10378-1-richard.weiyang@gmail.com> <20220327024101.10378-2-richard.weiyang@gmail.com> <8735j2opd9.fsf@yhuang6-desk2.ccr.corp.intel.com> <20220329004146.2xdswvrm2qu7f47x@master> <875ynxh9lg.fsf@yhuang6-desk2.ccr.corp.intel.com> <20220329015230.hneciyfxoxtvfytl@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220329015230.hneciyfxoxtvfytl@master> X-Stat-Signature: 6tiw6xqjj46awsythf376h19iscrfuit Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hi098owm; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 98E3C40004 X-HE-Tag: 1648520579-753601 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 Tue, Mar 29, 2022 at 01:52:30AM +0000, Wei Yang wrote: > @@ -1985,14 +1985,13 @@ static bool migrate_balanced_pgdat(struct pglist_data *pgdat, > continue; > > /* Avoid waking kswapd by allocating pages_to_migrate pages. */ > - if (!zone_watermark_ok(zone, 0, > + if (zone_watermark_ok(zone, 0, > high_wmark_pages(zone) + > nr_migrate_pages, > ZONE_MOVABLE, 0)) Someone's done the silly thing of lining up all of these with spaces, so either all these lines also need to be shrunk by one space, or you need to break that convention and just go to a reasonable number of tabs. I'd do it like this: if (zone_watermark_ok(zone, 0, high_wmark_pages(zone) + nr_migrate_pages, ZONE_MOVABLE, 0)) but not everybody would. > @@ -2040,16 +2040,11 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) > return 0; > > /* Avoid migrating to a node that is nearly full */ > - if (!migrate_balanced_pgdat(pgdat, nr_pages)) { > - int z; > - > + if ((zone = migrate_balanced_pgdat(pgdat, nr_pages))) { Linus had a rant about this style recently. He much prefers: zone = migrate_balanced_pgdat(pgdat, nr_pages); if (zone) { (the exception is for while loops: while ((zone = migrate_balanced_pgdat(pgdat, nr_pages)) != NULL) where he wants to see the comparison against NULL instead of the awkard double-bracket)