trans_logger: avoid CPU consumption upon untreatable queues

This commit is contained in:
Thomas Schoebel-Theuer 2012-12-30 07:50:47 +01:00
parent 37fdd05899
commit 8a7d86e73b
2 changed files with 17 additions and 0 deletions

View File

@ -2199,6 +2199,20 @@ int _do_ranking(struct trans_logger_brick *brick, struct rank_data rkd[])
if (queued <= 0)
continue;
if (banning_is_hit(&brick->q_phase[i].q_banning)) {
#ifdef IO_DEBUGGING
unsigned long long now = cpu_clock(raw_smp_processor_id());
MARS_IO("BAILOUT queue = %d via banning now = %lld last_hit = %lld diff = %lld renew_count = %d count = %d\n",
i,
now,
now - brick->q_phase[i].q_banning.ban_last_hit,
brick->q_phase[i].q_banning.ban_last_hit,
brick->q_phase[i].q_banning.ban_renew_count,
brick->q_phase[i].q_banning.ban_count);
#endif
break;
}
if (i == 0) {
// limit mref IO parallelism on transaction log
ranking_compute(&rkd[0], extra_rank_mref_flying, mref_flying);
@ -2426,6 +2440,7 @@ void trans_logger_log(struct trans_logger_brick *brick)
* algorithm cannot foresee anything.
*/
brick->q_phase[winner].no_progress_count++;
banning_hit(&brick->q_phase[winner].q_banning, 1000000);
}
ranking_select_done(rkd, winner, nr);
break;

View File

@ -14,6 +14,7 @@
#include "lib_log.h"
#include "lib_pairing_heap.h"
#include "lib_queue.h"
#include "lib_timing.h"
///////////////////////// global tuning ////////////////////////
@ -44,6 +45,7 @@ struct logger_queue {
const char *q_insert_info;
const char *q_pushback_info;
const char *q_fetch_info;
struct banning q_banning;
int no_progress_count;
int pushback_count;
};