- 论坛徽章:
- 0
|
回复 4# pcl001
老的版本叫keventd,后来改名了吧。。
# cat /proc/328/stat
328 (kworker/9:1) S 2 0 0 0 -1 69238880 0 0 0 0 0 7 0 0 20 0 1 0 225 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744071629582160 0 0 18 9 0 0 0 0 0 0 0 0 0 0 0 0 0
# cat /proc/328/wchan
worker_thread#
static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
{
struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
struct workqueue_struct *wq = cwq->wq;
const char *fmt = is_wq_single_threaded(wq) ? "%s" : "%s/%d";
struct task_struct *p;
p = kthread_create(worker_thread, cwq, fmt, wq->name, cpu);
static int worker_thread(void *__cwq)
{
struct cpu_workqueue_struct *cwq = __cwq;
DEFINE_WAIT(wait);
if (cwq->wq->freezeable)
set_freezable();
if(strncmp(current->comm,"rpciod",strlen("rpciod")==0)
current->extra_flags |= PFE_RPCIOD;
for (; {
prepare_to_wait(&cwq->more_work, &wait, TASK_INTERRUPTIBLE);
if (!freezing(current) &&
!kthread_should_stop() &&
list_empty(&cwq->worklist))
schedule();
finish_wait(&cwq->more_work, &wait);
try_to_freeze();
if (kthread_should_stop())
break;
run_workqueue(cwq);
}
return 0;
}
|
|