From patchwork Tue Jan 17 11:53:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13104548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FB0FC3DA78 for ; Tue, 17 Jan 2023 11:54:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C28AF10E4A7; Tue, 17 Jan 2023 11:54:02 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9967C10E4A4; Tue, 17 Jan 2023 11:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673956439; x=1705492439; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zY6x6erYncaDzv05B6FWcty+zwpT4FccOl8jUshpKkY=; b=MD9CJbUYBvcmTk1jM06Kutw135Zj6feFOcAJdr1HGLXcdO2OHexB2UN2 /nqN1kJj5/u/Ug3LCJxLnz4Aj3urjXAzkM8jNxbGoatFi7wCq/UR0AoOL kNoh7lB4p6jYVQ2L1QjVYCef0u+a559/hdi2Eqh1ZZrl2Gw5GeX0UIhlt cYK0GQA9EILJ/qzPV/qsBSWXvSGNAdB8q+u3tv5rie+HPAop2jwhGU9mz JrMiowoK/OTiw8w7N8rb5yS8nIALm58Ns1detsgQVsdN+BrOgo+IUY6M8 1TVpWYs1cuxRJWpiWQDy3/GcdufeSwqPHzp9iVODuNIckItvNgAzoir8+ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="326744746" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="326744746" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 03:53:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="767251895" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="767251895" Received: from nirmoyda-desk.igk.intel.com ([10.102.42.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 03:53:56 -0800 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Jan 2023 12:53:49 +0100 Message-Id: <20230117115350.1071-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH 1/2] drm/print: Add drm_dbg_ratelimited X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Matthew Auld , Maxime Ripard , dri-devel@lists.freedesktop.org, Thomas Zimmermann , David Airlie , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add a function for ratelimitted debug print. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Matthew Auld Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Reviewed-by: Sam Ravnborg --- include/drm/drm_print.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a44fb7ef257f..1d839f507319 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -602,6 +602,9 @@ void __drm_err(const char *format, ...); drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__); \ }) +#define drm_dbg_ratelimited(drm, fmt, ...) \ + __DRM_DEFINE_DBG_RATELIMITED(DRIVER, drm, fmt, ## __VA_ARGS__) + #define drm_dbg_kms_ratelimited(drm, fmt, ...) \ __DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__) From patchwork Tue Jan 17 11:53:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13104547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBCDCC3DA78 for ; Tue, 17 Jan 2023 11:54:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2588010E4A3; Tue, 17 Jan 2023 11:54:02 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 251F410E4A7; Tue, 17 Jan 2023 11:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673956440; x=1705492440; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a2PrZR1jiz8LYR3o3jCE3Q/50K+woVErDZP+Cs7VUzU=; b=PyfTk47CdGaWTnM1v0FiTDb8+EkZl1aiCgSJTVCAGArFWmyRyoZqIUps n3mcCclDLHAgNNQKksnEm3SLsCcrc/1xaWshePiCJiToFpheMldNxkQf2 HLXJJawtyneIqgmSGj87hlZwzDMXepOMMiuNe14bgkMPSRCmj6tu7HCVO 0nEyi2wtyZlFDfLF9Yt+UJupdbpamcSrcqVWRN8oiTbEQgW0Lj2bO4iSN xQQ/YOU4nWvjrC7FaKfTbkMjH5pnqLJX32QyNvuf6OszdaVU0bCtk7ILq 7nS1tV27WzoKMeXjQCZdDzBuGHLm+eha47YwUaQYTecZGF8/2q11vS3iY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="326744753" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="326744753" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 03:53:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="767251903" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="767251903" Received: from nirmoyda-desk.igk.intel.com ([10.102.42.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 03:53:58 -0800 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Jan 2023 12:53:50 +0100 Message-Id: <20230117115350.1071-2-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230117115350.1071-1-nirmoy.das@intel.com> References: <20230117115350.1071-1-nirmoy.das@intel.com> MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Ratelimit debug log in vm_fault_ttm X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Auld , dri-devel@lists.freedesktop.org, Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Test like i915_gem_mman_live_selftests/igt_mmap_migrate can cause dmesg spamming. Use ratelimit api to reduce log rate. References: https://gitlab.freedesktop.org/drm/intel/-/issues/7038 Cc: Matthew Auld Reviewed-by: Matthew Auld Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 8cfed1bef629..25294ddbee46 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -1077,8 +1077,9 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) } if (err) { - drm_dbg(dev, "Unable to make resource CPU accessible(err = %pe)\n", - ERR_PTR(err)); + drm_dbg_ratelimited(dev, + "Unable to make resource CPU accessible(err = %pe)\n", + ERR_PTR(err)); dma_resv_unlock(bo->base.resv); ret = VM_FAULT_SIGBUS; goto out_rpm;