Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6544500rwd; Mon, 5 Jun 2023 21:05:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7DFsaUv4lCwN3crQVJ9uYOI6cwCml7KS+2rb92Gjg9GK9I9tGm219JFKdsnV06okmNe7L6 X-Received: by 2002:a05:6214:21ea:b0:623:8d60:da6d with SMTP id p10-20020a05621421ea00b006238d60da6dmr839583qvj.52.1686024358040; Mon, 05 Jun 2023 21:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686024358; cv=none; d=google.com; s=arc-20160816; b=qld9PXnxpRvaOqoIDoeVmQut/YeuYIaxuRYK9Vb2OeYgg62eBUgBJg9frsHdJjmD7g Wo67WafOmhT3CWDiceh6Q5G1X0oDWx13BU8grYpSOakoWm4T0KCTHc3ZwBeobKvNrmQh zf1GgBzqiESe7GAQTgW0Uhrc9j0NARIjgzlE/5GZRqGVxmbICW39I6E2BREALndJ/09e Rsyqd7eaIgUKQVlnua/R1Jhtx9u90FmQwZSs7uu54RrU4rcTnnNH1yc9haTnVNm3/oOX GIDHsmn9D6yvhUUf8bOp/jEaJvrH1fa1js8TI+fTa21hKacu8FULL3rTni5eGEP/anXK lGIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MODHFUV4L/O4bsTMBgQrkhxsTETNlqjXeaBSjrqN1Uk=; b=Hku5GyqaE4wvWBYfohjaJABBkC2Xhu0AwyCKoORtd+aWMbieKvtLekAz8fB3pVBF5Z aw7VdwCkZpOOKDCeiMdI3oSaWTmBpPZd/W45Hpw7IE5hH2Lsp1oj/P0dnc+0hPCQuziK on2cfZjk1Dc6mx0478Hv/AUek5/F38yFlaJFuI/uK98IyrAQb4O0BbrAQhQYekSPTPFT WdfUVmerbJfDO6d1OfKlLUf0UrlBAxVglLSGRmbvvWE+yVsenScXdGgzImTwnFj4/K7s CEzHXixVBcNeE5LqDZLvfw7h2J5Bn/OLcw6GrE3nSNGZOAJboDOABxZav53avKEkaet1 yMIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=frxgAGfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a056214224900b005ad4f60da65si5739848qvc.432.2023.06.05.21.05.43; Mon, 05 Jun 2023 21:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=frxgAGfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbjFFDpx (ORCPT + 99 others); Mon, 5 Jun 2023 23:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbjFFDpv (ORCPT ); Mon, 5 Jun 2023 23:45:51 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2BB12A for ; Mon, 5 Jun 2023 20:45:48 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f7024e66adso21755e9.1 for ; Mon, 05 Jun 2023 20:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686023147; x=1688615147; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MODHFUV4L/O4bsTMBgQrkhxsTETNlqjXeaBSjrqN1Uk=; b=frxgAGfrDnlTrD42lcQ7EhX80pQETt7hpvj8GDOShd8Qm3LsLOQhXG9GktUcX8+aAN FESb+VQ/W9n8KrHbpJ/yssGP8pyUvUeQsV7z7n5BZPAI6DaZ3XBaeGnKrlvJjMPzxL08 ixdCgE2ARx1DbXxdv89dCRKsmHzSiD8mlk3F8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686023147; x=1688615147; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MODHFUV4L/O4bsTMBgQrkhxsTETNlqjXeaBSjrqN1Uk=; b=Ftsa6LQlKDhMq8EVgJrFrUwf5TiR53G3f/BFBJjRbD0++/eEfltwcgmxl9tfzIKcCB +qPohb2rGmTzaSdOLBgD/CExRu3R9akPOw7OOiDqV4oJzeEDjDoVCH24F1Kp6215Ty3a akSWq/TjnLO5S8SjtfVkar2ULXg0Dnp/ObA4EXq0qmr8r/7kFx475A/r0fOukRUrY6Y5 VDtLQlXqZWYjh7Qrsv7CY5NXT+KN30Us6EK/dG/6tJYUAcLiojngZ6TgjBlMAhLt7fNC M8QoEEKmqSSlLyQHv5RFhr2NFwJCx1EiwXgt7dQe7OF4LOrHeKLC1OkKw6xDmmRlWFsg RBRg== X-Gm-Message-State: AC+VfDzAhGpymytPf5m+MxL89z8pqjxrioj9k9chLYBwUZ7CPDQvSy2M sMD3Rjbdpfo5oBnVWF09SXTfTRfw4hhtzj0j8A7svQ== X-Received: by 2002:a05:600c:3b90:b0:3f7:ba55:d038 with SMTP id n16-20020a05600c3b9000b003f7ba55d038mr115349wms.6.1686023147021; Mon, 05 Jun 2023 20:45:47 -0700 (PDT) MIME-Version: 1.0 References: <20230407194645.GA3814486@bhelgaas> In-Reply-To: From: Grant Grundler Date: Mon, 5 Jun 2023 20:45:34 -0700 Message-ID: Subject: Re: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors To: Grant Grundler Cc: Bjorn Helgaas , Mahesh J Salgaonkar , "Oliver O 'Halloran" , Bjorn Helgaas , Rajat Jain , Rajat Khandelwal , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED,USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [plain text only this time...] On Wed, May 17, 2023 at 11:11=E2=80=AFPM Grant Grundler wrote: > > On Fri, Apr 7, 2023 at 12:46=E2=80=AFPM Bjorn Helgaas 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 correct= ly. > > cheers, > grant