Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1729274yba; Thu, 25 Apr 2019 04:55:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1thZvVmiifJ5ibt3XDa8oGCSwTASkgoBT7y0+3qym3+NddzNkbifBpFCrllO6h4Ig3USS X-Received: by 2002:a62:f20e:: with SMTP id m14mr41116290pfh.228.1556193358783; Thu, 25 Apr 2019 04:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556193358; cv=none; d=google.com; s=arc-20160816; b=bjOKUGvk6lIO32kncXlPlC+3MGql7VUHvRM9DGKboPeHJp7aOXEIvhAT6Wnt/r8fZY 5Qgek/DCFBIEKgOMLO4jWlX8tjFQaAnt2zsJkiLyUNBZYIhF8F1ZHEqwwq42zSM0V4Hn qjEnxr2wZI/6dBK6y3zLMceCWblwsmwBMUQNahfTViLcggKGvSNNDscjcc61dXmHO1Sl T/VSH3LXBPfY+i4MYd60+kLWOt82X7z1HHM2msBenaBajyhXBKArxqtt67oOhftQzLZH PmIDPf08qEGMpUol9t+TXPRUX9+pq5yE8zaDMkD3i1XL/7p1KPWSKg1sSqjT4BffvDhy DAPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=cah/q1jvVVujCnwnWh0QHWDEt4UM1VYQ6RdhbZoS3MQ=; b=wVioIIN4JVXN45XDeU+qqHt1DBOvcUHQZNGaancxBKTTcqRYWRfRLbbfqxxj/eha1A mi1XvaIoyBQN/J2IWqzxg/8B6G+xSFqWy9XD9eALVJx04mcGgomfC1kfIUYi7rQuyqGq pT3HwskLUg7NmaVhu2PqItEfkkGEBL3aLaR+XzBkNDX+d/wr5UHZD67Bo3kDcOHvQ+ls qWuGjmxDsyzja5o+8ILxEjkbMOxE9gDjuaNVRDjZ6ECyqk+l5XHYoM+71ylzBFOvzWRk /C/BY1TP2Kf59ZY+cXUSuA0i0faR3u//M4DDQCBi7Bqi7ltjLgZgatZv1y8pKU8bAiPK N1uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id g10si20391916pgs.397.2019.04.25.04.55.28; Thu, 25 Apr 2019 04:55:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2388173AbfDYBmm (ORCPT + 99 others); Wed, 24 Apr 2019 21:42:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:25341 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387460AbfDYBmm (ORCPT ); Wed, 24 Apr 2019 21:42:42 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2019 18:42:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,391,1549958400"; d="scan'208";a="152134204" Received: from zz23f_aep_wp03.sh.intel.com ([10.239.85.39]) by FMSMGA003.fm.intel.com with ESMTP; 24 Apr 2019 18:42:40 -0700 From: Fan Du To: akpm@linux-foundation.org, mhocko@suse.com, fengguang.wu@intel.com, dan.j.williams@intel.com, dave.hansen@intel.com, xishi.qiuxishi@alibaba-inc.com, ying.huang@intel.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Fan Du Subject: [RFC PATCH 0/5] New fallback workflow for heterogeneous memory system Date: Thu, 25 Apr 2019 09:21:30 +0800 Message-Id: <1556155295-77723-1-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is another approach of building zonelist based on patch #10 of patchset[1]. For systems with heterogeneous DRAM and PMEM (persistent memory), 1) change ZONELIST_FALLBACK to first fallback to same type nodes, then the other types 2) add ZONELIST_FALLBACK_SAME_TYPE to fallback only same type nodes. To be explicitly selected by __GFP_SAME_NODE_TYPE. For example, a 2S DRAM+PMEM system may have NUMA distances: node 0 1 2 3 0: 10 21 17 28 1: 21 10 28 17 2: 17 28 10 28 3: 28 17 28 10 Node 0,1 are DRAM nodes, node 2, 3 are PMEM nodes. ZONELIST_FALLBACK ================= Current zoned fallback lists are based on numa distance only, which means page allocation request from node 0 will iterate zone order like: DRAM node 0 -> PMEM node 2 -> DRAM node 1 -> PMEM node 3. However PMEM has different characteristics from DRAM, the more reasonable or desirable fallback style would be: DRAM node 0 -> DRAM node 1 -> PMEM node 2 -> PMEM node 3. When DRAM is exhausted, try PMEM then. ZONELIST_FALLBACK_SAME_TYPE =========================== Some cases are more suitable to fit PMEM characteristics, like page is read more frequently than written. Other cases may prefer DRAM only. It doesn't matter page is from local node, or remote. Create __GFP_SAME_NODE_TYPE to request page of same node type, either we got DRAM(from node 0, 1) or PMEM (from node 2, 3), it's kind of extension to the nofallback list, but with the same node type. This patchset is self-contained, and based on Linux 5.1-rc6. [1]: https://lkml.org/lkml/2018/12/26/138 Fan Du (5): acpi/numa: memorize NUMA node type from SRAT table mmzone: new pgdat flags for DRAM and PMEM x86,numa: update numa node type mm, page alloc: build fallback list on per node type basis mm, page_alloc: Introduce ZONELIST_FALLBACK_SAME_TYPE fallback list arch/x86/include/asm/numa.h | 2 ++ arch/x86/mm/numa.c | 3 +++ drivers/acpi/numa.c | 5 ++++ include/linux/gfp.h | 7 ++++++ include/linux/mmzone.h | 35 ++++++++++++++++++++++++++++ mm/page_alloc.c | 57 ++++++++++++++++++++++++++++++++------------- 6 files changed, 93 insertions(+), 16 deletions(-) -- 1.8.3.1