[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231031003810.4532-3-gregory.price@memverge.com>
Date: Mon, 30 Oct 2023 20:38:08 -0400
From: Gregory Price <gourry.memverge@...il.com>
To: linux-kernel@...r.kernel.org
Cc: linux-cxl@...r.kernel.org, linux-mm@...ck.org,
ying.huang@...el.com, akpm@...ux-foundation.org,
aneesh.kumar@...ux.ibm.com, weixugc@...gle.com, apopple@...dia.com,
hannes@...xchg.org, tim.c.chen@...el.com, dave.hansen@...el.com,
mhocko@...nel.org, shy828301@...il.com, gregkh@...uxfoundation.org,
rafael@...nel.org, Gregory Price <gregory.price@...verge.com>
Subject: [RFC PATCH v3 2/4] node: add accessors to sysfs when nodes are created
Accessor information is presently only exposed when hmat information
is registered. Add accessor information at node creation to allow
new attributes to be added even in the absense of hmat information.
Signed-off-by: Gregory Price <gregory.price@...verge.com>
---
drivers/base/node.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 4d588f4658c8..b09c9c8e6830 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -868,7 +868,9 @@ int __register_one_node(int nid)
{
int error;
int cpu;
+ int onid;
struct node *node;
+ struct node_access_nodes *acc;
node = kzalloc(sizeof(struct node), GFP_KERNEL);
if (!node)
@@ -887,6 +889,20 @@ int __register_one_node(int nid)
node_init_caches(nid);
+ /*
+ * for each cpu node - add accessor to this node
+ * if this is a cpu node, add accessor to each other node
+ */
+ for_each_online_node(onid) {
+ /* During system bringup nodes may not be fully initialized */
+ if (!node_devices[onid])
+ continue;
+ if (node_state(onid, N_CPU))
+ acc = node_init_node_access(node, onid);
+ if (node_state(nid, N_CPU))
+ acc = node_init_node_access(node_devices[onid], nid);
+ }
+
return error;
}
--
2.39.1
Powered by blists - more mailing lists