Re: [PATCH 1/3] Add read_cache_from() and discard_cache()

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

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

> True, I missed that one. But it is just a call to 
> cache_tree_free(active_cache_tree); in discard_cache(), right?

On the codepath to write out the new index file, calling
cache_free_tree(&active_cache_tree) before write_cache() is all
that should be needed.  When "active_cache_tree == NULL",
write_cache() would write out an index file without the cached
tree information.

Currently not many things take advantage of cached tree
information to optimize its operation.  But I'd like to change
that.  For example, tree merges by read-tree should be able to
take advantage of the fact that a cached tree read from the
index and three trees being read all match for a subdirectory
and do the merge of the directory without descending into it.

>>  - index_timestamp is left as the old value in this patch when
>>    you switch cache using read_cache_from() directly.  I have a
>>    suspicion you may be bitten by "Racy Git" problem, especially
>>    because the operations are supposed to happen quickly thanks
>>    to the effort of you two ;-) increasing the risks that the
>>    file timestamp of the working tree file and the cached entry
>>    match.
>
> Yes. Again, just one line to discard_cache(), right?
>
> 	index_file_timestamp = 0;

This one I am not sure.  Read the comment in ce_match_stat() and
see the problematic sequence of events that this variable tries
to help resolve applies to your use.

-
: 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]