Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp180004ybt; Tue, 30 Jun 2020 17:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYX/2F7M3DZ4ReQKB2huBrAHr5ReP65/yLvk99XDZaXQONA1IaVG7AkGoJ+9EpQjl+JiTk X-Received: by 2002:a17:906:7387:: with SMTP id f7mr5430506ejl.131.1593564634006; Tue, 30 Jun 2020 17:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593564634; cv=none; d=google.com; s=arc-20160816; b=jYE1cT9rnaDGz51NHc6dhvKs78RDvSa/cp8/1mwByz9PSUpOKaamUlxMksiP1usTNu /K4r6XP1uRRtdnrAJw/5cn2zUmhFOstlcv+pANG5yuwd3483GYnw9ucCMzJJPZMi24vS nNRHXRdFIyiC+R9N3D2f8lLL13W2YH2/3YdjAO7a4rlfqIrNZhTgp4MQt4MSZ6DwcYV/ HTAfWmdfYjxCyKsdpbAgcVVw0IksbF5rbms6PQplJmrb8DelcYZjYI8rynJEJvq1JIdj NFZkiU/INvmgfDwPZoCHoloPETI5FAidIrVlLk3J0S9O/smxOj3s6/339RjCtyb48qSc OwnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=6okXsSHwfzXWIKYBv0zV156GGgVey9xnTu8+2YmEwwA=; b=jI1YKGhvZA5tJkmROVZzIOdQqw5i+HH23R/ELkK+0NiPY2pUzX5S6yPIzXKq+ZvbLT SODlb74X+aOEkoz8vAQMVGHHp2Gv1upHfbosnEFduxVZkVDLXwK15WwB8tUnJbMVnQO8 SSuIepLPxf7osABI16iJ+HqOYySDRkX3gzA04FmXLPc+SO1U1GvA80+5F1Jcg1ifIFw+ oTpwan896iAA8Y+IWEx4/VyAiZlcqIGtl2zR66GaAW8lZuZX3uvQix6eJG5AsIvqhD+e UYGFRkdUR2wMQqw+shyGrcj9lKhuuMVoJAAyQDt5Viea8rktqJGTokUyIUNpVt1wRI+4 haTA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu19si2711379edb.468.2020.06.30.17.50.10; Tue, 30 Jun 2020 17:50:33 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726449AbgGAAsf (ORCPT + 99 others); Tue, 30 Jun 2020 20:48:35 -0400 Received: from mga06.intel.com ([134.134.136.31]:37112 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbgGAAsf (ORCPT ); Tue, 30 Jun 2020 20:48:35 -0400 IronPort-SDR: M0FQhrJXXaUE4xq8cqDbs6uBH6WQAaEK64L8vn1P0UTJ6I3FB4XfE5BaTzB8S0lI264TW3ff2z vYuxo5ODOy2Q== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="207939015" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="207939015" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 17:48:33 -0700 IronPort-SDR: 7uQbbDbavB+IgSwg+d5bR+aRJ7G8ZlZcCA6NpkA6LEfKLyr+Jz6dawj0KC6OlDv2W2wM51K7Va 6jJCjumgaKMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="454807974" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga005.jf.intel.com with ESMTP; 30 Jun 2020 17:48:32 -0700 From: "Huang\, Ying" To: Yang Shi Cc: Dave Hansen , , , , Subject: Re: [RFC][PATCH 8/8] mm/numa: new reclaim mode to enable reclaim-based migration References: <20200629234503.749E5340@viggo.jf.intel.com> <20200629234517.A7EC4BD3@viggo.jf.intel.com> <87v9j9ow3a.fsf@yhuang-dev.intel.com> <29c67873-3cb9-e121-382c-9b81491016bc@linux.alibaba.com> Date: Wed, 01 Jul 2020 08:48:31 +0800 In-Reply-To: <29c67873-3cb9-e121-382c-9b81491016bc@linux.alibaba.com> (Yang Shi's message of "Tue, 30 Jun 2020 10:50:30 -0700") Message-ID: <87mu4knjq8.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yang, Yang Shi writes: >>> diff -puN mm/vmscan.c~enable-numa-demotion mm/vmscan.c >>> --- a/mm/vmscan.c~enable-numa-demotion 2020-06-29 16:35:01.017312549 -0700 >>> +++ b/mm/vmscan.c 2020-06-29 16:35:01.023312549 -0700 >>> @@ -4165,9 +4165,10 @@ int node_reclaim_mode __read_mostly; >>> * These bit locations are exposed in the vm.zone_reclaim_mode sysctl >>> * ABI. New bits are OK, but existing bits can never change. >>> */ >>> -#define RECLAIM_RSVD (1<<0) /* (currently ignored/unused) */ >>> -#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */ >>> -#define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */ >>> +#define RECLAIM_RSVD (1<<0) /* (currently ignored/unused) */ >>> +#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */ >>> +#define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */ >>> +#define RECLAIM_MIGRATE (1<<3) /* Migrate pages during reclaim */ >>> /* >>> * Priority for NODE_RECLAIM. This determines the fraction of pages >> I found that RECLAIM_MIGRATE is defined but never referenced in the >> patch. >> >> If my understanding of the code were correct, shrink_do_demote_mapping() >> is called by shrink_page_list(), which is used by kswapd and direct >> reclaim. So as long as the persistent memory node is onlined, >> reclaim-based migration will be enabled regardless of node reclaim mode. > > It looks so according to the code. But the intention of a new node > reclaim mode is to do migration on reclaim *only when* the > RECLAIM_MODE is enabled by the users. > > It looks the patch just clear the migration target node masks if the > memory is offlined. > > So, I'm supposed you need check if node_reclaim is enabled before > doing migration in shrink_page_list() and also need make node reclaim > to adopt the new mode. But why shouldn't we migrate in kswapd and direct reclaim? I think that we may need a way to control it, but shouldn't disable it unconditionally. > Please refer to > https://lore.kernel.org/linux-mm/1560468577-101178-6-git-send-email-yang.shi@linux.alibaba.com/ > Best Regards, Huang, Ying