Merge branch 'jk/index-pack-hotfixes'
Hotfix and clean-up for the jt/threaded-index-pack topic that has graduated to v2.29-rc0. * jk/index-pack-hotfixes: index-pack: make get_base_data() comment clearer index-pack: drop type_cas mutex index-pack: restore "resolving deltas" progress meter
This commit is contained in:
		| @ -159,10 +159,6 @@ static pthread_mutex_t deepest_delta_mutex; | |||||||
| #define deepest_delta_lock()	lock_mutex(&deepest_delta_mutex) | #define deepest_delta_lock()	lock_mutex(&deepest_delta_mutex) | ||||||
| #define deepest_delta_unlock()	unlock_mutex(&deepest_delta_mutex) | #define deepest_delta_unlock()	unlock_mutex(&deepest_delta_mutex) | ||||||
|  |  | ||||||
| static pthread_mutex_t type_cas_mutex; |  | ||||||
| #define type_cas_lock()		lock_mutex(&type_cas_mutex) |  | ||||||
| #define type_cas_unlock()	unlock_mutex(&type_cas_mutex) |  | ||||||
|  |  | ||||||
| static pthread_key_t key; | static pthread_key_t key; | ||||||
|  |  | ||||||
| static inline void lock_mutex(pthread_mutex_t *mutex) | static inline void lock_mutex(pthread_mutex_t *mutex) | ||||||
| @ -186,7 +182,6 @@ static void init_thread(void) | |||||||
| 	init_recursive_mutex(&read_mutex); | 	init_recursive_mutex(&read_mutex); | ||||||
| 	pthread_mutex_init(&counter_mutex, NULL); | 	pthread_mutex_init(&counter_mutex, NULL); | ||||||
| 	pthread_mutex_init(&work_mutex, NULL); | 	pthread_mutex_init(&work_mutex, NULL); | ||||||
| 	pthread_mutex_init(&type_cas_mutex, NULL); |  | ||||||
| 	if (show_stat) | 	if (show_stat) | ||||||
| 		pthread_mutex_init(&deepest_delta_mutex, NULL); | 		pthread_mutex_init(&deepest_delta_mutex, NULL); | ||||||
| 	pthread_key_create(&key, NULL); | 	pthread_key_create(&key, NULL); | ||||||
| @ -209,7 +204,6 @@ static void cleanup_thread(void) | |||||||
| 	pthread_mutex_destroy(&read_mutex); | 	pthread_mutex_destroy(&read_mutex); | ||||||
| 	pthread_mutex_destroy(&counter_mutex); | 	pthread_mutex_destroy(&counter_mutex); | ||||||
| 	pthread_mutex_destroy(&work_mutex); | 	pthread_mutex_destroy(&work_mutex); | ||||||
| 	pthread_mutex_destroy(&type_cas_mutex); |  | ||||||
| 	if (show_stat) | 	if (show_stat) | ||||||
| 		pthread_mutex_destroy(&deepest_delta_mutex); | 		pthread_mutex_destroy(&deepest_delta_mutex); | ||||||
| 	for (i = 0; i < nr_threads; i++) | 	for (i = 0; i < nr_threads; i++) | ||||||
| @ -894,18 +888,15 @@ static void sha1_object(const void *data, struct object_entry *obj_entry, | |||||||
| } | } | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Walk from current node up |  * Ensure that this node has been reconstructed and return its contents. | ||||||
|  * to top parent if necessary to deflate the node. In normal |  | ||||||
|  * situation, its parent node would be already deflated, so it just |  | ||||||
|  * needs to apply delta. |  | ||||||
|  * |  * | ||||||
|  * In the worst case scenario, parent node is no longer deflated because |  * In the typical and best case, this node would already be reconstructed | ||||||
|  * we're running out of delta_base_cache_limit; we need to re-deflate |  * (through the invocation to resolve_delta() in threaded_second_pass()) and it | ||||||
|  * parents, possibly up to the top base. |  * would not be pruned. However, if pruning of this node was necessary due to | ||||||
|  * |  * reaching delta_base_cache_limit, this function will find the closest | ||||||
|  * All deflated objects here are subject to be freed if we exceed |  * ancestor with reconstructed data that has not been pruned (or if there is | ||||||
|  * delta_base_cache_limit, just like in find_unresolved_deltas(), we |  * none, the ultimate base object), and reconstruct each node in the delta | ||||||
|  * just need to make sure the last node is not freed. |  * chain in order to generate the reconstructed data for this node. | ||||||
|  */ |  */ | ||||||
| static void *get_base_data(struct base_data *c) | static void *get_base_data(struct base_data *c) | ||||||
| { | { | ||||||
| @ -1028,6 +1019,10 @@ static void *threaded_second_pass(void *data) | |||||||
| 		struct object_entry *child_obj; | 		struct object_entry *child_obj; | ||||||
| 		struct base_data *child; | 		struct base_data *child; | ||||||
|  |  | ||||||
|  | 		counter_lock(); | ||||||
|  | 		display_progress(progress, nr_resolved_deltas); | ||||||
|  | 		counter_unlock(); | ||||||
|  |  | ||||||
| 		work_lock(); | 		work_lock(); | ||||||
| 		if (list_empty(&work_head)) { | 		if (list_empty(&work_head)) { | ||||||
| 			/* | 			/* | ||||||
|  | |||||||
| @ -277,4 +277,11 @@ test_expect_success 'index-pack --fsck-objects also warns upon missing tagger in | |||||||
| 	grep "^warning:.* expected .tagger. line" err | 	grep "^warning:.* expected .tagger. line" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | test_expect_success 'index-pack -v --stdin produces progress for both phases' ' | ||||||
|  | 	pack=$(git pack-objects --all pack </dev/null) && | ||||||
|  | 	GIT_PROGRESS_DELAY=0 git index-pack -v --stdin <pack-$pack.pack 2>err && | ||||||
|  | 	test_i18ngrep "Receiving objects" err && | ||||||
|  | 	test_i18ngrep "Resolving deltas" err | ||||||
|  | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Junio C Hamano
					Junio C Hamano