<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 17, 2023 at 11:11 PM Grant Grundler <<a href="mailto:grundler@chromium.org">grundler@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Apr 7, 2023 at 12:46 PM Bjorn Helgaas <<a href="mailto:helgaas@kernel.org" target="_blank">helgaas@kernel.org</a>> wrote:<br>
...<br>
> But I don't think we need output in a single step; we just need a<br>
> single instance of ratelimit_state (or one for CPER path and another<br>
> for native AER path), and that can control all the output for a single<br>
> error. E.g., print_hmi_event_info() looks like this:<br>
><br>
> static void print_hmi_event_info(...)<br>
> {<br>
> static DEFINE_RATELIMIT_STATE(rs, ...);<br>
><br>
> if (__ratelimit(&rs)) {<br>
> printk("%s%s Hypervisor Maintenance interrupt ...");<br>
> printk("%s Error detail: %s\n", ...);<br>
> printk("%s HMER: %016llx\n", ...);<br>
> }<br>
> }<br>
><br>
> I think it's nice that the struct ratelimit_state is explicit and<br>
> there's no danger of breaking it when adding another printk later.<br>
<br>
Since the output is spread across at least two functions, I think your<br>
proposal is a better solution.<br>
<br>
I'm not happy with the patch series I sent in my previous reply as an<br>
attachment. It's only marginally better than the original code.<br></blockquote><div><br></div><div>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.</div><div><br></div><div>I'll post a V3 of this series tonight after making sure it at least compiles and "looks right".</div><div><br></div><div>cheers,</div><div>grant</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I need another day or two to see if I can implement your proposal correctly.<br>
<br>
cheers,<br>
grant<br>
</blockquote></div></div>