git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
0c9984584e026d38ad2021a3d013d0d472e39f12 blob 3052 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
 
#ifndef PARALLEL_CHECKOUT_H
#define PARALLEL_CHECKOUT_H

#include "entry.h"
#include "convert.h"

/****************************************************************
 * Users of parallel checkout
 ****************************************************************/

enum pc_status {
	PC_UNINITIALIZED = 0,
	PC_ACCEPTING_ENTRIES,
	PC_RUNNING,
};

enum pc_status parallel_checkout_status(void);
void get_parallel_checkout_configs(int *num_workers, int *threshold);
void init_parallel_checkout(void);

/*
 * Return -1 if parallel checkout is currently not enabled or if the entry is
 * not eligible for parallel checkout. Otherwise, enqueue the entry for later
 * write and return 0.
 */
int enqueue_checkout(struct cache_entry *ce, struct conv_attrs *ca);

/*
 * Write all the queued entries, returning 0 on success. If the number of
 * entries is smaller than the specified threshold, the operation is performed
 * sequentially.
 */
int run_parallel_checkout(struct checkout *state, int num_workers, int threshold);

/****************************************************************
 * Interface with checkout--helper
 ****************************************************************/

enum pc_item_status {
	PC_ITEM_PENDING = 0,
	PC_ITEM_WRITTEN,
	/*
	 * The entry could not be written because there was another file
	 * already present in its path or leading directories. Since
	 * checkout_entry_ca() removes such files from the working tree before
	 * enqueueing the entry for parallel checkout, it means that there was
	 * a path collision among the entries being written.
	 */
	PC_ITEM_COLLIDED,
	PC_ITEM_FAILED,
};

struct parallel_checkout_item {
	/*
	 * In main process ce points to a istate->cache[] entry. Thus, it's not
	 * owned by us. In workers they own the memory, which *must be* released.
	 */
	struct cache_entry *ce;
	struct conv_attrs ca;
	size_t id; /* position in parallel_checkout.items[] of main process */

	/* Output fields, sent from workers. */
	enum pc_item_status status;
	struct stat st;
};

/*
 * The fixed-size portion of `struct parallel_checkout_item` that is sent to the
 * workers. Following this will be 2 strings: ca.working_tree_encoding and
 * ce.name; These are NOT null terminated, since we have the size in the fixed
 * portion.
 *
 * Note that not all fields of conv_attrs and cache_entry are passed, only the
 * ones that will be required by the workers to smudge and write the entry.
 */
struct pc_item_fixed_portion {
	size_t id;
	struct object_id oid;
	unsigned int ce_mode;
	enum crlf_action crlf_action;
	int ident;
	size_t working_tree_encoding_len;
	size_t name_len;
};

/*
 * The fields of `struct parallel_checkout_item` that are returned by the
 * workers. Note: `st` must be the last one, as it is omitted on error.
 */
struct pc_item_result {
	size_t id;
	enum pc_item_status status;
	struct stat st;
};

#define PC_ITEM_RESULT_BASE_SIZE offsetof(struct pc_item_result, st)

void write_pc_item(struct parallel_checkout_item *pc_item,
		   struct checkout *state);

#endif /* PARALLEL_CHECKOUT_H */
debug log:

solving 0c9984584e ...
found 0c9984584e in https://public-inbox.org/git/991169488b17e492c6d2c2f212267a66693aa7ec.1600814153.git.matheus.bernardino@usp.br/ ||
	https://public-inbox.org/git/096e543fd208d18cae875d3ea1a0ecfacf10fa08.1603937110.git.matheus.bernardino@usp.br/
found e6d6fc01ea in https://public-inbox.org/git/bc8447cd9c106055a715305ab506adc6abae7713.1604521275.git.matheus.bernardino@usp.br/ ||
	https://public-inbox.org/git/2bdc13664e65a25607b8ecb4c0ea54fb2dad482c.1603937110.git.matheus.bernardino@usp.br/ ||
	https://public-inbox.org/git/af0d790973b1e52da0fc9c4bed95e93d995d68da.1600814153.git.matheus.bernardino@usp.br/

applying [1/5] https://public-inbox.org/git/bc8447cd9c106055a715305ab506adc6abae7713.1604521275.git.matheus.bernardino@usp.br/
diff --git a/parallel-checkout.h b/parallel-checkout.h
new file mode 100644
index 0000000000..e6d6fc01ea

Checking patch parallel-checkout.h...
Applied patch parallel-checkout.h cleanly.

skipping https://public-inbox.org/git/2bdc13664e65a25607b8ecb4c0ea54fb2dad482c.1603937110.git.matheus.bernardino@usp.br/ for e6d6fc01ea
skipping https://public-inbox.org/git/af0d790973b1e52da0fc9c4bed95e93d995d68da.1600814153.git.matheus.bernardino@usp.br/ for e6d6fc01ea
index at:
100644 e6d6fc01ea3db2ad3655d1f03a8ae3a0ce97bb59	parallel-checkout.h

applying [2/5] https://public-inbox.org/git/991169488b17e492c6d2c2f212267a66693aa7ec.1600814153.git.matheus.bernardino@usp.br/
diff --git a/parallel-checkout.h b/parallel-checkout.h
index e6d6fc01ea..0c9984584e 100644

Checking patch parallel-checkout.h...
Applied patch parallel-checkout.h cleanly.

skipping https://public-inbox.org/git/096e543fd208d18cae875d3ea1a0ecfacf10fa08.1603937110.git.matheus.bernardino@usp.br/ for 0c9984584e
index at:
100644 0c9984584e026d38ad2021a3d013d0d472e39f12	parallel-checkout.h

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).