From: "Stuart MacDonald" <stuartm@connecttech.com>
To: =?ISO-8859-1?Q? <Sarda=F1ons@connecttech.com>,
"?= Eliel" <Eliel.Sardanons@philips.edu.ar>,
linux-kernel@vger.kernel.org
Subject: Re: kernel/sched.c questions
Date: Wed, 4 Apr 2001 16:29:37 -0400 [thread overview]
Message-ID: <04c101c0bd45$f8182960$294b82ce@connecttech.com> (raw)
In-Reply-To: <A0C675E9DC2CD411A5870040053AEBA028416D@MAINSERVER>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]
I had similar questions recently when I was doing some
hacking; these are my guesses:
From: <Sardañons>; "Eliel" <Eliel.Sardanons@philips.edu.ar>
> Hello, I would like to know why you put this two functions:
> void scheduling_functions_start_here(void) { }
> ...
> void scheduling_functions_end_here(void) { }
Just as markers for easy location in System.map.
The compiler should optimise those away.
> why you put 'case TASK_RUNNING'
>
> switch (prev->state) {
> case TASK_INTERRUPTIBLE:
> if (signal_pending(prev)) {
> prev->state = TASK_RUNNING;
> break;
> }
> default:
> del_from_runqueue(prev);
> case TASK_RUNNING:
> }
Prevent compiler warnings about unhandled conditions?
Not sure about that one.
> in the function schedule() you always use this syntax:
>
> -----
> if (a_condition)
> goto bebe;
> bebe_back
>
>
> bebe:
> do_bebe();
> goto bebe_back;
> ------
> why not just doing:
>
> if (a_condition)
> do_bebe();
Probably because the compiler puts out
setup function parameter one
setup function parameter two
setup function parameter three
check condition
call function
setup function parameter one
setup function parameter two
setup function parameter three
check condition
call function
for your case and the above convolutions
puts out
check condition
jump to call if needed
check condition
jump to call if needed
instead.
Or even if the compiler puts out
check condition
If condition
setup function parameter one
setup function parameter two
setup function parameter three
call function
check condition
if condition
setup function parameter one
setup function parameter two
setup function parameter three
call function
I'm betting the smaller code above is better
for cache hits, right?
But these are my guesses. Anyone want to
clarify?
..Stu
next prev parent reply other threads:[~2001-04-04 20:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-04 19:52 kernel/sched.c questions Sardañons, Eliel
2001-04-04 20:08 ` Tim Walberg
2001-04-04 20:20 ` Andi Kleen
2001-04-04 20:21 ` Bjorn Wesen
2001-04-04 21:22 ` Richard B. Johnson
2001-04-04 20:29 ` Stuart MacDonald [this message]
2001-04-05 20:28 ` Steven Walter
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='04c101c0bd45$f8182960$294b82ce@connecttech.com' \
--to=stuartm@connecttech.com \
--cc=Eliel.Sardanons@philips.edu.ar \
--cc=Sarda=F1ons@connecttech.com \
--cc=linux-kernel@vger.kernel.org \
/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