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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD087C433E0 for ; Wed, 1 Jul 2020 01:13:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58F1320771 for ; Wed, 1 Jul 2020 01:13:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58F1320771 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DCEBF8D000F; Tue, 30 Jun 2020 21:13:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7F108D0003; Tue, 30 Jun 2020 21:13:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C945B8D000F; Tue, 30 Jun 2020 21:13:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id B507F8D0003 for ; Tue, 30 Jun 2020 21:13:05 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 359451EE6 for ; Wed, 1 Jul 2020 01:13:05 +0000 (UTC) X-FDA: 76987733130.07.elbow13_4711a5626e7c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 0D48C1803F9A7 for ; Wed, 1 Jul 2020 01:13:05 +0000 (UTC) X-HE-Tag: elbow13_4711a5626e7c X-Filterd-Recvd-Size: 4284 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Jul 2020 01:13:03 +0000 (UTC) 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-Language: en-US X-Rspamd-Queue-Id: 0D48C1803F9A7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable 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 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 sy= sctl >>>> * 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 pag= es >>> I found that RECLAIM_MIGRATE is defined but never referenced in the >>> patch. >>> >>> If my understanding of the code were correct, shrink_do_demote_mappin= g() >>> 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 mo= de. >> 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 tha= t > 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=20 year's LSFMM the opt-in approach was preferred since the new feature=20 might be not stable and mature.=A0 So the new node reclaim mode was=20 suggested by both Mel and Michal. I'm supposed this is still a valid=20 point now. Once it is mature and stable enough we definitely could make it=20 universally preferred and default behavior. > >> Please refer to >> https://lore.kernel.org/linux-mm/1560468577-101178-6-git-send-email-ya= ng.shi@linux.alibaba.com/ >> > Best Regards, > Huang, Ying