Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-06-04 Thread Mathieu Desnoyers
* William Lee Irwin III ([EMAIL PROTECTED]) wrote: > On Wed, May 30, 2007 at 10:00:34AM -0400, Mathieu Desnoyers wrote: > >>> + if (prof_on) > >>> + BUG_ON(cond_call_arm("profile_on")); > > * William Lee Irwin III ([EMAIL PROTECTED]) wrote: > >> What's the point of this BUG_ON()? The condi

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-06-04 Thread Mathieu Desnoyers
* Andi Kleen ([EMAIL PROTECTED]) wrote: > > I see your point, but there is a level of control on the branch I would > > lack by doing so: the ability to put the call in either the if or else > > branch. It is an optimization on i386. > > What does it optimize exactly? > Nicholas McGuire told me

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-06-01 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote: > On Fri, 1 Jun 2007 11:54:13 -0400 Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > * Andrew Morton ([EMAIL PROTECTED]) wrote: > > > On Wed, 30 May 2007 10:00:34 -0400 > > > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > > > > > @@ -2990,7 +2991,8

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-06-01 Thread Andrew Morton
On Fri, 1 Jun 2007 11:54:13 -0400 Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > * Andrew Morton ([EMAIL PROTECTED]) wrote: > > On Wed, 30 May 2007 10:00:34 -0400 > > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > > > @@ -2990,7 +2991,8 @@ > > > print_irqtrace_events(prev);

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-06-01 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote: > On Wed, 30 May 2007 10:00:34 -0400 > Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > > > @@ -2990,7 +2991,8 @@ > > print_irqtrace_events(prev); > > dump_stack(); > > } > > - profile_hit(SCHED_PROFILING, __builtin_ret

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread William Lee Irwin III
On Wed, May 30, 2007 at 10:00:34AM -0400, Mathieu Desnoyers wrote: >>> + if (prof_on) >>> + BUG_ON(cond_call_arm("profile_on")); * William Lee Irwin III ([EMAIL PROTECTED]) wrote: >> What's the point of this BUG_ON()? The condition is a priori impossible. On Thu, May 31, 2007 at 05:12

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread Andi Kleen
> I see your point, but there is a level of control on the branch I would > lack by doing so: the ability to put the call in either the if or else > branch. It is an optimization on i386. What does it optimize exactly? > Also, I live in the expectation that, someday, the gcc guys will be nice > e

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread Mathieu Desnoyers
* Andi Kleen ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers <[EMAIL PROTECTED]> writes: > > } > > - profile_hit(SCHED_PROFILING, __builtin_return_address(0)); > > + cond_call(profile_on, > > + profile_hit(SCHED_PROFILING, __builtin_return_address(0))); > > Would it be possible to

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread Mathieu Desnoyers
* Matt Mackall ([EMAIL PROTECTED]) wrote: > > - profile_hit(SCHED_PROFILING, __builtin_return_address(0)); > > + cond_call(profile_on, > > + profile_hit(SCHED_PROFILING, __builtin_return_address(0))); > > I think we could do better here pretty trivially. profile hit still > has an if

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread Mathieu Desnoyers
* William Lee Irwin III ([EMAIL PROTECTED]) wrote: > On Wed, May 30, 2007 at 10:00:34AM -0400, Mathieu Desnoyers wrote: > > Use conditional calls with lower d-cache hit in optimized version as a > > condition for scheduler profiling call. > [...] > > + if (prof_on) > > + BUG_ON(cond_cal

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-31 Thread Andi Kleen
Mathieu Desnoyers <[EMAIL PROTECTED]> writes: > } > - profile_hit(SCHED_PROFILING, __builtin_return_address(0)); > + cond_call(profile_on, > + profile_hit(SCHED_PROFILING, __builtin_return_address(0))); Would it be possible to use a syntax like if (unlikely_cond_

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-30 Thread Matt Mackall
On Wed, May 30, 2007 at 10:00:34AM -0400, Mathieu Desnoyers wrote: > Use conditional calls with lower d-cache hit in optimized version as a > condition for scheduler profiling call. > > Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]> > > --- > kernel/profile.c |4 > kernel/sched.c

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-30 Thread William Lee Irwin III
On Wed, May 30, 2007 at 10:00:34AM -0400, Mathieu Desnoyers wrote: > Use conditional calls with lower d-cache hit in optimized version as a > condition for scheduler profiling call. [...] > + if (prof_on) > + BUG_ON(cond_call_arm("profile_on")); What's the point of this BUG_ON()? T

Re: [patch 9/9] Scheduler profiling - Use conditional calls

2007-05-30 Thread Andrew Morton
On Wed, 30 May 2007 10:00:34 -0400 Mathieu Desnoyers <[EMAIL PROTECTED]> wrote: > @@ -2990,7 +2991,8 @@ > print_irqtrace_events(prev); > dump_stack(); > } > - profile_hit(SCHED_PROFILING, __builtin_return_address(0)); > + cond_call(profile_on, > +

[patch 9/9] Scheduler profiling - Use conditional calls

2007-05-30 Thread Mathieu Desnoyers
Use conditional calls with lower d-cache hit in optimized version as a condition for scheduler profiling call. Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]> --- kernel/profile.c |4 kernel/sched.c |4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) Index: linux-2.6-lt

[patch 9/9] Scheduler profiling - Use conditional calls

2007-05-29 Thread Mathieu Desnoyers
Use conditional calls with lower d-cache hit in optimized version as a condition for scheduler profiling call. Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]> --- kernel/profile.c |4 kernel/sched.c | 32 +++- 2 files changed, 23 insertions(+), 13 de