[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANEJEGscz3F-6cZcp7dBVekpxHMNXZWgUW2ic3xd6hm3xWH6ZQ@mail.gmail.com>
Date: Wed, 17 May 2023 23:11:37 -0700
From: Grant Grundler <grundler@...omium.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Grant Grundler <grundler@...omium.org>,
Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
"Oliver O 'Halloran" <oohall@...il.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rajat Jain <rajatja@...omium.org>,
Rajat Khandelwal <rajat.khandelwal@...ux.intel.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [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@...nel.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
Powered by blists - more mailing lists