* [PATCH] powerpc: Silent SW timebase sync
@ 2008-10-15 4:25 Benjamin Herrenschmidt
2008-10-15 5:29 ` Grant Likely
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-10-15 4:25 UTC (permalink / raw)
To: linuxppc-dev
When no HW method is provided to sync the timebase, linux uses
a software algorithm.
The code for that is very verbose using straight printk's without
log level. A lot of this is mostly useless unless you want to debug
the process, and we didn't have any problem with it for years anyway
so this turns the bunch of them into pr_debug.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/smp-tbsync.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/smp-tbsync.c 2008-10-15 14:42:24.000000000 +1100
+++ linux-work/arch/powerpc/kernel/smp-tbsync.c 2008-10-15 15:23:03.000000000 +1100
@@ -113,7 +113,7 @@ void __devinit smp_generic_give_timebase
{
int i, score, score2, old, min=0, max=5000, offset=1000;
- printk("Synchronizing timebase\n");
+ pr_debug("Software timebase sync\n");
/* if this fails then this kernel won't work anyway... */
tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
@@ -123,13 +123,13 @@ void __devinit smp_generic_give_timebase
while (!tbsync->ack)
barrier();
- printk("Got ack\n");
+ pr_debug("Got ack\n");
/* binary search */
for (old = -1; old != offset ; offset = (min+max) / 2) {
score = start_contest(kSetAndTest, offset, NUM_ITER);
- printk("score %d, offset %d\n", score, offset );
+ pr_debug("score %d, offset %d\n", score, offset );
if( score > 0 )
max = offset;
@@ -140,8 +140,8 @@ void __devinit smp_generic_give_timebase
score = start_contest(kSetAndTest, min, NUM_ITER);
score2 = start_contest(kSetAndTest, max, NUM_ITER);
- printk("Min %d (score %d), Max %d (score %d)\n",
- min, score, max, score2);
+ pr_debug("Min %d (score %d), Max %d (score %d)\n",
+ min, score, max, score2);
score = abs(score);
score2 = abs(score2);
offset = (score < score2) ? min : max;
@@ -155,7 +155,7 @@ void __devinit smp_generic_give_timebase
if (score2 <= score || score2 < 20)
break;
}
- printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
+ pr_debug("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
/* exiting */
tbsync->cmd = kExit;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: Silent SW timebase sync
2008-10-15 4:25 [PATCH] powerpc: Silent SW timebase sync Benjamin Herrenschmidt
@ 2008-10-15 5:29 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2008-10-15 5:29 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
On Wed, Oct 15, 2008 at 03:25:28PM +1100, Benjamin Herrenschmidt wrote:
> When no HW method is provided to sync the timebase, linux uses
> a software algorithm.
>
> The code for that is very verbose using straight printk's without
> log level. A lot of this is mostly useless unless you want to debug
> the process, and we didn't have any problem with it for years anyway
> so this turns the bunch of them into pr_debug.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
> arch/powerpc/kernel/smp-tbsync.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> --- linux-work.orig/arch/powerpc/kernel/smp-tbsync.c 2008-10-15 14:42:24.000000000 +1100
> +++ linux-work/arch/powerpc/kernel/smp-tbsync.c 2008-10-15 15:23:03.000000000 +1100
> @@ -113,7 +113,7 @@ void __devinit smp_generic_give_timebase
> {
> int i, score, score2, old, min=0, max=5000, offset=1000;
>
> - printk("Synchronizing timebase\n");
> + pr_debug("Software timebase sync\n");
>
> /* if this fails then this kernel won't work anyway... */
> tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
> @@ -123,13 +123,13 @@ void __devinit smp_generic_give_timebase
> while (!tbsync->ack)
> barrier();
>
> - printk("Got ack\n");
> + pr_debug("Got ack\n");
>
> /* binary search */
> for (old = -1; old != offset ; offset = (min+max) / 2) {
> score = start_contest(kSetAndTest, offset, NUM_ITER);
>
> - printk("score %d, offset %d\n", score, offset );
> + pr_debug("score %d, offset %d\n", score, offset );
>
> if( score > 0 )
> max = offset;
> @@ -140,8 +140,8 @@ void __devinit smp_generic_give_timebase
> score = start_contest(kSetAndTest, min, NUM_ITER);
> score2 = start_contest(kSetAndTest, max, NUM_ITER);
>
> - printk("Min %d (score %d), Max %d (score %d)\n",
> - min, score, max, score2);
> + pr_debug("Min %d (score %d), Max %d (score %d)\n",
> + min, score, max, score2);
> score = abs(score);
> score2 = abs(score2);
> offset = (score < score2) ? min : max;
> @@ -155,7 +155,7 @@ void __devinit smp_generic_give_timebase
> if (score2 <= score || score2 < 20)
> break;
> }
> - printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
> + pr_debug("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
>
> /* exiting */
> tbsync->cmd = kExit;
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-15 5:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 4:25 [PATCH] powerpc: Silent SW timebase sync Benjamin Herrenschmidt
2008-10-15 5:29 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).