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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3D6A3C433E0 for ; Wed, 1 Jul 2020 01:28:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0DC512074D for ; Wed, 1 Jul 2020 01:28:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DC512074D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 84A478D0017; Tue, 30 Jun 2020 21:28:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FB6E8D0003; Tue, 30 Jun 2020 21:28:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 711318D0017; Tue, 30 Jun 2020 21:28:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 599B38D0003 for ; Tue, 30 Jun 2020 21:28:16 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CE182180AD802 for ; Wed, 1 Jul 2020 01:28:15 +0000 (UTC) X-FDA: 76987771350.10.cream35_3e0f4cc26e7c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id B11F216A0AE for ; Wed, 1 Jul 2020 01:28:15 +0000 (UTC) X-HE-Tag: cream35_3e0f4cc26e7c X-Filterd-Recvd-Size: 5074 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Jul 2020 01:28:14 +0000 (UTC) IronPort-SDR: 4XKgqKHmxgx1K/7xgi8PEpQMj7jbkuPJe+jqWlB7AV7jqY1sHn5qAkSil4yHC0JO4QGqPVCl+R E5uBlms4FDUg== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="146418572" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="146418572" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.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 X-Rspamd-Queue-Id: B11F216A0AE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: 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.01731254= 9 -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 s= ysctl >>>>> * 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 pa= ges >>>> I found that RECLAIM_MIGRATE is defined but never referenced in the >>>> patch. >>>> >>>> If my understanding of the code were correct, shrink_do_demote_mappi= ng() >>>> 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 m= ode. >>> 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 th= at >> 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.=C2=A0 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-y= ang.shi@linux.alibaba.com/ >>> >> Best Regards, >> Huang, Ying