Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2163875pxb; Wed, 30 Mar 2022 18:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVlJho4lyInEae0X/fGo3UXW7fF9EqEmXLhEMAx3dM4VXuZ21ULZULMBOXD3CjQsPcVoe2 X-Received: by 2002:a17:902:e84b:b0:154:6222:98ae with SMTP id t11-20020a170902e84b00b00154622298aemr2635908plg.137.1648688960178; Wed, 30 Mar 2022 18:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648688960; cv=none; d=google.com; s=arc-20160816; b=FkbIixXhj1Tj5LEIUpeOKjtrAZBs+V2MfCXSNlwkXdArmAQWJvEVdF39W7EHlqTqHf npmTP7gfoc+mooXYiKym7y2Oy3iGxreFVhrHoOgvpStUZ6qUwYDK6nvaTtoAw1Z/jvR1 oY6f2THGwsWhANv/tfFHF7l4uIzh2LzbpcG+imbry/XgAEB8j7TyYBt1XIRgtAnbTjVO HOwUPrAfiqcmKwdTlSyk9qwjQP4RJHNV+qtwUqdrzdlPo9Xc46jNA3gKcqhvjmlB4wX0 u4Q+ji1I0vf/gICLDeOUWeoKndUu2/kiOCKggZDWqF9Phwth8gpgoKHdWQwNQX/qTkLG z73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mbCzJfln3VqMM3D8LXGLhg65sP9l5FOJf1oTlsWIEkc=; b=eiMJConw27w3/zdGXowKoS4El+sixhMW+9f5yyUEe/aqi18bdh9Jjorgt9DT40Vuvb qO1G2OqnzVvSdAHJh6Aq38vm9t+4lTmjOsWmULpriTZSKj8itYf71lGX295YRgnefQK7 7XLIIGZX2mg1D74WRNBU1FZDUyfLp3xjBO1MyZnEvRlfflQ1Ll1j7mI7Vg0VYaeWlafW yujVUhg5T4kFwVUQ765yj1TmykXmhsrEYKqLGFIsVNEchKJ9BMk47ZfACtj4OoUHb99o SG5DoQnG83W4Eclm+fcbZYffJE6pVKB9WHNSwu785rxT2nfvomBGJ/hXfupXSa2twITk M9rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UxK9BwFd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a62e80f000000b004faa21eb5dasi21155982pfi.244.2022.03.30.18.09.05; Wed, 30 Mar 2022 18:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UxK9BwFd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241295AbiC3AAs (ORCPT + 99 others); Tue, 29 Mar 2022 20:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241298AbiC3AAq (ORCPT ); Tue, 29 Mar 2022 20:00:46 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62E211A824 for ; Tue, 29 Mar 2022 16:59:03 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id yy13so38265459ejb.2 for ; Tue, 29 Mar 2022 16:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mbCzJfln3VqMM3D8LXGLhg65sP9l5FOJf1oTlsWIEkc=; b=UxK9BwFdx+NtfkRowsHUY2uy2BdczHjejvZGksCdFIqMauZ6RAecwBRXXfSqYbinuH uhmw/4W4mpStLdpF2rw8s9GhpFzipietHCq7CJ1a3b2CXLD4AFjSV6z7VYnKVb1SqiVC BZo7ZffpZG5A6WKqwBfDFYeJmMA/t9IwFulJ2mLen7c+ihvtxChCFusK0u6GZaaGW/b/ Qecrq9pMx46kvD+Xw3zdV9QcCWFCOv1ZgVqyRj+qgC1Odwgw6ydIjaWggOSjgNHqbgKw 0HEMGyfpnWOhBiT/BGCntZgxlH6Tob+k1gi3FM+vzS8r/0PPOxhF4tbQoGRFscHOWjs+ DTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=mbCzJfln3VqMM3D8LXGLhg65sP9l5FOJf1oTlsWIEkc=; b=DOAoOdclwP97dT1A5WBynTHlQSVnVJqoWK77JGwdMvMrhUbUEfE+vowZZ5WidS2MVp pmlTySCBoMIC+a1upzZqv17rf3jbxeX2JE1211wLVGCA+nDxIh8JBzvFU8d6AipUa/uh dlIPhlJLmO0YEV1o+o3g2vYxSa8BV6jqGFKdbwowFuhbYlfVfJRkymYW7SwCNeOWNHeD O5qURrIZZZvUkYTfVCeA5+Onaz83mEDuR5herdBlP0JG3uG0QRT7J5Alc13hxoL642O5 jvK8DBaHq4Ga+ssMtmgE5+KFfGlQ52UJ+8Ht6WEqhf3Fw0h/XebEacOp1CNT+bAqahYT mMDQ== X-Gm-Message-State: AOAM531qaOkRWuFWQK/9RzKpRURhWHCTmBcsmyfDqOiQGL/yE4DfEe8e 3U9ARmAzBdMxj+I8g3o2w/8= X-Received: by 2002:a17:907:c06:b0:6e0:9149:8047 with SMTP id ga6-20020a1709070c0600b006e091498047mr6064002ejc.765.1648598341805; Tue, 29 Mar 2022 16:59:01 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id r29-20020a50c01d000000b00415fb0dc793sm9206295edb.47.2022.03.29.16.59.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Mar 2022 16:59:01 -0700 (PDT) Date: Tue, 29 Mar 2022 23:59:00 +0000 From: Wei Yang To: Matthew Wilcox Cc: Wei Yang , "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: <20220329235900.3slpqbgjqgjv4y2e@master> Reply-To: Wei Yang 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: User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 29, 2022 at 03:22:51AM +0100, Matthew Wilcox wrote: >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) Matthew, Thanks for your suggestion, I would change this later. -- Wei Yang Help you, Help me