mirror of https://github.com/BOINC/boinc.git
client: <cpu_sched> shouldn't show suspend/resume msgs for CPU throttling
This commit is contained in:
parent
5778cd653f
commit
9d056d60cb
|
@ -139,7 +139,7 @@ ACTIVE_TASK::ACTIVE_TASK() {
|
|||
// called from the CLIENT_STATE::enforce_schedule()
|
||||
// and ACTIVE_TASK_SET::suspend_all()
|
||||
//
|
||||
int ACTIVE_TASK::preempt(int preempt_type) {
|
||||
int ACTIVE_TASK::preempt(int preempt_type, int reason) {
|
||||
bool remove=false;
|
||||
|
||||
switch (preempt_type) {
|
||||
|
@ -169,8 +169,9 @@ int ACTIVE_TASK::preempt(int preempt_type) {
|
|||
break;
|
||||
}
|
||||
|
||||
bool show_msg = log_flags.cpu_sched && reason != SUSPEND_REASON_CPU_THROTTLE;
|
||||
if (remove) {
|
||||
if (log_flags.cpu_sched) {
|
||||
if (show_msg) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"[cpu_sched] Preempting %s (removed from memory)",
|
||||
result->name
|
||||
|
@ -178,7 +179,7 @@ int ACTIVE_TASK::preempt(int preempt_type) {
|
|||
}
|
||||
return request_exit();
|
||||
} else {
|
||||
if (log_flags.cpu_sched) {
|
||||
if (show_msg) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"[cpu_sched] Preempting %s (left in memory)",
|
||||
result->name
|
||||
|
@ -1056,7 +1057,7 @@ void* throttler(void*) {
|
|||
boinc_sleep(off);
|
||||
client_mutex.lock();
|
||||
if (!gstate.tasks_suspended) {
|
||||
gstate.active_tasks.unsuspend_all();
|
||||
gstate.active_tasks.unsuspend_all(SUSPEND_REASON_CPU_THROTTLE);
|
||||
}
|
||||
gstate.tasks_throttled = false;
|
||||
client_mutex.unlock();
|
||||
|
|
|
@ -229,9 +229,9 @@ struct ACTIVE_TASK {
|
|||
int suspend();
|
||||
// tell a process to stop executing (but stay in mem)
|
||||
// Done by sending it a <suspend> message
|
||||
int unsuspend();
|
||||
int unsuspend(int reason=0);
|
||||
// Undo a suspend: send a <resume> message
|
||||
int preempt(int preempt_type);
|
||||
int preempt(int preempt_type, int reason=0);
|
||||
// preempt (via suspend or quit) a running task
|
||||
int resume_or_start(bool);
|
||||
void send_network_available();
|
||||
|
@ -279,7 +279,7 @@ public:
|
|||
void init();
|
||||
bool poll();
|
||||
void suspend_all(int reason);
|
||||
void unsuspend_all();
|
||||
void unsuspend_all(int reason=0);
|
||||
bool is_task_executing();
|
||||
void request_tasks_exit(PROJECT* p=0);
|
||||
int wait_for_exit(double, PROJECT* p=0);
|
||||
|
|
|
@ -1077,7 +1077,7 @@ void ACTIVE_TASK_SET::suspend_all(int reason) {
|
|||
//
|
||||
if (reason == SUSPEND_REASON_CPU_THROTTLE) {
|
||||
if (atp->result->dont_throttle()) continue;
|
||||
atp->preempt(REMOVE_NEVER);
|
||||
atp->preempt(REMOVE_NEVER, reason);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ void ACTIVE_TASK_SET::suspend_all(int reason) {
|
|||
|
||||
// resume all currently scheduled tasks
|
||||
//
|
||||
void ACTIVE_TASK_SET::unsuspend_all() {
|
||||
void ACTIVE_TASK_SET::unsuspend_all(int reason) {
|
||||
unsigned int i;
|
||||
ACTIVE_TASK* atp;
|
||||
for (i=0; i<active_tasks.size(); i++) {
|
||||
|
@ -1135,7 +1135,7 @@ void ACTIVE_TASK_SET::unsuspend_all() {
|
|||
);
|
||||
}
|
||||
} else if (atp->task_state() == PROCESS_SUSPENDED) {
|
||||
atp->unsuspend();
|
||||
atp->unsuspend(reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1209,14 +1209,14 @@ int ACTIVE_TASK::suspend() {
|
|||
|
||||
// resume a suspended task
|
||||
//
|
||||
int ACTIVE_TASK::unsuspend() {
|
||||
int ACTIVE_TASK::unsuspend(int reason) {
|
||||
if (!app_client_shm.shm) return 0;
|
||||
if (task_state() != PROCESS_SUSPENDED) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"Internal error: expected process %s to be suspended", result->name
|
||||
);
|
||||
}
|
||||
if (log_flags.cpu_sched) {
|
||||
if (log_flags.cpu_sched && reason != SUSPEND_REASON_CPU_THROTTLE) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"[cpu_sched] Resuming %s", result->name
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue