Skip to contentSkip to conversation

ACPI: HMAT: Mark hmat_set_default_dram_perf() as __init

PATCH Superseded Nathan Chancellor 4 participants 5 messages Jul 10, 2024 – Jul 12, 2024 ACPI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: HMAT: Mark hmat_set_default_dram_perf() as __init

After commit 4dc70b711dbc ("memory tier: consolidate the initialization of memory tiers"), there is a modpost warning when hmat_set_default_dram_perf() is not inlined into its callsite, as it appears that default_dram_nodes may be accessed after its memory has been freed.

WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a problem in reality but it is easily solvable by marking hmat_set_default_dram_perf() as __init, which should have been done when this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT").

---
I left off a fixes tag as I assume this is going to be squashed into the former change mentioned above, as it is still in mm-unstable, but feel free to add one if the patch is going to be standalone.

---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa/hmat.c +1 -1
index a2f9e7a4b479..ca0c0ea3e1ef 100644
@@ -933,7 +933,7 @@ static int hmat_callback(struct notifier_block *self,
 	return NOTIFY_OK;
 }
 
-static int hmat_set_default_dram_perf(void)
+static __init int hmat_set_default_dram_perf(void)
 {
 	int rc;
 	int nid, pxm;

---
base-commit: 17bcc624e67da6383060ee24483db77aa17276aa
change-id: 20240710-fix-modpost-warning-default_dram_nodes-38b6faffe3da

Best regards,

Signature · 1 line
Nathan Chancellor <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Nathan Chancellor

After commit 4dc70b711dbc ("memory tier: consolidate the initialization of memory tiers"), there is a modpost warning when hmat_set_default_dram_perf() is not inlined into its callsite, as it appears that default_dram_nodes may be accessed after its memory has been freed.

Quoted 7 lines

WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a problem in reality but it is easily solvable by marking hmat_set_default_dram_perf() as __init, which should have been done when this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT").

Good catch! Thanks for your fix! If it's necessary, feel free to add

Quoted 29 lines

---
I left off a fixes tag as I assume this is going to be squashed into the former change mentioned above, as it is still in mm-unstable, but feel free to add one if the patch is going to be standalone.

---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa/hmat.c +1 -2
index a2f9e7a4b479..ca0c0ea3e1ef 100644
@@ -933,7 +933,7 @@ static int hmat_callback(struct notifier_block *self,
 	return NOTIFY_OK;
 }
 
-static int hmat_set_default_dram_perf(void)
+static __init int hmat_set_default_dram_perf(void)
 {
 	int rc;
 	int nid, pxm;
 
---

base-commit: 17bcc624e67da6383060ee24483db77aa17276aa
change-id: 20240710-fix-modpost-warning-default_dram_nodes-38b6faffe3da

Quoted 1 line

Best regards,

--
Best Regards,
Huang, Ying

#2 lore raw
Quoted 17 lines · Ying
Quoted 6 lines · Nathan Chancellor

After commit 4dc70b711dbc ("memory tier: consolidate the initialization of memory tiers"), there is a modpost warning when hmat_set_default_dram_perf() is not inlined into its callsite, as it appears that default_dram_nodes may be accessed after its memory has been freed.

Quoted 7 lines

WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a problem in reality but it is easily solvable by marking hmat_set_default_dram_perf() as __init, which should have been done when this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT").

Quoted 3 lines

Good catch! Thanks for your fix! If it's necessary, feel free to add

Thanks for the patch and the review!

I'm expecting Dan/Dave to take care of it (or please let me know if I'm expected to pick it up).

Quoted 35 lines
Quoted 29 lines

---
I left off a fixes tag as I assume this is going to be squashed into the former change mentioned above, as it is still in mm-unstable, but feel free to add one if the patch is going to be standalone.

---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa/hmat.c +1 -2
index a2f9e7a4b479..ca0c0ea3e1ef 100644
@@ -933,7 +933,7 @@ static int hmat_callback(struct notifier_block *self,
      return NOTIFY_OK;
 }
 
-static int hmat_set_default_dram_perf(void)
+static __init int hmat_set_default_dram_perf(void)
 {
      int rc;
      int nid, pxm;
 
---

base-commit: 17bcc624e67da6383060ee24483db77aa17276aa
change-id: 20240710-fix-modpost-warning-default_dram_nodes-38b6faffe3da

Quoted 1 line

Best regards,

--
Best Regards,
Huang, Ying

#3 lore raw
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Ying
Quoted 13 lines · Nathan Chancellor

After commit 4dc70b711dbc ("memory tier: consolidate the initialization of memory tiers"), there is a modpost warning when hmat_set_default_dram_perf() is not inlined into its callsite, as it appears that default_dram_nodes may be accessed after its memory has been freed.

WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a problem in reality but it is easily solvable by marking hmat_set_default_dram_perf() as __init, which should have been done when this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT").

Quoted 16 lines
Quoted 3 lines

Good catch! Thanks for your fix! If it's necessary, feel free to add

Thanks for the patch and the review!

I'm expecting Dan/Dave to take care of it (or please let me know if I'm expected to pick it up).

Quoted 7 lines
Quoted 7 lines

---
I left off a fixes tag as I assume this is going to be squashed into the former change mentioned above, as it is still in mm-unstable, but feel free to add one if the patch is going to be standalone.

Should this be picked up by Andrew instead since it's already in mm-unstable?

Quoted 28 lines
Quoted 28 lines
Quoted 22 lines
---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa/hmat.c +1 -2
index a2f9e7a4b479..ca0c0ea3e1ef 100644
@@ -933,7 +933,7 @@ static int hmat_callback(struct notifier_block *self,
      return NOTIFY_OK;
 }
 
-static int hmat_set_default_dram_perf(void)
+static __init int hmat_set_default_dram_perf(void)
 {
      int rc;
      int nid, pxm;
 
---

base-commit: 17bcc624e67da6383060ee24483db77aa17276aa
change-id: 20240710-fix-modpost-warning-default_dram_nodes-38b6faffe3da

Quoted 1 line

Best regards,

--
Best Regards,
Huang, Ying

#4 lore raw
Quoted 39 lines · Dave Jiang
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Ying
Quoted 13 lines · Nathan Chancellor

After commit 4dc70b711dbc ("memory tier: consolidate the initialization of memory tiers"), there is a modpost warning when hmat_set_default_dram_perf() is not inlined into its callsite, as it appears that default_dram_nodes may be accessed after its memory has been freed.

WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a problem in reality but it is easily solvable by marking hmat_set_default_dram_perf() as __init, which should have been done when this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT").

Quoted 16 lines
Quoted 3 lines

Good catch! Thanks for your fix! If it's necessary, feel free to add

Thanks for the patch and the review!

I'm expecting Dan/Dave to take care of it (or please let me know if I'm expected to pick it up).

Quoted 7 lines
Quoted 7 lines

---
I left off a fixes tag as I assume this is going to be squashed into the former change mentioned above, as it is still in mm-unstable, but feel free to add one if the patch is going to be standalone.

Quoted 1 line

Should this be picked up by Andrew instead since it's already in mm-unstable?

This works too as long as someone picks it up. :-)