mirror of https://github.com/schoebel/mars
infra: replace brick_version by kill_round
This commit is contained in:
parent
bf7c0c9f3b
commit
59d706ba54
|
@ -177,7 +177,7 @@ struct mars_info {
|
|||
struct list_head dent_brick_link; \
|
||||
const char *brick_path; \
|
||||
struct mars_global *global; \
|
||||
int brick_version; \
|
||||
int kill_round; \
|
||||
bool killme; \
|
||||
void (*show_status)(struct mars_brick *brick, bool shutdown); \
|
||||
|
||||
|
|
|
@ -1323,11 +1323,14 @@ restart:
|
|||
status = mars_power_button(brick, false, false);
|
||||
goto success;
|
||||
}
|
||||
/* optimization:
|
||||
/* Workaround FIXME:
|
||||
* only kill bricks which have not been touched during the current mars_dent_work() round.
|
||||
* some bricks like aio seem to have races between startup and termination of threads.
|
||||
* disable this for stress-testing the allocation/deallocation logic.
|
||||
* OTOH, frequently doing useless starts/stops is no good idea.
|
||||
* CHECK: how to avoid too frequent switching by other means?
|
||||
*/
|
||||
if (global && global->global_version == brick->brick_version) {
|
||||
if (brick->kill_round++ < 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1609,9 +1612,6 @@ struct mars_brick *make_brick_all(
|
|||
}
|
||||
|
||||
do_switch:
|
||||
if (global) {
|
||||
brick->brick_version = global->global_version;
|
||||
}
|
||||
// call setup function
|
||||
if (setup_fn) {
|
||||
int setup_status = setup_fn(brick, private);
|
||||
|
|
Loading…
Reference in New Issue