Home
last modified time | relevance | path

Searched refs:pcb (Results 1 – 25 of 33) sorted by relevance

12

/DragonOS-0.1.9/kernel/src/ipc/
Dsignal.rs47 let pcb = ProcessManager::find(pid); in send_signal_info() localVariable
49 if pcb.is_none() { in send_signal_info()
54 let pcb = pcb.unwrap(); in send_signal_info() localVariable
58 retval = self.send_signal(info, pcb.clone(), PidType::PID); in send_signal_info()
71 pcb: Arc<ProcessControlBlock>, in send_signal()
85 if !self.prepare_sianal(pcb.clone(), force_send) { in send_signal()
89 let pcb_info = pcb.sig_info_irqsave(); in send_signal()
97 if matches!(self, Signal::SIGKILL) || pcb.flags().contains(ProcessFlags::KTHREAD) { in send_signal()
100 self.complete_signal(pcb.clone(), pt); in send_signal()
124 pcb.sig_info_mut() in send_signal()
[all …]
/DragonOS-0.1.9/kernel/src/process/
Dfork.rs163 let pcb = ProcessControlBlock::new(name, new_kstack); in fork() localVariable
168 Self::copy_process(&current_pcb, &pcb, args, current_trapframe).map_err(|e| { in fork()
172 pcb.pid(), in fork()
177 ProcessManager::add_pcb(pcb.clone()); in fork()
180 procfs_register_pid(pcb.pid()).unwrap_or_else(|e| { in fork()
183 pcb.pid(), in fork()
188 ProcessManager::wakeup(&pcb).unwrap_or_else(|e| { in fork()
191 pcb.pid(), in fork()
196 return Ok(pcb.pid()); in fork()
308 pcb: &Arc<ProcessControlBlock>, in copy_process()
[all …]
Dsyscall.rs190 let pcb = ProcessControlBlock::new(name, new_kstack); in clone() localVariable
192 ProcessManager::copy_process(&current_pcb, &pcb, clone_args, current_trapframe)?; in clone()
193 ProcessManager::add_pcb(pcb.clone()); in clone()
196 procfs_register_pid(pcb.pid()).unwrap_or_else(|e| { in clone()
199 pcb.pid(), in clone()
205 pcb.thread.write_irqsave().vfork_done = Some(vfork.clone()); in clone()
208 if pcb.thread.read_irqsave().set_child_tid.is_some() { in clone()
209 let addr = pcb.thread.read_irqsave().set_child_tid.unwrap(); in clone()
212 writer.copy_one_to_user(&(pcb.pid().data() as i32), 0)?; in clone()
215 ProcessManager::wakeup(&pcb).unwrap_or_else(|e| { in clone()
[all …]
Dmod.rs194 pub fn add_pcb(pcb: Arc<ProcessControlBlock>) { in add_pcb()
199 .insert(pcb.pid(), pcb.clone()); in add_pcb()
203 pub fn wakeup(pcb: &Arc<ProcessControlBlock>) -> Result<(), SystemError> { in wakeup()
205 let state = pcb.sched_info().inner_lock_read_irqsave().state(); in wakeup()
207 let mut writer = pcb.sched_info().inner_lock_write_irqsave(); in wakeup()
214 sched_enqueue(pcb.clone(), true); in wakeup()
229 pub fn wakeup_stop(pcb: &Arc<ProcessControlBlock>) -> Result<(), SystemError> { in wakeup_stop()
231 let state = pcb.sched_info().inner_lock_read_irqsave().state(); in wakeup_stop()
233 let mut writer = pcb.sched_info().inner_lock_write_irqsave(); in wakeup_stop()
240 sched_enqueue(pcb.clone(), true); in wakeup_stop()
[all …]
Dkthread.rs200 pub unsafe fn set_create_ok(&self, pcb: Arc<ProcessControlBlock>) { in set_create_ok()
202 self.result_pcb.lock().replace(pcb); in set_create_ok()
309 let pcb = ProcessManager::find(kthreadd_pid).unwrap(); in init_stage2() localVariable
310 ProcessManager::wakeup(&pcb).expect("Failed to wakeup kthread daemon"); in init_stage2()
312 KTHREAD_DAEMON_PCB.replace(pcb); in init_stage2()
356 let pcb = Self::create(func, name)?; in create_and_run() localVariable
357 ProcessManager::wakeup(&pcb) in create_and_run()
358 .expect(format!("Failed to wakeup kthread: {:?}", pcb.pid()).as_str()); in create_and_run()
359 return Some(pcb); in create_and_run()
370 pub fn stop(pcb: &Arc<ProcessControlBlock>) -> Result<usize, SystemError> { in stop()
[all …]
Dexit.rs156 let pcb = ProcessManager::find(*pid).ok_or(SystemError::ECHILD)?; in do_wait() localVariable
157 let state = pcb.sched_info().inner_lock_read_irqsave().state(); in do_wait()
160 drop(pcb); in do_wait()
164 unsafe { pcb.wait_queue.sleep_without_schedule() }; in do_wait()
/DragonOS-0.1.9/kernel/src/sched/
Dcore.rs65 pub fn loads_balance(pcb: Arc<ProcessControlBlock>) { in loads_balance()
84 let pcb_cpu = pcb.sched_info().on_cpu(); in loads_balance()
89 && !pcb.flags().contains(ProcessFlags::NEED_MIGRATE)) in loads_balance()
91 pcb.flags().insert(ProcessFlags::NEED_MIGRATE); in loads_balance()
92 pcb.sched_info().set_migrate_to(Some(min_loads_cpu_id)); in loads_balance()
102 fn enqueue(&mut self, pcb: Arc<ProcessControlBlock>); in enqueue()
161 pub fn sched_enqueue(pcb: Arc<ProcessControlBlock>, mut reset_time: bool) { in sched_enqueue()
163 if pcb.sched_info().inner_lock_read_irqsave().state() != ProcessState::Runnable { in sched_enqueue()
169 if pcb.pid().into() > 0 { in sched_enqueue()
170 loads_balance(pcb.clone()); in sched_enqueue()
[all …]
Drt.rs52 pub fn enqueue(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue()
56 if pcb.pid().into() == 0 { in enqueue()
59 queue.push_back(pcb); in enqueue()
75 pub fn enqueue_front(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue_front()
79 if pcb.pid().into() == 0 { in enqueue_front()
82 queue.push_front(pcb); in enqueue_front()
156 pub fn enqueue_front(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue_front()
158 let priority = pcb.sched_info().priority().data() as usize; in enqueue_front()
160 self.cpu_queue[cpu_id][priority].enqueue_front(pcb); in enqueue_front()
231 fn enqueue(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue()
[all …]
Dcfs.rs65 pub fn enqueue(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue()
69 if pcb.pid().into() == 0 { in enqueue()
73 queue.insert(pcb.sched_info().virtual_runtime() as i64, pcb.clone()); in enqueue()
184 pub fn enqueue_reset_vruntime(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue_reset_vruntime()
185 let cpu_queue = &mut self.cpu_queue[pcb.sched_info().on_cpu().unwrap().data() as usize]; in enqueue_reset_vruntime()
188 pcb.sched_info() in enqueue_reset_vruntime()
192 cpu_queue.enqueue(pcb); in enqueue_reset_vruntime()
197 pub fn set_cpu_idle(&mut self, cpu_id: usize, pcb: Arc<ProcessControlBlock>) { in set_cpu_idle()
199 self.cpu_queue[cpu_id].idle_pcb = pcb; in set_cpu_idle()
278 fn enqueue(&mut self, pcb: Arc<ProcessControlBlock>) { in enqueue()
[all …]
Dsyscall.rs22 let pcb = do_sched(); in sched() localVariable
24 if pcb.is_some() { in sched()
25 let next_pcb = pcb.unwrap(); in sched()
/DragonOS-0.1.9/docs/kernel/sched/
Dcfs.md10 1. enqueue(): 将pcb入队列
11 2. dequeue(): 将pcb从调度队列中弹出,若队列为空,则返回IDLE进程的pcb
20 1. sched(): 是对于Scheduler trait的sched()实现,是普通进程进行调度时的逻辑处理,该函数会返回接下来要执行的pcb,若没有符合要求的pcb,返回None
21 2. enqueue(): 同样是对于Scheduler trait的sched()实现,将一个pcb加入调度器的调度队列
Drt.md13 1. enqueue(): 将pcb入队列
14 2. dequeue(): 将pcb出队列
21 1. pick_next_task_rt(): 获取当前CPU中的第一个需要执行的RT pcb
22 2. sched(): 是对于Scheduler trait的sched()实现,是实时进程进行调度时的逻辑处理,该函数会返回接下来要执行的pcb,若没有符合要求的pcb,返回None
23 3. enqueue(): 同样是对于Scheduler trait的sched()实现,将一个pcb加入调度器的调度队列
43 struct process_control_block *pcb_name = kthread_run_rt(&fn_name, NULL, "test create rt pcb");
47 2. pcb中涉及到实时进程的字段含义
Dc_waiting.md35 struct process_control_block *pcb;
49 &emsp;&emsp;函数`wait_queue_init(wait_queue_node_t *wait_queue, struct process_control_block *pcb)`提供…
97 | DECLARE_WAIT_ON_STACK(name, pcb) | 在栈上声明一个wait_queue节点,同时把pcb所代表的进程与该节点绑定 |
99 | DECLARE_WAIT_ALLOC(name, pcb) | 使用`kzalloc`声明一个wait_queue节点,同时把pcb所代表的进程与该节点绑定,请记得使用kfree释放空间 |
121 …eue_head_t *q, wait_queue_node_t *wait, void *lock) | 传入一个等待队列节点,将该节点的pcb指向的进程挂起,并设置挂起状态为PROC…
122 …rriptible(wait_queue_head_t *q, wait_queue_node_t *wait) | 传入一个等待队列节点,将该节点的pcb指向的进程挂起,并设置挂起状态为PROC…
Dcore.md10 1. cpu_executing(): 获取指定的cpu上正在执行的进程的pcb
/DragonOS-0.1.9/kernel/src/driver/tty/
Dtty_job_control.rs20 let pcb = ProcessManager::current_pcb(); in proc_set_tty() localVariable
23 ctrl.pgid = Some(pcb.pid()); in proc_set_tty()
24 ctrl.session = Some(pcb.pid()); in proc_set_tty()
26 assert!(pcb.sig_info_irqsave().tty().is_none()); in proc_set_tty()
28 let mut singal = pcb.sig_info_mut(); in proc_set_tty()
35 let pcb = ProcessManager::current_pcb(); in tty_check_change() localVariable
37 if pcb.sig_info_irqsave().tty().is_none() in tty_check_change()
38 || !Arc::ptr_eq(&pcb.sig_info_irqsave().tty().unwrap(), &tty) in tty_check_change()
47 let pgid = pcb.pid(); in tty_check_change()
51 if pcb in tty_check_change()
[all …]
Dkthread.rs24 let pcb = KernelThreadMechanism::create_and_run(closure, "tty_refresh".to_string()) in tty_flush_thread_init() localVariable
28 TTY_REFRESH_THREAD = Some(pcb); in tty_flush_thread_init()
/DragonOS-0.1.9/kernel/src/arch/x86_64/process/
Dsyscall.rs28 let pcb = ProcessManager::current_pcb(); in do_execve() localVariable
37 let mut basic_info = pcb.basic_mut(); in do_execve()
124 let pcb = ProcessManager::current_pcb(); in arch_prctl() localVariable
125 if let Err(SystemError::EINVAL) = Self::do_arch_prctl_64(&pcb, option, arg2, true) { in arch_prctl()
133 pcb: &Arc<ProcessControlBlock>, in do_arch_prctl_64()
138 let mut arch_info = pcb.arch_info_irqsave(); in do_arch_prctl_64()
161 if pcb.pid() == ProcessManager::current_pcb().pid() { in do_arch_prctl_64()
167 if pcb.pid() == ProcessManager::current_pcb().pid() { in do_arch_prctl_64()
/DragonOS-0.1.9/kernel/src/filesystem/vfs/
Dutils.rs37 pcb: &Arc<ProcessControlBlock>, in user_path_at()
47 let binding = pcb.fd_table(); in user_path_at()
65 let mut cwd = pcb.basic().cwd(); in user_path_at()
/DragonOS-0.1.9/kernel/src/libs/
Dwait_queue.rs263 let pcb = ProcessManager::current_pcb(); in before_sleep_check() localVariable
264 if unlikely(pcb.preempt_count() > max_preempt) { in before_sleep_check()
267 pcb.pid(), in before_sleep_check()
268 pcb.preempt_count() in before_sleep_check()
338 wq_guard.retain(|(es, pcb)| { in wakeup_any()
341 if ProcessManager::wakeup(pcb).is_ok() { in wakeup_any()
363 wq_guard.retain(|(es, pcb)| { in wakeup()
366 if ProcessManager::wakeup(pcb).is_ok() { in wakeup()
/DragonOS-0.1.9/docs/kernel/process_management/
Dkthread.md12 &emsp;&emsp;当内核其他模块想要停止一个内核线程的时候,可以调用`KernelThreadMechanism::stop()`函数,等待内核线程的退出,然后获得返回值并清理内核线程的pcb
/DragonOS-0.1.9/kernel/src/libs/futex/
Dfutex.rs62 .filter(|x| futex_q.pcb.ptr_eq(&x.pcb) && x.key == futex_q.key) in contains()
104 if futex_q.pcb.upgrade().is_some() { in wake_up()
106 ProcessManager::wakeup(&futex_q.pcb.upgrade().unwrap())?; in wake_up()
136 pcb: Weak<ProcessControlBlock>, field
261 let pcb = ProcessManager::current_pcb(); in futex_wait() localVariable
267 let wakeup_helper = WakeUpHelper::new(pcb.clone()); in futex_wait()
280 pcb: Arc::downgrade(&pcb), in futex_wait()
/DragonOS-0.1.9/kernel/src/filesystem/procfs/
Dmod.rs137 let pcb = ProcessManager::find(pid); in open_status() localVariable
138 let pcb = if pcb.is_none() { in open_status() localVariable
145 pcb.unwrap() in open_status()
151 &mut format!("Name:\t{}", pcb.basic().name()) in open_status()
156 let sched_info_guard = pcb.sched_info(); in open_status()
168 &mut format!("\nPid:\t{}", pcb.pid().into()) in open_status()
173 &mut format!("\nPpid:\t{}", pcb.basic().ppid().into()) in open_status()
184 &mut format!("\npreempt:\t{}", pcb.preempt_count()) in open_status()
190 if let Some(user_vm) = pcb.basic().user_vm() { in open_status()
209 &mut format!("\nflags: {:?}\n", pcb.flags().clone()) in open_status()
/DragonOS-0.1.9/docs/kernel/locking/
Dlocks.md27 &emsp;&emsp;进程在获取自旋锁后,将改变pcb中的锁变量持有计数,从而隐式地禁止了抢占。为了获得更多灵活的操作,spinlock还提供了以下的方法:
/DragonOS-0.1.9/kernel/src/arch/x86_64/ipc/
Dsignal.rs363 let pcb = ProcessManager::current_pcb(); in setup_sigcontext() localVariable
364 let mut archinfo_guard = pcb.arch_info_irqsave(); in setup_sigcontext()
417 let pcb = ProcessManager::current_pcb(); in do_signal() localVariable
419 let siginfo = pcb.try_siginfo_irqsave(5); in do_signal()
433 let pcb = ProcessManager::current_pcb(); in do_signal() localVariable
441 let sig_guard = pcb.try_sig_struct_irqsave(5); in do_signal()
445 let siginfo_mut = pcb.try_siginfo_mut(5); in do_signal()
464 kerror!("Trying to handle a Sigerror on Process:{:?}", pcb.pid()); in do_signal()
/DragonOS-0.1.9/docs/community/ChangeLog/V0.1.x/
DV0.1.4.md45 - scheduler: update: CFS调度器为每个核心设置单独的IDLE进程pcb(pid均为0) (#158)
47 - process: new: pcb中增加migrate_to字段 (#158)
135 5、CFS调度器为每个核心设置单独的IDLE进程pcb(pid均为0)
136 6、pcb中增加migrate_to字段

12