CLEANUP: task: remove thread_mask from the struct task

It was not used anymore since everything moved to ->tid, so let's
remove it.
This commit is contained in:
Willy Tarreau 2022-06-15 15:57:53 +02:00
parent c44d08ebc4
commit 0ad00befc1
4 changed files with 3 additions and 13 deletions

View File

@ -113,7 +113,6 @@ struct task {
int expire; /* next expiration date for this task, in ticks */ int expire; /* next expiration date for this task, in ticks */
short nice; /* task prio from -1024 to +1024 */ short nice; /* task prio from -1024 to +1024 */
short tid; /* TID where it's allowed to run, <0 if anywhere */ short tid; /* TID where it's allowed to run, <0 if anywhere */
unsigned long thread_mask; /* mask of thread IDs authorized to process the task */
uint64_t call_date; /* date of the last task wakeup or call */ uint64_t call_date; /* date of the last task wakeup or call */
uint64_t lat_time; /* total latency time experienced */ uint64_t lat_time; /* total latency time experienced */
uint64_t cpu_time; /* total CPU time consumed */ uint64_t cpu_time; /* total CPU time consumed */

View File

@ -342,12 +342,10 @@ static inline void task_set_affinity(struct task *t, unsigned long thread_mask)
if (unlikely(task_in_wq(t))) { if (unlikely(task_in_wq(t))) {
task_unlink_wq(t); task_unlink_wq(t);
t->thread_mask = thread_mask;
t->tid = thr; t->tid = thr;
task_queue(t); task_queue(t);
} }
else { else {
t->thread_mask = thread_mask;
t->tid = thr; t->tid = thr;
} }
} }
@ -545,7 +543,6 @@ static inline struct task *task_init(struct task *t, unsigned long thread_mask)
t->wq.node.leaf_p = NULL; t->wq.node.leaf_p = NULL;
t->rq.node.leaf_p = NULL; t->rq.node.leaf_p = NULL;
t->state = TASK_SLEEPING; t->state = TASK_SLEEPING;
t->thread_mask = thread_mask;
if (atleast2(thread_mask)) { if (atleast2(thread_mask)) {
t->state |= TASK_SHARED_WQ; t->state |= TASK_SHARED_WQ;
t->tid = -1; t->tid = -1;

View File

@ -8462,9 +8462,6 @@ struct task *hlua_process_task(struct task *task, void *context, unsigned int st
struct hlua *hlua = context; struct hlua *hlua = context;
enum hlua_exec status; enum hlua_exec status;
if (atleast2(task->thread_mask))
task_set_affinity(task, tid_bit);
if (task->tid < 0) if (task->tid < 0)
task->tid = tid; task->tid = tid;

View File

@ -3284,7 +3284,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm
} }
chunk_appendf(&trash, chunk_appendf(&trash,
" task=%p (state=0x%02x nice=%d calls=%u rate=%u exp=%s tid=%d tmask=0x%lx%s", " task=%p (state=0x%02x nice=%d calls=%u rate=%u exp=%s tid=%d%s",
strm->task, strm->task,
strm->task->state, strm->task->state,
strm->task->nice, strm->task->calls, read_freq_ctr(&strm->call_rate), strm->task->nice, strm->task->calls, read_freq_ctr(&strm->call_rate),
@ -3293,7 +3293,6 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm
human_time(TICKS_TO_MS(strm->task->expire - now_ms), human_time(TICKS_TO_MS(strm->task->expire - now_ms),
TICKS_TO_MS(1000)) : "<NEVER>", TICKS_TO_MS(1000)) : "<NEVER>",
strm->task->tid, strm->task->tid,
strm->task->thread_mask,
task_in_rq(strm->task) ? ", running" : ""); task_in_rq(strm->task) ? ", running" : "");
chunk_appendf(&trash, chunk_appendf(&trash,
@ -3335,14 +3334,13 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm
} }
else if ((tmpctx = sc_appctx(scf)) != NULL) { else if ((tmpctx = sc_appctx(scf)) != NULL) {
chunk_appendf(&trash, chunk_appendf(&trash,
" app0=%p st0=%d st1=%d st2=%d applet=%s tid=%d tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n", " app0=%p st0=%d st1=%d st2=%d applet=%s tid=%d nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx, tmpctx,
tmpctx->st0, tmpctx->st0,
tmpctx->st1, tmpctx->st1,
tmpctx->_st2, tmpctx->_st2,
tmpctx->applet->name, tmpctx->applet->name,
tmpctx->t->tid, tmpctx->t->tid,
tmpctx->t->thread_mask,
tmpctx->t->nice, tmpctx->t->calls, read_freq_ctr(&tmpctx->call_rate), tmpctx->t->nice, tmpctx->t->calls, read_freq_ctr(&tmpctx->call_rate),
(unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time); (unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time);
} }
@ -3375,14 +3373,13 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm
} }
else if ((tmpctx = sc_appctx(scb)) != NULL) { else if ((tmpctx = sc_appctx(scb)) != NULL) {
chunk_appendf(&trash, chunk_appendf(&trash,
" app1=%p st0=%d st1=%d st2=%d applet=%s tid=%d tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n", " app1=%p st0=%d st1=%d st2=%d applet=%s tid=%d nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx, tmpctx,
tmpctx->st0, tmpctx->st0,
tmpctx->st1, tmpctx->st1,
tmpctx->_st2, tmpctx->_st2,
tmpctx->applet->name, tmpctx->applet->name,
tmpctx->t->tid, tmpctx->t->tid,
tmpctx->t->thread_mask,
tmpctx->t->nice, tmpctx->t->calls, read_freq_ctr(&tmpctx->call_rate), tmpctx->t->nice, tmpctx->t->calls, read_freq_ctr(&tmpctx->call_rate),
(unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time); (unsigned long long)tmpctx->t->cpu_time, (unsigned long long)tmpctx->t->lat_time);
} }