init_waitqueue_entry (&wait, current); /* 设置当前进程状态为TASK_UNINTERRUPTIBLE */ current->state = TASK_UNINTERRUPTIBLE; /* 将这个代表着当前进程的等待队列结点加入到wq这个等待队列 */ add_wait_queue (wq, &wait); /* 请求调度器进行调度,执行完schedule后进程会被移除CPU运行队列,只有等待队列唤醒...
* current io wait handle: wait queue entry to use for io waits * If this thread is processing aio, this points at the waitqueue * inside the currently handled kiocb. It may be NULL (i.e. default * to a stack based synchronous wait) if its doing sync IO. */ wait_queue_t *io_w...
我们看看内核中一个简单的sleep_on()函数: /* wq为某个等待队列的队列头 */voidsleep_on(wait_queue_head_t*wq){/* 声明一个等待队列结点 */wait_queue_t wait;/* 用当前进程初始化这个等待队列结点 */init_waitqueue_entry(&wait,current);/* 设置当前进程状态为TASK_UNINTERRUPTIBLE */current->state=...
//用于将进程链入HASH表 struct task_struct **pidhash_pprev; wait_queue_head_t wait_chldexit; //供wait4()使用 struct completion *vfork_done; //供vfork() 使用 unsigned long rt_priority; //实时优先级,用它计算实时进程调度时的weight值 //it_real_value,it_real_incr用于REAL定时器,单位为jiff...
entry->filp = filp; entry->wait_address = wait_address; /* 添加当前进程到等待队列, 这里面含有唤醒函数 */ init_waitqueue_entry(&entry->wait, current); add_wait_queue(wait_address,&entry->wait); } } 1. 2. 3. 4. 5. 6.
wait_queue_head_t *sleep; /* 等待队列,通常指向socket的wait域 */ struct dst_entry *dst_cache; /* 目的地缓存,用于路由查找结果 */ rwlock_t dst_lock; /* 目的地缓存锁*/ atomic_t rmem_alloc; /* 已接收队列字节数 */ struct sk_buff_head receive_queue; /* 接收包队列 */ ...
wait_queue_head_t *sleep; /* 等待队列,通常指向socket的wait域 */ struct dst_entry *dst_cache; /* 目的地缓存,用于路由查找结果 */ rwlock_t dst_lock; /* 目的地缓存锁*/ atomic_t rmem_alloc; /* 已接收队列字节数 */ struct sk_buff_head receive_queue; /* 接收包队列 */ ...
(wait_queue)中,处于不可中断等待态的进程是因为硬件环境不能满足而等待,例如等待特定的系统资源,它任何情况下都不能被打断,只能用特定的方式来唤醒它,例如唤醒函数wake_up()等 它们不能由外部信号唤醒,只能由内核亲自唤醒 4) TASK_ZOMBIE: 僵死 进程虽然已经终止,但由于某种原因,父进程还没有执行wait()系统...
init_waitqueue_func_entry(&virqfd->wait, virqfd_wakeup);init_poll_funcptr(&virqfd->pt, virqfd_ptable_queue_proc);events = vfs_poll(irqfd.file, &virqfd->pt);events = vfs_poll(fd_file(irqfd), &virqfd->pt);/* * Check if there was an event already pending on the eventfdLoading...
unsigned int policy;int nr_cpus_allowed;constcpumask_t*cpus_ptr;cpumask_t cpus_mask;#ifdefCONFIG_PREEMPT_RCUint rcu_read_lock_nesting;union rcu_special rcu_read_unlock_special;struct list_head rcu_node_entry;struct rcu_node*rcu_blocked_node;#endif/* #ifdef CONFIG_PREEMPT_RCU */#ifdefCONFI...