From: Yazen Ghannam <yazen.ghannam@amd.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"Smita.KoralahalliChannabasappa@amd.com"
<Smita.KoralahalliChannabasappa@amd.com>
Subject: Re: [PATCH] x86/mce: Increase maximum number of banks to 64
Date: Mon, 24 Aug 2020 10:11:05 -0500 [thread overview]
Message-ID: <20200824151105.GA3478291@yaz-nikka.amd.com> (raw)
In-Reply-To: <6ecac9c40d7b4491b9a87c8927a4aca6@intel.com>
On Thu, Aug 20, 2020 at 06:15:15PM +0000, Luck, Tony wrote:
> >> How much does vmlinux size grow with your change?
> >>
> >
> > It seems to get smaller.
> >
> > -rwxrwxr-x 1 yghannam yghannam 807634088 Aug 20 17:51 vmlinux-32banks
> > -rwxrwxr-x 1 yghannam yghannam 807634072 Aug 20 17:50 vmlinux-64banks
>
> You need to run:
>
> $ size vmlinux
> text data bss dec hex filename
> 20334755 12569682 14798924 47703361 2d7e541 vmlinux
>
> Likely the extra space is added to the third element ("bss"). That doesn't show
> up in the vmlinux file, but does add to memory footprint while running.
Thanks. Yeah, they're identical:
text data bss dec hex filename
15710076 13519306 5398528 34627910 2106146 vmlinux-32banks
15710076 13519306 5398528 34627910 2106146 vmlinux-64banks
I did a quick audit of the statically allocated data structures which
use MAX_NR_BANKS.
Global bitmaps:
- core.c / mce_banks_ce_disabled
- core.c / all_banks
- core.c / valid_banks
- core.c / toclear
- Total: 32 new bits * 4 bitmaps = 16 new bytes
Per-CPU bitmaps:
- core.c / mce_poll_banks
- intel.c / mce_banks_owned
- Total: 32 new bits * 2 bitmaps = 8 new bytes
The bitmaps are arrays of longs. So this change will only affect 32-bit
execution (I assume), since there will be one additional long used.
There will be no additional memory use on 64-bit execution, because the
size of long is 64 bits.
Global structs:
- amd.c / struct smca_bank smca_banks[]: 16 bytes per bank
- core.c / struct mce_bank_dev mce_bank_devs[]: 56 bytes per bank
- Total: 32 new banks * (16 + 56) bytes = 2304 new bytes
Per-CPU structs:
- core.c / struct mce_bank mce_banks_array[]: 16 bytes per bank
- Total: 32 new banks * 16 bytes = 512 new bytes
32-bit
Total global size increase: 2320 bytes
Total per-CPU size increase: 520 bytes
64-bit
Total global size increase: 2304 bytes
Total per-CPU size increase: 512 bytes
Is this okay?
Thanks,
Yazen
next prev parent reply other threads:[~2020-08-24 15:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 17:06 [PATCH] x86/mce: Increase maximum number of banks to 64 Yazen Ghannam
2020-08-20 17:15 ` Borislav Petkov
2020-08-20 18:00 ` Yazen Ghannam
2020-08-20 18:15 ` Luck, Tony
2020-08-24 15:11 ` Yazen Ghannam [this message]
2020-08-25 18:34 ` Borislav Petkov
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=20200824151105.GA3478291@yaz-nikka.amd.com \
--to=yazen.ghannam@amd.com \
--cc=Smita.KoralahalliChannabasappa@amd.com \
--cc=bp@alien8.de \
--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;
as well as URLs for NNTP newsgroup(s).