Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp201595ybt; Tue, 30 Jun 2020 18:29:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1vhZklIcRd7RxfCWbJgpDRqQvd6bj6vtDUYX2Cn5vPZdmKPYNo7fBtDLpa21M+bg0pNdV X-Received: by 2002:a17:906:eb4b:: with SMTP id mc11mr20382039ejb.5.1593566953030; Tue, 30 Jun 2020 18:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593566953; cv=none; d=google.com; s=arc-20160816; b=LNOU0JGiXMkO3ZCUAIjyMquOtwfDNbwoJ1LxgNUJ5PB1SPgQL5Azx1zRO5ddDIAjsT YEDXDooP002kXAQLW6HGzM5atR+xXzTBmOahyWydei6wzhos2qeGb0IicUlyUSl0T80i nmJsaDiDFi+VoOo9WfEBsCBqUlOKc7i3dRpEJhxZYn3WmWYy4UuH4AluaK+liaaiPbPU gXcdcJnmY1g94PcwsKFLSv5y7aucjbectK7iQGgx+Te7R0lY7DAuFf0oRreJCysqEJ7S 7uRJEo4eg+QhESsVC4y8VqsLzH7gRpA4d5A0ni3bYbRKKARw13xzk4UMWGr4s4o07BA0 76ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=8RdI6TJyesRg2RlExqdfqS7pn+L5VgiESH+o1ub+08U=; b=xF4HoL/ZexggBkwgbxJ7XQjCZhTigpggKg+SDsSZf7ErAzqttVVqCjRW6xlhAtelRB MPPpbJUY8Dv+m97KzOJHmhaL+MvQNj2blwozBQac98/v8ag8TDq2104/SR1z0G5toE8O t9XyvPetnC5TKVC88dkXoNoG6BSxfjKYd6m6mx74FpqTehTmc/qVXjzNDmk+M2o5+sPf VIcK372uv8beiQLj6wphT0LqD0F+FgZpZqzHLWwSNCNze25mPEceLXdDlBhZ34sJb3v4 HRBfI4hogwqzuoM3PPKNa67c6yhYmhQJnqlHo1UmMBAOfY5bZH6xe3joVggpwUHwh9Cu Z8vg== 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 k8si2837697ejc.257.2020.06.30.18.28.48; Tue, 30 Jun 2020 18:29:13 -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 S1725994AbgGAB2N (ORCPT + 99 others); Tue, 30 Jun 2020 21:28:13 -0400 Received: from mga12.intel.com ([192.55.52.136]:39091 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbgGAB2M (ORCPT ); Tue, 30 Jun 2020 21:28:12 -0400 IronPort-SDR: Wp3I0SUAqtgwW03Ujh/FTsOzPCYZBX7SbMe7c7RJO3yjUO7hFKR3yx50jfOqLcCLh5262Szj1a hmYKu5Q0iakQ== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="126063173" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="126063173" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 18:28:12 -0700 IronPort-SDR: vJpC9c2ju7gYWK/45yBYB3OIJK02r58VOs+HGboGK9z9tREKl9UPd6EtISSPSlzpJnk5lQUips sI351JY9ufJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="321090981" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jun 2020 18:28:10 -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> <87mu4knjq8.fsf@yhuang-dev.intel.com> Date: Wed, 01 Jul 2020 09:28:10 +0800 In-Reply-To: (Yang Shi's message of "Tue, 30 Jun 2020 18:12:42 -0700") Message-ID: <87bll0nhw5.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=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yang Shi writes: > On 6/30/20 5:48 PM, Huang, Ying wrote: >> 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. > > Let me share some background. In the past discussions on LKML and last > year's LSFMM the opt-in approach was preferred since the new feature > might be not stable and mature.  So the new node reclaim mode was > suggested by both Mel and Michal. I'm supposed this is still a valid > point now. Is there any technical reason? I think the code isn't very complex. If we really worry about stable and mature, isn't it enough to provide some way to enable/disable the feature? Even for kswapd and direct reclaim? Best Regards, Huang, Ying > Once it is mature and stable enough we definitely could make it > universally preferred and default behavior. > >> >>> Please refer to >>> https://lore.kernel.org/linux-mm/1560468577-101178-6-git-send-email-yang.shi@linux.alibaba.com/ >>> >> Best Regards, >> Huang, Ying