Skip to contentSkip to conversation

EDAC: skx_common: downgrade message importance on missing PCI device

PATCH In review Aristeu Rozanski 3 participants 13 messages Dec 4, 2019 – Jan 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EDAC: skx_common: downgrade message importance on missing PCI device

Both skx_edac and i10nm_edac drivers are loaded based on the matching CPU being available which leads the module to be automatically loaded in virtual machines as well. That will fail due the missing PCI devices. In both drivers the first function to make use of the PCI devices is skx_get_hi_lo() will simply print

EDAC skx: Can't get tolm/tohm

for each CPU core, which is noisy. This patch makes it a debug message.

drivers/edac/skx_common.c +1 -1
index 95662a4ff4c4..99bbaf629b8d 100644
@@ -256,7 +256,7 @@ int skx_get_hi_lo(unsigned int did, int off[], u64 *tolm, u64 *tohm)
 
 	pdev = pci_get_device(PCI_VENDOR_ID_INTEL, did, NULL);
 	if (!pdev) {
-		skx_printk(KERN_ERR, "Can't get tolm/tohm\n");
+		edac_dbg(2, "Can't get tolm/tohm\n");
 		return -ENODEV;
 	}
 
maintainer
#1 lore raw
Quoted 3 lines

EDAC skx: Can't get tolm/tohm

for each CPU core, which is noisy. This patch makes it a debug message.

This looks like we call skx_init() once per core. Do we keep calling it because the calls are failing? Or do we do that even when calls succeed?

I was only really expecting that skx_init() would be called once.

-Tony

maintainer
#2 lore raw
Quoted 4 lines

This looks like we call skx_init() once per core. Do we keep calling it because the calls are failing? Or do we do that even when calls succeed?

I was only really expecting that skx_init() would be called once.

So (by experimentation) it seems that if the module load fails it will be retried num_online_cpus times (though not bound to each CPU in turn ... it will maybe try the init call on the same CPU multiple times, but miss running on some CPUs).

If the load succeeds, then whoever is repeating the load decides to stop.

-Tony

maintainer
#3 lore raw
Quoted 5 lines · Tony
Quoted 4 lines

This looks like we call skx_init() once per core. Do we keep calling it because the calls are failing? Or do we do that even when calls succeed?

I was only really expecting that skx_init() would be called once.

Quoted 7 lines

So (by experimentation) it seems that if the module load fails it will be retried num_online_cpus times (though not bound to each CPU in turn ... it will maybe try the init call on the same CPU multiple times, but miss running on some CPUs).

If the load succeeds, then whoever is repeating the load decides to stop.

That's the result of our conversion to MODULE_DEVICE_TABLE to match CPU models. So it tries once on each CPU:

https://lkml.kernel.org/r/[email protected]

I have no clean solution for this except maybe remembering the return value of the first instance probing in the edac core module and then asking it... it ain't pretty though.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#12 lore raw
In reply to Luck, Tony
Quoted 5 lines · Tony
Quoted 4 lines

This looks like we call skx_init() once per core. Do we keep calling it because the calls are failing? Or do we do that even when calls succeed?

I was only really expecting that skx_init() would be called once.

Quoted 7 lines

So (by experimentation) it seems that if the module load fails it will be retried num_online_cpus times (though not bound to each CPU in turn ... it will maybe try the init call on the same CPU multiple times, but miss running on some CPUs).

If the load succeeds, then whoever is repeating the load decides to stop.

Or silently fails to load the module again for all online cpus.

Signature · 1 line
Aristeu
#4 lore raw
In reply to Borislav Petkov
Quoted 14 lines · Borislav Petkov
Quoted 5 lines · Tony
Quoted 4 lines

This looks like we call skx_init() once per core. Do we keep calling it because the calls are failing? Or do we do that even when calls succeed?

I was only really expecting that skx_init() would be called once.

Quoted 7 lines

So (by experimentation) it seems that if the module load fails it will be retried num_online_cpus times (though not bound to each CPU in turn ... it will maybe try the init call on the same CPU multiple times, but miss running on some CPUs).

If the load succeeds, then whoever is repeating the load decides to stop.

Quoted 8 lines

That's the result of our conversion to MODULE_DEVICE_TABLE to match CPU models. So it tries once on each CPU:

https://lkml.kernel.org/r/[email protected]

I have no clean solution for this except maybe remembering the return value of the first instance probing in the edac core module and then asking it... it ain't pretty though.

The other option I can think about is just allowing the module to load in this situation: the CPU is present but you have no memory controller PCI devices present. Some drivers will allow loading without having a device present without errors. It's not clean as having to come up with something modutils can pick up as hint to not try to load more than once.

Or could just downgrade this specific message since it's a very common case and let the more unusual situations report more than once.

Signature · 1 line
Aristeu
maintainer
#5 lore raw
Quoted 5 lines · Aristeu Rozanski

The other option I can think about is just allowing the module to load in this situation: the CPU is present but you have no memory controller PCI devices present. Some drivers will allow loading without having a device present without errors. It's not clean as having to come up with something modutils can pick up as hint to not try to load more than once.

Yeah, but having a driver loaded when there's no hw to drive is also not pretty.

Quoted 2 lines

Or could just downgrade this specific message since it's a very common case and let the more unusual situations report more than once.

Yap, we did a similar thing for adm64_edac:

7fdfee926be7 ("EDAC/amd64: Get rid of the ECC disabled long message")

but instead of downgrading prio we actually went and killed it directly.

:-)

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#6 lore raw
Quoted 13 lines · Borislav Petkov
Quoted 5 lines · Aristeu Rozanski

The other option I can think about is just allowing the module to load in this situation: the CPU is present but you have no memory controller PCI devices present. Some drivers will allow loading without having a device present without errors. It's not clean as having to come up with something modutils can pick up as hint to not try to load more than once.

Yeah, but having a driver loaded when there's no hw to drive is also not pretty.

Quoted 2 lines

Or could just downgrade this specific message since it's a very common case and let the more unusual situations report more than once.

Quoted 7 lines

Yap, we did a similar thing for adm64_edac:

7fdfee926be7 ("EDAC/amd64: Get rid of the ECC disabled long message")

but instead of downgrading prio we actually went and killed it directly.

:-)

OK, will resubmit this patch just removing the messages then.

Thanks!

Signature · 1 line
Aristeu
maintainer
#7 lore raw
Quoted 1 line · Aristeu Rozanski

OK, will resubmit this patch just removing the messages then.

I'm not saying you should blindly remove them. They might be useful for debugging purposes so you should consider that usage angle first. In the AMD case, the message was really useless.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#8 lore raw
Quoted 3 lines · Borislav Petkov

I'm not saying you should blindly remove them. They might be useful for debugging purposes so you should consider that usage angle first. In the AMD case, the message was really useless.

Ah, I thought you had an objection to this patch :) Do you mind considering it for inclusion?

Signature · 1 line
Aristeu
maintainer
#9 lore raw
Quoted 7 lines · Aristeu Rozanski
Quoted 3 lines · Borislav Petkov

I'm not saying you should blindly remove them. They might be useful for debugging purposes so you should consider that usage angle first. In the AMD case, the message was really useless.

Ah, I thought you had an objection to this patch :) Do you mind considering it for inclusion?

That's Tony's call as he's maintaining the Intel side of EDAC.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#10 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 7 lines · Aristeu Rozanski
Quoted 3 lines · Borislav Petkov

I'm not saying you should blindly remove them. They might be useful for debugging purposes so you should consider that usage angle first. In the AMD case, the message was really useless.

Ah, I thought you had an objection to this patch :) Do you mind considering it for inclusion?

That's Tony's call as he's maintaining the Intel side of EDAC.

Already applied to git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git
in edac-for-next branch. Sorry, should have sent you an "Applied" message.

-Tony

#11 lore raw
Quoted 2 lines · Tony

Already applied to git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git
in edac-for-next branch. Sorry, should have sent you an "Applied" message.

Thanks Tony.

Signature · 1 line
Aristeu