Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1523309yba; Thu, 25 Apr 2019 00:57:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKPlHhm1TNORipYeZU7XVSkKt1nV5KTW6cUpY9zkMCU3eWqh8qUhfDZ96kMeVBZo/Zj6Cz X-Received: by 2002:a62:205c:: with SMTP id g89mr37837383pfg.34.1556179030606; Thu, 25 Apr 2019 00:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556179030; cv=none; d=google.com; s=arc-20160816; b=G/sCid4J+WPMd7a/qHoNQQf9/t3Lk8ShOPs4fO77o1oaojnfLmXMxS1DfO7tephkvj WeHGonBP0HLqbLEo8QSjRE3Aoddloh6ziTvnQxHVucDt/0T0OjEFUZVqG4H2Wl8+yWSB FZh25QVC24/+81Sp4CNuVQzEze+u/pzqgqqPMsaSJcouasYXqeyb6+V/YVFv+iF1YYKt QN3cc5tdvkZISAGPfXsKpCTt00m2QGnneYXa4dO1djvVdw3SRe54dyjwTLo9ZZ+FdxDs 2LIbSNrXmELZtxgAPifNkYa2oxzirpMkYJydBWJBuCDNqCxdsSsgZ5Xbgf3rY/2h03Tt yGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=QleL8CAONDSgNNXma3dxkm0/dQm/tc84zMmGS22JMXc=; b=ZqYZ1yOOdUFYPG4M4/hhjyG7HECD0uHBgRTG2lNLHVMRiI0SsqnKnNNoc4DdCBEgHE eXC33rGPiwK3Bbf7TxcwVdzaBl4N19Zncfdi6c5mY8z8DGTgWllNPC1sX+qPxtuhoGUe 0p2CkLUaE2fr76M2NHlA/nRAc/74G2/ZsVcIYKthfZC77GvYJmf5XgYX/c27M10GpSJi nLBRuNSu6jwnTgybGn1M8s1L0SFK2MFTxcdqOzgXvg3z0oO2bl12KAv7wQFpjo9AcDDQ 1/TNGx2lMAlj9uDRayIfh5gR28kGNq19Mrqp0qoP2XEXdDoXok0l53tjpj5+tm7NYfF7 34Vw== 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 y3si2046146pgi.349.2019.04.25.00.56.56; Thu, 25 Apr 2019 00:57:10 -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 S2388237AbfDYBmr (ORCPT + 99 others); Wed, 24 Apr 2019 21:42:47 -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 S2388188AbfDYBmp (ORCPT ); Wed, 24 Apr 2019 21:42:45 -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:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,391,1549958400"; d="scan'208";a="152134221" Received: from zz23f_aep_wp03.sh.intel.com ([10.239.85.39]) by FMSMGA003.fm.intel.com with ESMTP; 24 Apr 2019 18:42:43 -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 2/5] mmzone: new pgdat flags for DRAM and PMEM Date: Thu, 25 Apr 2019 09:21:32 +0800 Message-Id: <1556155295-77723-3-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1556155295-77723-1-git-send-email-fan.du@intel.com> References: <1556155295-77723-1-git-send-email-fan.du@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One system with DRAM and PMEM, we need new flag to tag pgdat is made of DRAM or peristent memory. This patch serves as preparetion one for follow up patch. Signed-off-by: Fan Du --- include/linux/mmzone.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fba7741..d3ee9f9 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -520,6 +520,8 @@ enum pgdat_flags { * many pages under writeback */ PGDAT_RECLAIM_LOCKED, /* prevents concurrent reclaim */ + PGDAT_DRAM, /* Volatile DRAM memory node */ + PGDAT_PMEM, /* Persistent memory node */ }; enum zone_flags { @@ -923,6 +925,30 @@ extern int numa_zonelist_order_handler(struct ctl_table *, int, #endif /* !CONFIG_NEED_MULTIPLE_NODES */ +static inline int is_node_pmem(int nid) +{ + pg_data_t *pgdat = NODE_DATA(nid); + + return test_bit(PGDAT_PMEM, &pgdat->flags); +} + +static inline int is_node_dram(int nid) +{ + pg_data_t *pgdat = NODE_DATA(nid); + + return test_bit(PGDAT_DRAM, &pgdat->flags); +} + +static inline void set_node_type(int nid) +{ + pg_data_t *pgdat = NODE_DATA(nid); + + if (node_isset(nid, numa_nodes_pmem)) + set_bit(PGDAT_PMEM, &pgdat->flags); + else + set_bit(PGDAT_DRAM, &pgdat->flags); +} + extern struct pglist_data *first_online_pgdat(void); extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat); extern struct zone *next_zone(struct zone *zone); -- 1.8.3.1