lkml.org 
[lkml]   [1999]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.093 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site