[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4170cd543b250260678341c3ffbe5bb8aaf97f1.camel@intel.com>
Date: Mon, 13 Jun 2022 15:07:57 +0800
From: Ying Huang <ying.huang@...el.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
linux-mm@...ck.org, akpm@...ux-foundation.org
Cc: Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
Yang Shi <shy828301@...il.com>,
Davidlohr Bueso <dave@...olabs.net>,
Tim C Chen <tim.c.chen@...el.com>,
Brice Goglin <brice.goglin@...il.com>,
Michal Hocko <mhocko@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Hesham Almatary <hesham.almatary@...wei.com>,
Dave Hansen <dave.hansen@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Alistair Popple <apopple@...dia.com>,
Dan Williams <dan.j.williams@...el.com>,
Feng Tang <feng.tang@...el.com>,
Jagdish Gediya <jvgediya@...ux.ibm.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH v6 09/13] mm/demotion: Add pg_data_t member to track
node memory tier details
On Fri, 2022-06-10 at 19:22 +0530, Aneesh Kumar K.V wrote:
> Also update different helpes to use NODE_DATA()->memtier. Since
> node specific memtier can change based on the reassignment of
> NUMA node to a different memory tiers, accessing NODE_DATA()->memtier
> needs to under an rcu read lock of memory_tier_lock.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>
> ---
> include/linux/memory-tiers.h | 14 +++++
> include/linux/mmzone.h | 3 ++
> mm/memory-tiers.c | 102 ++++++++++++++++++++++++++---------
> 3 files changed, 94 insertions(+), 25 deletions(-)
>
> diff --git a/include/linux/memory-tiers.h b/include/linux/memory-tiers.h
> index 52896f5970b7..53f3e4c7cba8 100644
> --- a/include/linux/memory-tiers.h
> +++ b/include/linux/memory-tiers.h
> @@ -6,6 +6,9 @@
>
>
> #ifdef CONFIG_TIERED_MEMORY
>
>
> +#include <linux/device.h>
> +#include <linux/nodemask.h>
> +
> #define MEMORY_TIER_HBM_GPU 0
> #define MEMORY_TIER_DRAM 1
> #define MEMORY_TIER_PMEM 2
> @@ -18,13 +21,24 @@
> #define MAX_STATIC_MEMORY_TIERS 3
> #define MAX_MEMORY_TIERS (MAX_STATIC_MEMORY_TIERS + 2)
>
>
> +struct memory_tier {
> + struct list_head list;
> + struct device dev;
> + nodemask_t nodelist;
> + int rank;
> +};
> +
I suggest to use two data structure,
struct memory_tier {
struct list_head list;
nodemask_t nodelist;
int rank;
};
struct memory_tier_dev {
struct list_head list;
struct device dev;
struct memory_tier *tier;
};
Then we can put struct memory_tier here and still hide struct
memory_tier_dev in memory_tiers.c. In this way, we don't need to
force all struct memory_tier users to compile the entire driver core
headers. And we can separate the user space interface implementation
from the other part of the kernel.
> extern bool numa_demotion_enabled;
> int node_create_and_set_memory_tier(int node, int tier);
> int next_demotion_node(int node);
> int node_set_memory_tier(int node, int tier);
> int node_get_memory_tier_id(int node);
> int node_reset_memory_tier(int node, int tier);
> +struct memory_tier *node_get_memory_tier(int node);
> +void node_put_memory_tier(struct memory_tier *memtier);
I don't find caller of these 2 functions in series. Can we remove
these functions?
Best Regards,
Huang, Ying
[snip]
Powered by blists - more mailing lists