Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2450536rwb; Thu, 29 Sep 2022 10:18:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75nCtE38e3MhxvjxuCCy+MWoiOsrC3+a1EaGnJs3pTmAI+FXDnj+Au/JbLZUHkJh1dr05m X-Received: by 2002:a17:906:8473:b0:77b:efa8:50e4 with SMTP id hx19-20020a170906847300b0077befa850e4mr3465866ejc.250.1664471886802; Thu, 29 Sep 2022 10:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664471886; cv=none; d=google.com; s=arc-20160816; b=AuhmDNhuJvk4FhjWG5oTUtwfGc7la3jhWSzl6JUg1qUkwZuneOTN+zFrLeQqvWN6XH MfPEVFk/VwWx4g7mJWPl3PtcRqSye/HXAtX9fLd+g/68lWAO/8B3qnsrmKtSHvW1yoYj OE86UIo+g8gGKTBQs90ajkqyrwoNvrYgVxircGBxLpr1B9eqYjzRpauXj9J9qYRHhw0W 3aj5RXPeLuVVDJGBxsdlBae8U+H7pAURigxVk2oNFAw5bZ3PzIB3J9FP1TfvEAp011l6 +i4SazlGPWNiu2FAdlcl25KGTK0fTNht6fZl4a8IsxTt93VuT1mfhnjQYmI8OQK2bVYj 3dLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=QYOc+OHLL6KTLMFJnSaBlHOJKuyxaHY1IrKcRU6FlxE=; b=kKxf6ZNoTfTgZYmoOahpjYSmHsz1GqB1Oha2sUQf9riXa+VBbVA1LBFPjlra6KlA8S 9vkHHyHLrHuwd6PBM0Akp3lTRIHWm2FI+t1alT9Q/MwqCUJsIib56yny+xcK6Mq+UCLA 5lcSjNYNF4sA3Qvm7Q9LkmVN/tQEyjvY1oToB9IYsco5mrusPjKfHRFRO2WL1l3EJ912 ioXpIx0xEInMKIiSW1OYxgT3zZFYFaIon7HRvgRmy/NI8Itvhx/Vlsuz31gMrbHtisYt xpNr6srbbFGB0zR2RrVAbsELBVyWctc/m5bTwwVDPV0+68xTNbwMdqZlzm0AdK1RtJWL hcZg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a05640250cd00b00457dbbf8336si28650edb.456.2022.09.29.10.17.39; Thu, 29 Sep 2022 10:18:06 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232007AbiI2QaY (ORCPT + 99 others); Thu, 29 Sep 2022 12:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235139AbiI2Q3c (ORCPT ); Thu, 29 Sep 2022 12:29:32 -0400 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57CDD135057; Thu, 29 Sep 2022 09:28:58 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id o5so1330628wms.1; Thu, 29 Sep 2022 09:28:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=QYOc+OHLL6KTLMFJnSaBlHOJKuyxaHY1IrKcRU6FlxE=; b=CWRRvBk7e6CRy+HWfhbVqQBhfq7vHbBhR3wLtt0iFVoC7McAoLtFTGBSXOlVSW24/2 TFMTMrsrFdEkibFX+Bp9vkxV6M9TOvxvMcpeePLx2dqqEtyh/6TSNGGCj+JCpQm2G+ia mAvL38nkXYRIJXLMa4LcH8EujtvXA/lWt8aLzVhBeXzH9LkMiu2uAiruY8dmrCwq9VaU AsOPRXto0XNPkt0V+bBvJw7VY1+Zlnm+OGEeRxKwZ7lWP/v4XajMg78ncbhnntmP31HQ F3cxb5Kl8Y2VMp0apHWRHOk09VKXsuq0s71kkPagBvhvHQlgPDcptqxypU5NrtD34zkO qD3Q== X-Gm-Message-State: ACrzQf0Rburto51+srZIVNcUZVBAzPAtauIJZZBSIVUep7TvQfnizvDn urA/3oBxVS6lhBXJ0l5POLU= X-Received: by 2002:a05:600c:a14e:b0:3b4:7ff1:299b with SMTP id ib14-20020a05600ca14e00b003b47ff1299bmr11387647wmb.18.1664468935378; Thu, 29 Sep 2022 09:28:55 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id q14-20020adfea0e000000b00228d7078c4esm7232054wrm.4.2022.09.29.09.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 09:28:54 -0700 (PDT) Date: Thu, 29 Sep 2022 16:28:53 +0000 From: Wei Liu To: Saurabh Singh Sengar Cc: Thomas Zimmermann , 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, Wei Liu Subject: Re: [PATCH] drm/hyperv: Add ratelimit on error message Message-ID: References: <1662736193-31379-1-git-send-email-ssengar@linux.microsoft.com> <88fab56a-f6e5-bae0-5ed7-1e01c070d136@suse.de> <20220911161142.GA7754@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220911161142.GA7754@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 On Sun, Sep 11, 2022 at 09:11:42AM -0700, Saurabh Singh Sengar wrote: > 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. Applied to hyperv-next. Thanks.