Correct cpu affinity for dlpar added cpus
PATCH 1/1 Correct cpu affinity for dlpar added cpus
The incorrect ordering of operations during cpu dlpar causes the affinity of cpus being added to be invalid. Phyp does not assign affinity information for a cpu until the rtas set-indicator calls are made to set the isolation and allocation state. In the current code we call rtas configure-connector before making the set-indicator calls which results in invalid data in the ibm,associativity property for the cpu we're adding.
This patch corrects the order of operations to make the set-indicator calls (done in acquire_drc) before calling configure-connector.
--- arch/powerpc/platforms/pseries/dlpar.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
arch/powerpc/platforms/pseries/dlpar.c +4 -6
@@ -412,6 +412,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)if (rc)return -EINVAL ; + rc =dlpar_acquire_drc (drc_index); +if (rc) +return -EINVAL ; + parent =of_find_node_by_path ("/cpus" );if (!parent)return -ENODEV ;
@@ -422,12 +426,6 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)of_node_put (parent); - rc =dlpar_acquire_drc (drc_index); -if (rc) { -dlpar_free_cc_nodes (dn); -return -EINVAL ; - } - rc =dlpar_attach_node (dn);if (rc) {dlpar_release_drc (drc_index);
Michael Ellerman
reviewerSubject should be "powerpc/pseries: ..." please.
Quoted 6 lines · Nathan Fontenot
The incorrect ordering of operations during cpu dlpar causes the affinity of cpus being added to be invalid. Phyp does not assign affinity information for a cpu until the rtas set-indicator calls are made to set the isolation and allocation state. In the current code we call rtas configure-connector before making the set-indicator calls which results in invalid data in the ibm,associativity property for the cpu we're adding.
Invalid and benign? Or invalid and causes an oops or ..?
Quoted 2 lines
This patch corrects the order of operations to make the set-indicator calls (done in
acquire_drc) before calling configure-connector.
Which commit added the code and/or caused it to be wrong?
While looking at the code I notice it looks like we leak a reference if dlpar_configure_connector() fails:
parent = of_find_node_by_path("/cpus");
if (!parent)
return -ENODEV;
dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
if (!dn)
return -EINVAL;
of_node_put(parent);Please send a separate patch to fix that.
cheers
Quoted 1 line · Michael Ellerman
Subject should be "powerpc/pseries: ..." please.
ok
Quoted 11 lines · Nathan Fontenot
Quoted 6 lines
The incorrect ordering of operations during cpu dlpar causes the affinity of cpus being added to be invalid. Phyp does not assign affinity information for a cpu until the rtas set-indicator calls are made to set the isolation and allocation state. In the current code we call rtas configure-connector before making the set-indicator calls which results in invalid data in the ibm,associativity property for the cpu we're adding.
Invalid and benign? Or invalid and causes an oops or ..?
Invalid and benign. I'll add this to the description.
Quoted 7 lines
Quoted 2 lines
This patch corrects the order of operations to make the set-indicator calls (done in
acquire_drc) before calling configure-connector.Which commit added the code and/or caused it to be wrong?
And the commit that this fixes..
Quoted 15 lines
While looking at the code I notice it looks like we leak a reference if
dlpar_configure_connector()fails:parent = of_find_node_by_path("/cpus"); if (!parent) return -ENODEV; dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); if (!dn) return -EINVAL; of_node_put(parent);
Quoted 1 line
Please send a separate patch to fix that.
Yep, saw that too.
New patches on their way.
Thanks for the feedback,
-Nathan