[PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors

Grant Grundler grundler at chromium.org
Tue Jun 6 13:44:10 AEST 2023


On Wed, May 17, 2023 at 11:11 PM Grant Grundler <grundler at chromium.org>
wrote:

> On Fri, Apr 7, 2023 at 12:46 PM Bjorn Helgaas <helgaas at 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.
>

Despite not being happy about it, after a week of vacation I now think it
would be better to include them as is since they solve the immediate
problems and then solve the above two issues in additional patches. The two
changes I have prepared so far correctly fix the original issues they
intended to fix and don't affect the new issues we've found.

I'll post a V3 of this series tonight after making sure it at least
compiles and "looks right".

cheers,
grant


> I need another day or two to see if I can implement your proposal
> correctly.
>
> cheers,
> grant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20230605/6bae16a4/attachment-0001.htm>


More information about the Linuxppc-dev mailing list