🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.unix.programming.kernel
Article #79

ʱ�ӵװ봦��,���½��ʱ�������???

#79
From: �������
Date: Wed, 13 Mar 2002 13:18
35 lines
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);
 }
}
--

����һ�ɳ徢�´�, �׿�����ʵû�й���.


�� ��Դ:��BBS ˮľ�廪վ smth.org��[FROM: 202.119.71.142]
Technical Details
Message-ID: <3lJ7Df$p8Q@smth.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!sienna.impulse.net!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!thunews.dhs.org!SMTH

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10e809,755a5633b7949d53,start
X-Google-Attributes: gid10e809,public
X-Google-ArrivalTime: 2002-03-13 05:29:12 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!sienna.impulse.net!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!thunews.dhs.org!SMTH
From: hushui110.bbs@smth.org (�������)
Newsgroups: cn.bbs.comp.unix.programming.kernel
Subject: ʱ�ӵװ봦��,���½��ʱ�������???
Date: 13 Mar 2002 13:18:38 GMT
Organization: BBS ˮľ�廪վ
Message-ID: <3lJ7Df$p8Q@smth.org>
X-Filename: KernelTech/M.1016025497.C0
Lines: 35