Re: kernel/sched.c questions

Andi Kleen (ak@suse.de)
04 Apr 2001 22:20:12 +0200


Tim Walberg <tewalberg@mediaone.net> writes:

> On 04/04/2001 16:52 -0300, Sardaņons, Eliel wrote:
> >> Hello, I would like to know why you put this two functions:
> >> void scheduling_functions_start_here(void) { }
> >> ...
> >> void scheduling_functions_end_here(void) { }
> >>
>
> That one I have no idea about - maybe some perverse sort
> of comment? Or maybe something somewhere needs to know the
> address range that some functions lie within, and these functions
> would delimit that range. Of course, that presumes that the
> compiler in use doesn't reorder functions in the object code
> that emits, but I think that's a fairly safe assumption for
> now...

This is needed for a very bad hack to get the EIP information in ps -lax:
most programs would be shown as hanging in schedule(), which would not be
very useful to show the user. To avoid this sched.c is always compiled with
frame pointers and if the EIP is inside these two functions the proc code
goes back one level in the stack frame.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/