Linux EDAC development
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"x86@kernel.org" <x86@kernel.org>
Subject: [v2,4/6] x86/MCE: Make number of MCA banks per_cpu
Date: Tue, 16 Apr 2019 15:55:09 +0200	[thread overview]
Message-ID: <20190416135508.GG31772@zn.tnic> (raw)

On Thu, Apr 11, 2019 at 08:18:03PM +0000, Ghannam, Yazen wrote:
> @@ -1478,15 +1480,16 @@ EXPORT_SYMBOL_GPL(mce_notify_irq);
>  
>  static int __mcheck_cpu_mce_banks_init(void)
>  {
> +	u8 n_banks = this_cpu_read(mce_num_banks);
>  	int i;
>  
>  	per_cpu(mce_banks, smp_processor_id()) =
> -		kcalloc(MAX_NR_BANKS, sizeof(struct mce_bank), GFP_KERNEL);
> +		kcalloc(n_banks, sizeof(struct mce_bank), GFP_KERNEL);
>  
>  	if (!this_cpu_read(mce_banks))
>  		return -ENOMEM;
>  
> -	for (i = 0; i < MAX_NR_BANKS; i++) {
> +	for (i = 0; i < n_banks; i++) {
>  		struct mce_bank *b = &this_cpu_read(mce_banks)[i];
>  
>  		b->ctl = -1ULL;
> @@ -1507,10 +1510,15 @@ static int __mcheck_cpu_cap_init(void)
>  	rdmsrl(MSR_IA32_MCG_CAP, cap);
>  
>  	b = cap & MCG_BANKCNT_MASK;
> -	if (WARN_ON_ONCE(b > MAX_NR_BANKS))
> +	pr_debug("CPU%d supports %d MCE banks\n", smp_processor_id(), b);

What for?

You're removing the "Using" message because, yeah, it was worthless to
people. If anyone wants to count the banks:

$ ls /sys/devices/system/machinecheck/machinecheck0/bank* | wc -l
23

WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@alien8.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v2 4/6] x86/MCE: Make number of MCA banks per_cpu
Date: Tue, 16 Apr 2019 15:55:09 +0200	[thread overview]
Message-ID: <20190416135508.GG31772@zn.tnic> (raw)
Message-ID: <20190416135509.bLA8nP5yyVbCweP-krJxTv-9AbV7KmO0kTJO79uiifc@z> (raw)
In-Reply-To: <20190411201743.43195-5-Yazen.Ghannam@amd.com>

On Thu, Apr 11, 2019 at 08:18:03PM +0000, Ghannam, Yazen wrote:
> @@ -1478,15 +1480,16 @@ EXPORT_SYMBOL_GPL(mce_notify_irq);
>  
>  static int __mcheck_cpu_mce_banks_init(void)
>  {
> +	u8 n_banks = this_cpu_read(mce_num_banks);
>  	int i;
>  
>  	per_cpu(mce_banks, smp_processor_id()) =
> -		kcalloc(MAX_NR_BANKS, sizeof(struct mce_bank), GFP_KERNEL);
> +		kcalloc(n_banks, sizeof(struct mce_bank), GFP_KERNEL);
>  
>  	if (!this_cpu_read(mce_banks))
>  		return -ENOMEM;
>  
> -	for (i = 0; i < MAX_NR_BANKS; i++) {
> +	for (i = 0; i < n_banks; i++) {
>  		struct mce_bank *b = &this_cpu_read(mce_banks)[i];
>  
>  		b->ctl = -1ULL;
> @@ -1507,10 +1510,15 @@ static int __mcheck_cpu_cap_init(void)
>  	rdmsrl(MSR_IA32_MCG_CAP, cap);
>  
>  	b = cap & MCG_BANKCNT_MASK;
> -	if (WARN_ON_ONCE(b > MAX_NR_BANKS))
> +	pr_debug("CPU%d supports %d MCE banks\n", smp_processor_id(), b);

What for?

You're removing the "Using" message because, yeah, it was worthless to
people. If anyone wants to count the banks:

$ ls /sys/devices/system/machinecheck/machinecheck0/bank* | wc -l
23

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

         reply	other threads:[~2019-04-16 13:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 20:18 [PATCH v2 0/6] Handle MCA banks in a per_cpu way Ghannam, Yazen
2019-04-11 20:18 ` [v2,1/6] x86/MCE: Make struct mce_banks[] static Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 1/6] " Ghannam, Yazen
2019-04-11 20:18 ` [v2,2/6] x86/MCE: Handle MCA controls in a per_cpu way Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 2/6] " Ghannam, Yazen
2019-04-16 10:21   ` [v2,2/6] " Borislav Petkov
2019-04-16 10:21     ` [PATCH v2 2/6] " Borislav Petkov
2019-04-11 20:18 ` [v2,3/6] x86/MCE/AMD: Don't cache block addresses on SMCA systems Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 3/6] " Ghannam, Yazen
2019-04-16 13:44   ` [v2,3/6] " Borislav Petkov
2019-04-16 13:44     ` [PATCH v2 3/6] " Borislav Petkov
2019-04-11 20:18 ` [v2,4/6] x86/MCE: Make number of MCA banks per_cpu Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 4/6] " Ghannam, Yazen
2019-04-16 13:55   ` Borislav Petkov [this message]
2019-04-16 13:55     ` Borislav Petkov
2019-04-16 17:36   ` [v2,4/6] " Borislav Petkov
2019-04-16 17:36     ` [PATCH v2 4/6] " Borislav Petkov
2019-04-11 20:18 ` [v2,6/6] x86/MCE: Treat MCE bank as initialized if control bits set in hardware Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 6/6] " Ghannam, Yazen
2019-04-11 20:18 ` [v2,5/6] x86/MCE: Save MCA control bits that get " Yazen Ghannam
2019-04-11 20:18   ` [PATCH v2 5/6] " Ghannam, Yazen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190416135508.GG31772@zn.tnic \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox