Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5661184ybi; Wed, 31 Jul 2019 01:13:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCbUxRGB53slolYZ7+a816x5Hi8AjZib/NrKsv/8yu1fALO6VAiynn9/va1pguLdrOwNcc X-Received: by 2002:a17:902:ea:: with SMTP id a97mr43628458pla.182.1564560798816; Wed, 31 Jul 2019 01:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564560798; cv=none; d=google.com; s=arc-20160816; b=0B3X6Cptf6eIjXvfqiYGfLZp3HuBhyrsU1+9EzgnC77pVY7e4AcrQZsO1gXB7N3jkj 7nUkNfTpe638RMj6qIqbYo0CW+okibyXAxV6ZsfNAMNCBFFeHWEhK5lQnDVcyyuDXEDn 7p5XbfbmGWuFQ0NrScdYES/oDUlxEpF0Qggn/rwE9T7PXJo3mm0keGLq0UDEcPJytdZi io560cim67+DbFGO0+KdfXCX2YavLjgbcvGweoAprp5zlGwk+ZC3PlAZ6CgAgrBpgHLy btM1h5RyAZ/6eQW2sAdyw2czSMXDXWgBdomEke8wDm9aqsZNb80+Ii5NI1Zzd8kjx8Bg wIGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=8f8bHa+1FLgr8AOu33Z8+6FDxKJNL+y9/1susg9TljI=; b=tAS+RspwAzmb8c+eARMLdM4fIc9d9fj6Dv/Cr05tUNQNo93dzHno5CJrlE9bhZva4E XE4QgTbTsH0/zLENoWDvg/NZhPmcmbVwg2rfjwcXkPPZsbBVc0NAYQP6Q/NK2E4rRtCC 1g5e3Iz+w6/gi28iA4RnmouDGiUFrLKT81AyQj8CaByrbWcABcgDidGRe+7q8cUQEAAu /aRQPPqwEKO4RKm3F9ULr+ths6nsQ+wFaFQjTLQWsST4FPfZUfR6u3+T30sCxd15lNhE 0cJB2MTR0HqZkyM7T+JgvngwPbawX1aGj7owAePb2VI9sZeN+GwmX9NugKnwdTB1djJ/ +bKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z27si20088931pfj.225.2019.07.31.01.13.03; Wed, 31 Jul 2019 01:13:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfGaGG1 (ORCPT + 99 others); Wed, 31 Jul 2019 02:06:27 -0400 Received: from smtprelay0045.hostedemail.com ([216.40.44.45]:56288 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725209AbfGaGG0 (ORCPT ); Wed, 31 Jul 2019 02:06:26 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 692871802E6E7; Wed, 31 Jul 2019 06:06:25 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:599:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2559:2563:2682:2685:2828:2859:2902:2904:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3873:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6119:9025:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12297:12438:12555:12740:12760:12895:13019:13069:13311:13357:13439:14181:14659:14721:21080:21433:21627:30054:30070:30090:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: door01_1ac50e83e2663 X-Filterd-Recvd-Size: 2235 Received: from XPS-9350 (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Wed, 31 Jul 2019 06:06:23 +0000 (UTC) Message-ID: <520bd0f7367e77ffd2e0150187f6ffb64b0e8b71.camel@perches.com> Subject: Re: [PATCH] drm: use trace_printk rather than printk in drm_dbg. From: Joe Perches To: Fuqian Huang Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 30 Jul 2019 23:06:22 -0700 In-Reply-To: <20190731024533.22264-1-huangfq.daxian@gmail.com> References: <20190731024533.22264-1-huangfq.daxian@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...)