Thread View: cn.bbs.comp.unix.programming.kernel
1 messages
1 total messages
Started by �������
Wed, 13 Mar 2002 13:18
ʱ�ӵװ봦��,���½��ʱ�������???
Author: �������
Date: Wed, 13 Mar 2002 13:18
Date: Wed, 13 Mar 2002 13:18
35 lines
2001 bytes
2001 bytes
update_process_times��
if (p->counter < 0) {
p->counter = 0;
p->need_resched = 1;
}
if (p->priority < DEF_PRIORITY)
kstat.cpu_nice += user;
else
kstat.cpu_user += user;
kstat.cpu_system += system;
���� kstat�ṹ����ʲô�õ�
�����������Ѿ��ж��Ƿ�ʱ���Ƭ�Ѿ�������Ҫ���µ��ȣ������Ժ��update_one_pro
cess����
���õ�do_process_times��ʲô���� ,����Ҳ���ж���ʱ����SIGXCPU��ʱ�ź�
static inline void do_process_times(struct task_struct *p,
unsigned long user, unsigned long system)
{
long psecs;
psecs = (p->times.tms_utime += user);
psecs += (p->times.tms_stime += system);
if (psecs / HZ > p->rlim[RLIMIT_CPU].rlim_cur) { //����ж������õ�??
/* Send SIGXCPU every second.. */
if (!(psecs % HZ))
send_sig(SIGXCPU, p, 1);
/* and SIGKILL when we go over max.. */
if (psecs / HZ > p->rlim[RLIMIT_CPU].rlim_max)
send_sig(SIGKILL, p, 1);
}
}
--
����һ�ɳ徢�´�, ������ʵû�й���.
[m[31m�� ��Դ:��BBS ˮľ�廪վ smth.org��[FROM: 202.119.71.142][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads