Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp193146ybt; Tue, 30 Jun 2020 18:13:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGyG0Y378XH9qmQ9DLTToHeBPsJzP5vANZUQHw1eRTno2GVaLbc5sZa2OU2iV0tEkkIlms X-Received: by 2002:a05:6402:1b0e:: with SMTP id by14mr25372427edb.266.1593566016081; Tue, 30 Jun 2020 18:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593566016; cv=none; d=google.com; s=arc-20160816; b=Ch+7E5YawhxtiXlCyw8T55hv/5g/TPyi1rzqcVe+Qgl0S+UfoiTLLUmXyYHrj2yFTv svwyVVpOQxdpDurMHW6do8pDfkBdmN9pb4S1O+nkXnjmMU1tuR/dLGIP+nhZ+1iCsyK4 RFKLPy0qyCa9XhC9dOQQBF9X4BjKsNg0nOMDWW6bDvs807CpOhs0/KChLdcluAMc4EUe C4bnudFwn9ap5IMpJF+IQx+XRpdJnecVJpc+QOIM0a2PDtPqSJKHy3rDsSdj2d5z33KR tMt4Z9D+9DW5A02rkNjzYnDijjzR/jL1wX0x3CosNrTSdqt2lbaEwA3zYjXkd2NNTyuJ 8UEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=OstKQ/TAyOp9dr3J9AhP5nWqfSpqyKjIZeRhahuZyMI=; b=JHcyxmyImuYxIVYjcbxL5K5v4rWu1ABixHBlEm1rVoq6aFn2vo4sFCWPFalpZ/+rkM HVjaCfaVFQ9n6bw60bdjs3BqD4xX4SHDx1EXaW3lxfJ7+XPe7PoRy/8TMyU3X4uza5QD 3KkKXm8gFwBttZzwdAYedQKxKqE9xNZVCQkc+hqpNTh9RepHD7X1jnP4TPWrqCjnjArW WNRBASwriVCvlZlGkUtFqWJ2BP3n90ItCB7FhVmCAQkm2Oe6e/obXrn5VQl4VoUhmKCE U92IIJlrHU4KP56embwWbINsz0vWemvSDYm0i+nHOG+sLHtyVq3yY9/PUsHyQT34cYLv RZIg== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 25si2881730ejy.507.2020.06.30.18.13.12; Tue, 30 Jun 2020 18:13:36 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbgGABNF (ORCPT + 99 others); Tue, 30 Jun 2020 21:13:05 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:51876 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbgGABNF (ORCPT ); Tue, 30 Jun 2020 21:13:05 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07488;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U1DHztl_1593565978; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0U1DHztl_1593565978) by smtp.aliyun-inc.com(127.0.0.1); Wed, 01 Jul 2020 09:13:00 +0800 Subject: Re: [RFC][PATCH 8/8] mm/numa: new reclaim mode to enable reclaim-based migration To: "Huang, Ying" Cc: Dave Hansen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com, dan.j.williams@intel.com 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> From: Yang Shi Message-ID: Date: Tue, 30 Jun 2020 18:12:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <87mu4knjq8.fsf@yhuang-dev.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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