Messages in this thread | | | Date | Mon, 28 Jun 1999 20:52:15 -0400 | From | brent verner <> | Subject | [OT]Re: question about kernel/sched.c - 2.2.10 |
| |
> This is becoming a FAQ.
sorry :-(
> Generally, in some code that is speed-critical, one would like to > have the main path through the code (the fast path), execute with > no jumps that could force the CPU instruction cache to be refilled. > > So you would like something like: > > if(abnormal_condition == TRUE) goto quit; > fast_path(); > fast_path(); > quit:; >
yes this makes sense. it's like a bypass...
> if(a) { > if(b) { > if(c) { > if(d) { > if(error) goto quit; >
and this, like a shortcut....
but, the following seems to me, like a detour...
if (bh_mask & bh_active) goto handle_bh; handle_bh_back: .........
handle_bh: do_bottom_half(); goto handle_bh_back;
this is what appears is schedule(). i compiled this to asm, and saw that this adds two 'jmp's and two '.p2align's
`gcc -O2 -S original_sched.c` ------
movl bh_mask,%eax andl bh_active,%eax jne .L449 .p2align 4,,7 .L450: #APP cli #NO_APP .............
.L449: call do_bottom_half jmp .L450 .p2align 4,,7 .L439: ..............
============================
`gcc -O2 -S test_sched.c` ------
movl bh_mask,%eax andl bh_active,%eax je .L448 call do_bottom_half .p2align 4,,7 .L448: #APP cli #NO_APP
=============================
i have a suspicion where the original_sched.s might be better... that we expect to _not_ 'jne .L449' most of the time? if you could take a moment and clarify this, i'd appreciate it. i know this might be the wrong place for this question, but i don't know anyone who'd know better than the subscribers to this list.
thanks! brent
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |