From: Mike Travis <travis@sgi.com>
To: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>, Jack Steiner <steiner@sgi.com>,
Robin Holt <holt@sgi.com>, Len Brown <len.brown@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
Yinghai Lu <yhlu.kernel@gmail.com>,
linux-acpi@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] printk: Minimize time zero output
Date: Mon, 21 Feb 2011 12:56:19 -0800 [thread overview]
Message-ID: <4D62D173.8040805@sgi.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1102191733220.27722@chino.kir.corp.google.com>
David Rientjes wrote:
> On Fri, 18 Feb 2011, Mike Travis wrote:
>
>> Reduce the length for time zero messages by only printing "[0] ".
>>
>> v2: updated to apply to x86-tip
>>
>> Signed-off-by: Mike Travis <travis@sgi.com>
>> Reviewed-by: Jack Steiner <steiner@sgi.com>
>> Reviewed-by: Robin Holt <holt@sgi.com>
>> ---
>> kernel/printk.c | 11 ++++++++---
>> 1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> --- linux.orig/kernel/printk.c
>> +++ linux/kernel/printk.c
>> @@ -735,9 +735,14 @@ static inline int printk_emit_time(void)
>> unsigned long microsec_rem;
>>
>> t = cpu_clock(printk_cpu);
>> - microsec_rem = do_div(t, 1000000000) / 1000;
>> - tlen = sprintf(tbuf, "[%5lu.%06lu] ", (unsigned long)t, microsec_rem);
>> -
>> + if (likely(t)) {
>> + microsec_rem = do_div(t, 1000000000) / 1000;
>> + tlen = sprintf(tbuf, "[%5lu.%06lu] ",
>> + (unsigned long)t, microsec_rem);
>
> The definition of microsec_rem can become local to this clause.
Ok.
>
>> + } else {
>> + /* reduce byte count in log when time is zero */
>> + tlen = sprintf(tbuf, "[0] ");
>
> If we know the padding when cpu_clock() is non-zero, then why not make
> sure the kernel log is aligned properly by using the same padding here?
I'm not sure I understand what you are asking. The whole point of this
exercise is to remove bytes from the early log buffer so it does not
overflow. What would you like me to change?
>
>> + }
>> for (tp = tbuf; tp < tbuf + tlen; tp++)
>> emit_log_char(*tp);
>>
next prev parent reply other threads:[~2011-02-21 20:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-19 2:47 [PATCH 0/6] init: Shrink early messages to prevent overflowing the kernel log buffer Mike Travis
2011-02-19 2:47 ` [PATCH 1/6] ACPI: Minimize X2APIC initial messages Mike Travis
2011-02-20 1:50 ` David Rientjes
2011-02-21 20:42 ` Mike Travis
2011-02-22 0:13 ` David Rientjes
2011-02-19 2:47 ` [PATCH 2/6] x86: Minimize initial e820 messages Mike Travis
2011-02-20 1:51 ` David Rientjes
2011-02-21 20:50 ` Mike Travis
2011-02-22 0:13 ` David Rientjes
2011-02-22 18:43 ` Bjorn Helgaas
2011-02-19 2:47 ` [PATCH 3/6] x86: Minimize SRAT messages Mike Travis
2011-02-20 1:51 ` David Rientjes
2011-02-23 21:24 ` Mike Travis
2011-02-24 4:12 ` David Rientjes
2011-02-19 2:47 ` [PATCH 4/6] printk: Break out printk_time Mike Travis
2011-02-20 1:51 ` David Rientjes
2011-02-19 2:47 ` [PATCH 5/6] printk: Minimize time zero output Mike Travis
2011-02-20 1:51 ` David Rientjes
2011-02-21 20:56 ` Mike Travis [this message]
2011-02-22 0:13 ` David Rientjes
2011-02-19 2:47 ` [PATCH 6/6] printk: Allocate kernel log buffer earlier Mike Travis
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=4D62D173.8040805@sgi.com \
--to=travis@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=holt@sgi.com \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rientjes@google.com \
--cc=steiner@sgi.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yhlu.kernel@gmail.com \
/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