Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4312240rwn; Sun, 11 Sep 2022 09:15:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bb+URdaXENMwkcSlSjGxic4EeatbSoar79iYatJsRPnT4EBEwYmycXaicowuaOmzUAIc/ X-Received: by 2002:a17:907:1dcc:b0:77a:c5f3:708b with SMTP id og12-20020a1709071dcc00b0077ac5f3708bmr6096137ejc.331.1662912938974; Sun, 11 Sep 2022 09:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662912938; cv=none; d=google.com; s=arc-20160816; b=Eb+ZV+T7nKV8TF9eB3ka8M61lVI5G8DupJcoyPbqZ301OIpXEALqjbFhpDqRGXUr70 8fGXF/GyALfmxyRK8qVgd4ASDnJLgEL/fASBG8JT/gCaYGb4qKi6cpTZgR3lPPaqEYnf erWbBxxI/kIY+thW6jECdjqFiuBMK//7r7IleespCMvD57UVv3STgdFfLZ49y9mDbbdK Nwor9WCxP15T1Yeh+PMnFJmu9+dRuFsCyv/ApngEvt14evWQXD4TkdBkWkvwmKR+Royw NKRAlDXfuth8mPzx9GBqeMfWbYYWePv/3NtXodlyzIf1ytu/AUjnJlfYO0/aU1rQWdyG IXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-filter; bh=tbufdYlVkrxrgw5goic8vel2LLNei+DjBORn6M2dN/s=; b=0GcSj3LI/V+NCes58ojfA2TMPRdayWTzXmSbCRZrxuXIX8NihKBQv2ww0T5TwYEHyT Ys1nPrW6s4+H/TjFt7eaUt2xz+FogvPYG5Mt5HikrEkxT23dqwoKN2mOy3d3z87ueg8n l5fq4qwuUiq/5U/Ygp0jQvKfrIMd+gXYciBRnItsc1VYI17VBvoWZnn+ERLJ4tYYe+k0 Tfyg887YegqyxQGdS4jKyPhbBDzMgQ8SKZrs7iikiUfIL+Kf1w/8l8l5oCE1ldTptMI7 J3xB0ToOp5Q3GFMgQpu1iceVGFS9TSzbUidoZKkeZBsV9Ax7CW/QJjO3IiNzAeO9n0kX S3fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=nAHaIi4v; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb38-20020a170907162600b00734be0ce32esi4977944ejc.688.2022.09.11.09.15.14; Sun, 11 Sep 2022 09:15:38 -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=@linux.microsoft.com header.s=default header.b=nAHaIi4v; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbiIKQLq (ORCPT + 99 others); Sun, 11 Sep 2022 12:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbiIKQLo (ORCPT ); Sun, 11 Sep 2022 12:11:44 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 699762AE3B; Sun, 11 Sep 2022 09:11:43 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1127) id D0162204C3EA; Sun, 11 Sep 2022 09:11:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D0162204C3EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1662912702; bh=tbufdYlVkrxrgw5goic8vel2LLNei+DjBORn6M2dN/s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nAHaIi4vSezJ1hTgheHnhncmVbrJcaVj8tDKgAHysmin9y2CVNTWuyvsHTpShaA1P CcCPmmTMaZ5rVYvuHhmAT8x4Lrh9gaiSi+vIvJiUDUtoAKu2Sp4Che2pVn3MiafCNy xIKZYj3hhFA8YE9N9a1I48WpY2WusxME/rggy6B8= Date: Sun, 11 Sep 2022 09:11:42 -0700 From: Saurabh Singh Sengar To: Thomas Zimmermann Cc: ssengar@microsoft.com, drawat.floss@gmail.com, airlied@linux.ie, daniel@ffwll.ch, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com Subject: Re: [PATCH] drm/hyperv: Add ratelimit on error message Message-ID: <20220911161142.GA7754@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1662736193-31379-1-git-send-email-ssengar@linux.microsoft.com> <88fab56a-f6e5-bae0-5ed7-1e01c070d136@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <88fab56a-f6e5-bae0-5ed7-1e01c070d136@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham 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 On Sat, Sep 10, 2022 at 08:06:05PM +0200, Thomas Zimmermann wrote: > Hi > > Am 09.09.22 um 17:09 schrieb Saurabh Sengar: > >Due to a full ring buffer, the driver may be unable to send updates to > >the Hyper-V host. But outputing the error message can make the problem > >worse because console output is also typically written to the frame > >buffer. > >Rate limiting the error message, also output the error code for additional > >diagnosability. > > > >Signed-off-by: Saurabh Sengar > >--- > > drivers/gpu/drm/hyperv/hyperv_drm_proto.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c b/drivers/gpu/drm/hyperv/hyperv_drm_proto.c > >index 76a182a..013a782 100644 > >--- a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c > >+++ b/drivers/gpu/drm/hyperv/hyperv_drm_proto.c > >@@ -208,7 +208,7 @@ static inline int hyperv_sendpacket(struct hv_device *hdev, struct synthvid_msg > > VM_PKT_DATA_INBAND, 0); > > if (ret) > >- drm_err(&hv->dev, "Unable to send packet via vmbus\n"); > >+ drm_err_ratelimited(&hv->dev, "Unable to send packet via vmbus; error %d\n", ret); > > I better option would probably be drm_err_once(). Then you'd get the > first error message and skip all others. Thanks for your comment however the intention here is to limit the printk messages and break the chain rather then printing only once. There can be cases where at different point of time we again get a ring buffer full condition and we don't want to miss that. We should get the message for each of these errror which are widely-separated in time not just the first time. > > Best regards > Thomas > > > return ret; > > } > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 N?rnberg, Germany > (HRB 36809, AG N?rnberg) > Gesch?ftsf?hrer: Ivo Totev