lkml.org 
[lkml]   [2023]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors
On Fri, Apr 7, 2023 at 12:46 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
...
> But I don't think we need output in a single step; we just need a
> single instance of ratelimit_state (or one for CPER path and another
> for native AER path), and that can control all the output for a single
> error. E.g., print_hmi_event_info() looks like this:
>
> static void print_hmi_event_info(...)
> {
> static DEFINE_RATELIMIT_STATE(rs, ...);
>
> if (__ratelimit(&rs)) {
> printk("%s%s Hypervisor Maintenance interrupt ...");
> printk("%s Error detail: %s\n", ...);
> printk("%s HMER: %016llx\n", ...);
> }
> }
>
> I think it's nice that the struct ratelimit_state is explicit and
> there's no danger of breaking it when adding another printk later.

Since the output is spread across at least two functions, I think your
proposal is a better solution.

I'm not happy with the patch series I sent in my previous reply as an
attachment. It's only marginally better than the original code.

I need another day or two to see if I can implement your proposal correctly.

cheers,
grant

\
 
 \ /
  Last update: 2023-05-18 08:12    [W:0.088 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site