[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB7134E24098C6E16E43C57EAA89312@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Fri, 6 Dec 2024 01:26:12 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Meyer, Kyle" <kyle.meyer@....com>, "Luck, Tony" <tony.luck@...el.com>
CC: "bp@...en8.de" <bp@...en8.de>, "james.morse@....com"
<james.morse@....com>, "mchehab@...nel.org" <mchehab@...nel.org>,
"rric@...nel.org" <rric@...nel.org>, "linux-edac@...r.kernel.org"
<linux-edac@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] EDAC/{i10nm,skx,skx_common}: Support multiple clumps
> From: Kyle Meyer <kyle.meyer@....com>
> Sent: Friday, December 6, 2024 8:57 AM
> To: Luck, Tony <tony.luck@...el.com>
> Cc: bp@...en8.de; james.morse@....com; mchehab@...nel.org;
> rric@...nel.org; linux-edac@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH] EDAC/{i10nm,skx,skx_common}: Support multiple
> clumps
>
> On Thu, Dec 05, 2024 at 03:57:55PM -0800, Luck, Tony wrote:
> > > +int skx_get_src_id(struct skx_dev *d, int off, u8 *id) { #ifdef
> > > +CONFIG_NUMA
> > > + return skx_get_pkg_id(d, id);
> > > +#else
> > > + u32 reg;
> > > +
> > > + if (pci_read_config_dword(d->util_all, off, ®)) {
> > > + skx_printk(KERN_ERR, "Failed to read src id\n");
> > > + return -ENODEV;
> > > + }
> > > +
> > > + *id = GET_BITFIELD(reg, 12, 14);
> > > + return 0;
> > > +#endif
> >
> > Doh ... I alwasy forget about IS_ENABLED(). This can be written:
> >
> >
> > int skx_get_src_id(struct skx_dev *d, int off, u8 *id) {
> > u32 reg;
> >
> > if (IS_ENABLED(CONFIG_NUMA))
> > return skx_get_pkg_id(d, id);
> >
> > if (pci_read_config_dword(d->util_all, off, ®)) {
> > skx_printk(KERN_ERR, "Failed to read src id\n");
> > return -ENODEV;
> > }
> >
> > *id = GET_BITFIELD(reg, 12, 14);
> > return 0;
> > }
>
> Looks good.
>
> > 1) Does this work? I tried on a non-clumpy system that is NUMA.
>
> Yes, I just tested this on a Sapphire Rapids system with multiple UPI domains.
>
> > 2) Is it better (assuming #fidef factored off into a .h file)?
>
> IMO, yes, but there's one subtle difference. EDAC will not load on systems that
> have a single UPI domain when CONFIG_NUMA is enabled but numa=off,
> because
> pcibus_to_node() in skx_get_pkg_id() will return NUMA_NO_NODE (-1). Is
> that a case that we need to worry about?
I think we need to make the EDAC load/work even in this case.
Regardless of CONFIG_NUMA or whether numa=off is set or not, could we do it like this:
int skx_get_src_id(struct skx_dev *d, int off, u8 *id)
{
u32 reg;
if (!skx_get_pkg_id(d, id))
return 0;
if (pci_read_config_dword(d->util_all, off, ®)) {
skx_printk(KERN_ERR, "Failed to read src id\n");
return -ENODEV;
}
*id = GET_BITFIELD(reg, 12, 14);
return 0;
}
-Qiuxu
Powered by blists - more mailing lists