Re: [PATCH 7/3] Make index preloading check the whole path to the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 10 Jul 2009, Junio C Hamano wrote:
> 
> I actually was hoping to hear "Didn't you notice that this is the first
> function run by the pthread and its stack is zeroed by thread creation" or
> something clever like that ;-)

It's probably true that it is often zero in practice. I certainly saw no 
problems in my testing, even though I do have preloading on (partly for 
testing, partly because it actually helps a bit on my machine).

I also suspect that the way the whole 'cache_def' thing works, even if 
it's initialized with random crud, you'll probably never notice. There are 
all those safety rules that check that 'cache->track_flags' has to match 
the new value etc in order for the cache to be used. And even when it is 
used, it has no pointers in it, it has that static array and the lengths.

So I don't think you really even need to have the "it was zeroed by 
accident" explanation. It's probably as simple as "even if it is totally 
uninitialized, that will basically never trigger anything odd in 
practice".

Not to mention that the whole new index preloading addition was just a new 
safety feature that we didn't even use to have before - and one that only 
impacted an _optimization_ that didn't change semantics. So in the end: 
even in the really unlikely situation that the cache would have triggered, 
and returned an incorrect return value, the worst that would have happened 
would be that the preloading wasn't quite as efficient.

End result: you did well by noticing the lack of initializers, but I 
_really_ don't think it could probably ever possibly have mattered in 
practice.

			Linus
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]