[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170601174951.euhsf6hpj37egmyo@pd.tnic>
Date: Thu, 1 Jun 2017 19:49:51 +0200
From: Borislav Petkov <bp@...en8.de>
To: Yazen Ghannam <Yazen.Ghannam@....com>
Cc: linux-edac@...r.kernel.org, Tony Luck <tony.luck@...el.com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86/mce/AMD: Use saved threshold block info in
interrupt handler
On Wed, May 31, 2017 at 09:11:55AM -0500, Yazen Ghannam wrote:
> From: Yazen Ghannam <yazen.ghannam@....com>
>
> In the amd_threshold_interrupt() handler, we loop through every possible
> block in each bank and rediscover the block's address and if it's valid,
> e.g. valid, counter present and not locked. However, we already have the
> address saved in the threshold blocks list for each CPU and bank. The list
> only contains blocks that have passed all the valid checks.
>
> Besides the redundancy, there's also a smp_call_function* in
> get_block_address() and this causes a warning when servicing the interrupt.
>
> WARNING: CPU: 0 PID: 0 at kernel/smp.c:281 smp_call_function_single+0xdd/0xf0
> ...
> Call Trace:
> <IRQ>
> rdmsr_safe_on_cpu+0x5d/0x90
> get_block_address.isra.2+0x97/0x100
> amd_threshold_interrupt+0xae/0x220
> smp_threshold_interrupt+0x1b/0x40
> threshold_interrupt+0x89/0x90
>
> Drop the redundant valid checks and move the overflow check, logging and
> block reset into a separate function.
>
> Check the first block then iterate over the rest. This procedure is needed
> since the first block is used as the head of the list.
>
> Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
> ---
> Link:
> https://lkml.kernel.org/r/1495658507-7413-3-git-send-email-Yazen.Ghannam@amd.com
>
> Link for patch 2:
> https://lkml.kernel.org/r/1495658507-7413-2-git-send-email-Yazen.Ghannam@amd.com
>
> v1->v2:
> * Drop patch 2 from the first set.
> * Rather than iterating through all blocks in the list, check the first
> and iterate over the rest. This way we don't need to have an external
> list_head.
>
> arch/x86/kernel/cpu/mcheck/mce_amd.c | 64 ++++++++++++++++++++----------------
> 1 file changed, 35 insertions(+), 29 deletions(-)
Much better!
Applied, thanks.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists