Messages in this thread | | | Date | Tue, 25 May 1999 13:04:56 +0200 (CEST) | From | Ingo Molnar <> | Subject | Re: goto's ??? |
| |
On Sun, 23 May 1999, Mofeed Shahin wrote:
> error = -ENFILE; > f = get_empty_filp(); > if (!f) > goto out; > .... > <SNIP> > > out: > return ERR_PTR(error);
> ie why not just do this :
> error = -ENFILE; > f = get_empty_filp(); > if (!f) > return ERR_PTR(error); > .... > <SNIP>
there are two different issues here. First, the branch is an 'unlikely' case, and it's a forward branch. This means we'll never take it in most cases. Sane CPUs predict (branch-history less) forward branches as not taken.
the other issue is converting that code to do proper SMP locking. Since 2.0 many areas of the kernel were slightly changed to have a single point of exit, this eases SMP locking/unlocking later on. (in that case the exit point might do an unlock, which we obviously do not want to inline like in your suggestions).
-- mingo
- 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/
| |