mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Fuqian Huang <huangfq.daxian@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: use trace_printk rather than printk in drm_dbg.
Date: Tue, 30 Jul 2019 23:06:22 -0700	[thread overview]
Message-ID: <520bd0f7367e77ffd2e0150187f6ffb64b0e8b71.camel@perches.com> (raw)
In-Reply-To: <20190731024533.22264-1-huangfq.daxian@gmail.com>

On Wed, 2019-07-31 at 10:45 +0800, Fuqian Huang wrote:
> In drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c,
> amdgpu_ih_process calls DRM_DEBUG which calls drm_dbg and
> finally calls printk.
> As amdgpu_ih_process is called from an interrupt handler,
> and interrupt handler should be short as possible.
> 
> As printk may lead to bogging down the system or can even
> create a live lock. printk should not be used in IRQ context.
> Instead, trace_printk is recommended.
> Link: https://lwn.net/Articles/365835
[]
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
[]
> @@ -236,7 +236,7 @@ void drm_dbg(unsigned int category, const char *format, ...)
>  	vaf.fmt = format;
>  	vaf.va = &args;
>  
> -	printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV",
> +	trace_printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV",
>  	       __builtin_return_address(0), &vaf);
>  
>  	va_end(args);

This makes all 4000+ drm_dbg/DRM_DEBUG uses emit
a trace_printk.

I suggest instead you make only the interrupt uses
use a different function and not drm_dbg.

Or maybe add an in_interrupt() check like

	if (in_interrupt())
		printk(KERN_DEBUG etc...)
	else
		trace_printk(etc...)




  reply	other threads:[~2019-07-31  6:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  2:45 Fuqian Huang
2019-07-31  6:06 ` Joe Perches [this message]
2019-07-31  6:26   ` Fuqian Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=520bd0f7367e77ffd2e0150187f6ffb64b0e8b71.camel@perches.com \
    --to=joe@perches.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=huangfq.daxian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®