lkml.org 
[lkml]   [2005]   [Mar]   [27]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
FromDenis Vlasenko <>
SubjectRe: [PATCH] no need to check for NULL before calling kfree() -fs/ext2/
DateSun, 27 Mar 2005 15:51:18 +0300
> > It's impossible to be otherwise. A call requires
> > that the return address be written to memory (the stack),
> > using register indirection (the stack-pointer).
> 
> and it's a so common pattern that it's optimized to death. Internally a
> call gets transformed to 2 uops or so, one is push eip, the other is the
> jmp (which gets then just absorbed by the "what is the next eip" logic,
> just as a "jmp"s are 0 cycles)

Arjan, you overlook the fact that kfree() contains 'if(!p) return;' too.
call + test-and-branch can never be faster than test+and+branch.
Maybe on the really clever CPU it can take the same time, but not faster...
--
vda
-
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/

\
 
 \ /
  Last update: 2005-04-06 11:30    [W:0.344 / U:1.790 seconds]
©2003-2008 Jasper Spaans