public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Chen Yucong <slaoub@gmail.com>
Cc: hpa@zytor.com, tony.luck@intel.com, bp@alien8.de, x86@kernel.org,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] mcheck/therm_throt: Replace printk(KERN_XX...) with pr_xx(...)
Date: Mon, 1 Feb 2016 09:24:12 +0100	[thread overview]
Message-ID: <20160201082412.GA15735@gmail.com> (raw)
In-Reply-To: <20160201081951.GA14977@gmail.com>


(changed the subject to be lkml compatible. Mail quoted below.)

* Ingo Molnar <mingo@kernel.org> wrote:

> 
> * Chen Yucong <slaoub@gmail.com> wrote:
> 
> > This patch also has replaced one more printk_once() with pr_info_once().
> > 
> > Signed-off-by: Chen Yucong <slaoub@gmail.com>
> > ---
> >  arch/x86/kernel/cpu/mcheck/therm_throt.c | 13 ++++++-------
> >  1 file changed, 6 insertions(+), 7 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > index 2c5aaf8..6cc5eed 100644
> > --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > @@ -190,7 +190,7 @@ static int therm_throt_process(bool new_event, int event, int level)
> >  	/* if we just entered the thermal event */
> >  	if (new_event) {
> >  		if (event == THERMAL_THROTTLING_EVENT)
> > -			printk(KERN_CRIT "CPU%d: %s temperature above threshold, cpu clock throttled (total events = %lu)\n",
> > +			pr_crit("CPU%d: %s temperature above threshold, cpu clock throttled (total events = %lu)\n",
> >  				this_cpu,
> >  				level == CORE_LEVEL ? "Core" : "Package",
> >  				state->count);
> > @@ -198,7 +198,7 @@ static int therm_throt_process(bool new_event, int event, int level)
> >  	}
> >  	if (old_event) {
> >  		if (event == THERMAL_THROTTLING_EVENT)
> > -			printk(KERN_INFO "CPU%d: %s temperature/speed normal\n",
> > +			pr_info("CPU%d: %s temperature/speed normal\n",
> >  				this_cpu,
> >  				level == CORE_LEVEL ? "Core" : "Package");
> >  		return 1;
> > @@ -417,8 +417,7 @@ static void intel_thermal_interrupt(void)
> >  
> >  static void unexpected_thermal_interrupt(void)
> >  {
> > -	printk(KERN_ERR "CPU%d: Unexpected LVT thermal interrupt!\n",
> > -			smp_processor_id());
> > +	pr_err("CPU%d: Unexpected LVT thermal interrupt!\n", smp_processor_id());
> >  }
> >  
> >  static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
> > @@ -499,7 +498,7 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
> >  
> >  	if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
> >  		if (system_state == SYSTEM_BOOTING)
> > -			printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n", cpu);
> > +			pr_debug("CPU%d: Thermal monitoring handled by SMI\n", cpu);
> >  		return;
> >  	}
> >  
> > @@ -557,8 +556,8 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
> >  	l = apic_read(APIC_LVTTHMR);
> >  	apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
> >  
> > -	printk_once(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
> > -		       tm2 ? "TM2" : "TM1");
> > +	pr_info_once("CPU0: Thermal monitoring enabled (%s)\n",
> > +		      tm2 ? "TM2" : "TM1");
> >  
> >  	/* enable thermal throttle processing */
> >  	atomic_set(&therm_throt_en, 1);
> 
> So there are 37,000+ printk() calls in the kernel and 900+ ones in arch/x86/ 
> alone! Plus even after this patch there's 20 more printk()s left in 
> arch/x86/kernel/cpu/mcheck/...
> 
> We don't want to create a churn of 10,000+ commits to convert them to pr_*() 
> facilities...
> 
> So we don't apply such 'conversion' patches unless it's done for a whole subsystem 
> and done as part of a larger work with good reason, or if it's done as part of 
> completely new facilities/drivers - and is done consistently.
> 
> Even then it's dubious to convert: people keep re-adding printk()s (which is a 
> perfectly fine facility), which generates never ending churn ...
> 
> Thanks,
> 
> 	Ingo

       reply	other threads:[~2016-02-01  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1454312473-2685-1-git-send-email-slaoub@gmail.com>
     [not found] ` <20160201081951.GA14977@gmail.com>
2016-02-01  8:24   ` Ingo Molnar [this message]
2016-02-01  9:38     ` [PATCH] mcheck/therm_throt: Replace printk(KERN_XX...) with pr_xx(...) Borislav Petkov

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=20160201082412.GA15735@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slaoub@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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