LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* profile_pc() bogus since <= 2.6.19 (x86 at least)?
@ 2008-03-05 11:14 Jan Beulich
  2008-03-05 15:37 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2008-03-05 11:14 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

Ingo,

while the comment at the top of kernel/spinlock.c states so:

 * Note that some architectures have special knowledge about the
 * stack frames of these functions in their profile_pc. If you
 * change anything significant here that could change the stack
 * frame contact the architecture maintainers.

the actual code doesn't seem to match this anymore. With all (and
even before that, many) functions being written in C, there cannot
be validly made assumptions about the stack frame layout. Indeed,
if I check the disassembly framed by __lock_text_{start,end} on
x86, there are a number of functions that push one or two registers
(in lock_kernel() even stack variables are being allocated), which
clearly breaks profile_pc()'s assumptions.

Since it's been this way for so long, I wonder how frequently this
code is actually being exercised...

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: profile_pc() bogus since <= 2.6.19 (x86 at least)?
  2008-03-05 11:14 profile_pc() bogus since <= 2.6.19 (x86 at least)? Jan Beulich
@ 2008-03-05 15:37 ` Ingo Molnar
  2008-03-05 15:51   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-03-05 15:37 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel


* Jan Beulich <jbeulich@novell.com> wrote:

> Ingo,
> 
> while the comment at the top of kernel/spinlock.c states so:
> 
>  * Note that some architectures have special knowledge about the
>  * stack frames of these functions in their profile_pc. If you
>  * change anything significant here that could change the stack
>  * frame contact the architecture maintainers.
> 
> the actual code doesn't seem to match this anymore. With all (and even 
> before that, many) functions being written in C, there cannot be 
> validly made assumptions about the stack frame layout. Indeed, if I 
> check the disassembly framed by __lock_text_{start,end} on x86, there 
> are a number of functions that push one or two registers (in 
> lock_kernel() even stack variables are being allocated), which clearly 
> breaks profile_pc()'s assumptions.
> 
> Since it's been this way for so long, I wonder how frequently this 
> code is actually being exercised...

yeah - i guess it's not really relevant anymore now that lockdep saves 
full stack traces. I doubt anyone bothers to look at wchan anymore. We 
might even remove all the __lock and __sched sections and annotations?

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: profile_pc() bogus since <= 2.6.19 (x86 at least)?
  2008-03-05 15:37 ` Ingo Molnar
@ 2008-03-05 15:51   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2008-03-05 15:51 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

>>> Ingo Molnar <mingo@elte.hu> 05.03.08 16:37 >>>
>
>* Jan Beulich <jbeulich@novell.com> wrote:
>
>> Ingo,
>> 
>> while the comment at the top of kernel/spinlock.c states so:
>> 
>>  * Note that some architectures have special knowledge about the
>>  * stack frames of these functions in their profile_pc. If you
>>  * change anything significant here that could change the stack
>>  * frame contact the architecture maintainers.
>> 
>> the actual code doesn't seem to match this anymore. With all (and even 
>> before that, many) functions being written in C, there cannot be 
>> validly made assumptions about the stack frame layout. Indeed, if I 
>> check the disassembly framed by __lock_text_{start,end} on x86, there 
>> are a number of functions that push one or two registers (in 
>> lock_kernel() even stack variables are being allocated), which clearly 
>> breaks profile_pc()'s assumptions.
>> 
>> Since it's been this way for so long, I wonder how frequently this 
>> code is actually being exercised...
>
>yeah - i guess it's not really relevant anymore now that lockdep saves 
>full stack traces. I doubt anyone bothers to look at wchan anymore. We 
>might even remove all the __lock and __sched sections and annotations?

Since drivers/oprofile/cpu_buffer.c and kernel/profile.c both have a
reference to profile_pc(), I'm not so sure about that. Perhaps if a
replacement for these two can be found...

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-05 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 11:14 profile_pc() bogus since <= 2.6.19 (x86 at least)? Jan Beulich
2008-03-05 15:37 ` Ingo Molnar
2008-03-05 15:51   ` Jan Beulich

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).