linux/kernel/posix-cpu-timers.c
<<
>>
Prefs
   1/*
   2 * Implement CPU time clocks for the POSIX clock interface.
   3 */
   4
   5#include <linux/sched.h>
   6#include <linux/posix-timers.h>
   7#include <linux/errno.h>
   8#include <linux/math64.h>
   9#include <asm/uaccess.h>
  10#include <linux/kernel_stat.h>
  11#include <trace/events/timer.h>
  12#include <linux/random.h>
  13#include <linux/tick.h>
  14#include <linux/workqueue.h>
  15
  16/*
  17 * Called after updating RLIMIT_CPU to run cpu timer and update
  18 * tsk->signal->cputime_expires expiration cache if necessary. Needs
  19 * siglock protection since other code may update expiration cache as
  20 * well.
  21 */
  22void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new)
  23{
  24        cputime_t cputime = secs_to_cputime(rlim_new);
  25
  26        spin_lock_irq(&task->sighand->siglock);
  27        set_process_cpu_timer(task, CPUCLOCK_PROF, &cputime, NULL);
  28        spin_unlock_irq(&task->sighand->siglock);
  29}
  30
  31static int check_clock(const clockid_t which_clock)
  32{
  33        int error = 0;
  34        struct task_struct *p;
  35        const pid_t pid = CPUCLOCK_PID(which_clock);
  36
  37        if (CPUCLOCK_WHICH(which_clock) >= CPUCLOCK_MAX)
  38                return -EINVAL;
  39
  40        if (pid == 0)
  41                return 0;
  42
  43        rcu_read_lock();
  44        p = find_task_by_vpid(pid);
  45        if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ?
  46                   same_thread_group(p, current) : has_group_leader_pid(p))) {
  47                error = -EINVAL;
  48        }
  49        rcu_read_unlock();
  50
  51        return error;
  52}
  53
  54static inline unsigned long long
  55timespec_to_sample(const clockid_t which_clock, const struct timespec *tp)
  56{
  57        unsigned long long ret;
  58
  59        ret = 0;                /* high half always zero when .cpu used */
  60        if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
  61                ret = (unsigned long long)tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
  62        } else {
  63                ret = cputime_to_expires(timespec_to_cputime(tp));
  64        }
  65        return ret;
  66}
  67
  68static void sample_to_timespec(const clockid_t which_clock,
  69                               unsigned long long expires,
  70                               struct timespec *tp)
  71{
  72        if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED)
  73                *tp = ns_to_timespec(expires);
  74        else
  75                cputime_to_timespec((__force cputime_t)expires, tp);
  76}
  77
  78/*
  79 * Update expiry time from increment, and increase overrun count,
  80 * given the current clock sample.
  81 */
  82static void bump_cpu_timer(struct k_itimer *timer,
  83                           unsigned long long now)
  84{
  85        int i;
  86        unsigned long long delta, incr;
  87
  88        if (timer->it.cpu.incr == 0)
  89                return;
  90
  91        if (now < timer->it.cpu.expires)
  92                return;
  93
  94        incr = timer->it.cpu.incr;
  95        delta = now + incr - timer->it.cpu.expires;
  96
  97        /* Don't use (incr*2 < delta), incr*2 might overflow. */
  98        for (i = 0; incr < delta - incr; i++)
  99                incr = incr << 1;
 100
 101        for (; i >= 0; incr >>= 1, i--) {
 102                if (delta < incr)
 103                        continue;
 104
 105                timer->it.cpu.expires += incr;
 106                timer->it_overrun += 1 << i;
 107                delta -= incr;
 108        }
 109}
 110
 111/**
 112 * task_cputime_zero - Check a task_cputime struct for all zero fields.
 113 *
 114 * @cputime:    The struct to compare.
 115 *
 116 * Checks @cputime to see if all fields are zero.  Returns true if all fields
 117 * are zero, false if any field is nonzero.
 118 */
 119static inline int task_cputime_zero(const struct task_cputime *cputime)
 120{
 121        if (!cputime->utime && !cputime->stime && !cputime->sum_exec_runtime)
 122                return 1;
 123        return 0;
 124}
 125
 126static inline unsigned long long prof_ticks(struct task_struct *p)
 127{
 128        cputime_t utime, stime;
 129
 130        task_cputime(p, &utime, &stime);
 131
 132        return cputime_to_expires(utime + stime);
 133}
 134static inline unsigned long long virt_ticks(struct task_struct *p)
 135{
 136        cputime_t utime;
 137
 138        task_cputime(p, &utime, NULL);
 139
 140        return cputime_to_expires(utime);
 141}
 142
 143static int
 144posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *tp)
 145{
 146        int error = check_clock(which_clock);
 147        if (!error) {
 148                tp->tv_sec = 0;
 149                tp->tv_nsec = ((NSEC_PER_SEC + HZ - 1) / HZ);
 150                if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
 151                        /*
 152                         * If sched_clock is using a cycle counter, we
 153                         * don't have any idea of its true resolution
 154                         * exported, but it is much more than 1s/HZ.
 155                         */
 156                        tp->tv_nsec = 1;
 157                }
 158        }
 159        return error;
 160}
 161
 162static int
 163posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *tp)
 164{
 165        /*
 166         * You can never reset a CPU clock, but we check for other errors
 167         * in the call before failing with EPERM.
 168         */
 169        int error = check_clock(which_clock);
 170        if (error == 0) {
 171                error = -EPERM;
 172        }
 173        return error;
 174}
 175
 176
 177/*
 178 * Sample a per-thread clock for the given task.
 179 */
 180static int cpu_clock_sample(const clockid_t which_clock, struct task_struct *p,
 181                            unsigned long long *sample)
 182{
 183        switch (CPUCLOCK_WHICH(which_clock)) {
 184        default:
 185                return -EINVAL;
 186        case CPUCLOCK_PROF:
 187                *sample = prof_ticks(p);
 188                break;
 189        case CPUCLOCK_VIRT:
 190                *sample = virt_ticks(p);
 191                break;
 192        case CPUCLOCK_SCHED:
 193                *sample = task_sched_runtime(p);
 194                break;
 195        }
 196        return 0;
 197}
 198
 199static void update_gt_cputime(struct task_cputime *a, struct task_cputime *b)
 200{
 201        if (b->utime > a->utime)
 202                a->utime = b->utime;
 203
 204        if (b->stime > a->stime)
 205                a->stime = b->stime;
 206
 207        if (b->sum_exec_runtime > a->sum_exec_runtime)
 208                a->sum_exec_runtime = b->sum_exec_runtime;
 209}
 210
 211void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
 212{
 213        struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
 214        struct task_cputime sum;
 215        unsigned long flags;
 216
 217        if (!cputimer->running) {
 218                /*
 219                 * The POSIX timer interface allows for absolute time expiry
 220                 * values through the TIMER_ABSTIME flag, therefore we have
 221                 * to synchronize the timer to the clock every time we start
 222                 * it.
 223                 */
 224                thread_group_cputime(tsk, &sum);
 225                raw_spin_lock_irqsave(&cputimer->lock, flags);
 226                cputimer->running = 1;
 227                update_gt_cputime(&cputimer->cputime, &sum);
 228        } else
 229                raw_spin_lock_irqsave(&cputimer->lock, flags);
 230        *times = cputimer->cputime;
 231        raw_spin_unlock_irqrestore(&cputimer->lock, flags);
 232}
 233
 234/*
 235 * Sample a process (thread group) clock for the given group_leader task.
 236 * Must be called with tasklist_lock held for reading.
 237 */
 238static int cpu_clock_sample_group(const clockid_t which_clock,
 239                                  struct task_struct *p,
 240                                  unsigned long long *sample)
 241{
 242        struct task_cputime cputime;
 243
 244        switch (CPUCLOCK_WHICH(which_clock)) {
 245        default:
 246                return -EINVAL;
 247        case CPUCLOCK_PROF:
 248                thread_group_cputime(p, &cputime);
 249                *sample = cputime_to_expires(cputime.utime + cputime.stime);
 250                break;
 251        case CPUCLOCK_VIRT:
 252                thread_group_cputime(p, &cputime);
 253                *sample = cputime_to_expires(cputime.utime);
 254                break;
 255        case CPUCLOCK_SCHED:
 256                thread_group_cputime(p, &cputime);
 257                *sample = cputime.sum_exec_runtime;
 258                break;
 259        }
 260        return 0;
 261}
 262
 263
 264static int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp)
 265{
 266        const pid_t pid = CPUCLOCK_PID(which_clock);
 267        int error = -EINVAL;
 268        unsigned long long rtn;
 269
 270        if (pid == 0) {
 271                /*
 272                 * Special case constant value for our own clocks.
 273                 * We don't have to do any lookup to find ourselves.
 274                 */
 275                if (CPUCLOCK_PERTHREAD(which_clock)) {
 276                        /*
 277                         * Sampling just ourselves we can do with no locking.
 278                         */
 279                        error = cpu_clock_sample(which_clock,
 280                                                 current, &rtn);
 281                } else {
 282                        read_lock(&tasklist_lock);
 283                        error = cpu_clock_sample_group(which_clock,
 284                                                       current, &rtn);
 285                        read_unlock(&tasklist_lock);
 286                }
 287        } else {
 288                /*
 289                 * Find the given PID, and validate that the caller
 290                 * should be able to see it.
 291                 */
 292                struct task_struct *p;
 293                rcu_read_lock();
 294                p = find_task_by_vpid(pid);
 295                if (p) {
 296                        if (CPUCLOCK_PERTHREAD(which_clock)) {
 297                                if (same_thread_group(p, current)) {
 298                                        error = cpu_clock_sample(which_clock,
 299                                                                 p, &rtn);
 300                                }
 301                        } else {
 302                                read_lock(&tasklist_lock);
 303                                if (thread_group_leader(p) && p->sighand) {
 304                                        error =
 305                                            cpu_clock_sample_group(which_clock,
 306                                                                   p, &rtn);
 307                                }
 308                                read_unlock(&tasklist_lock);
 309                        }
 310                }
 311                rcu_read_unlock();
 312        }
 313
 314        if (error)
 315                return error;
 316        sample_to_timespec(which_clock, rtn, tp);
 317        return 0;
 318}
 319
 320
 321/*
 322 * Validate the clockid_t for a new CPU-clock timer, and initialize the timer.
 323 * This is called from sys_timer_create() and do_cpu_nanosleep() with the
 324 * new timer already all-zeros initialized.
 325 */
 326static int posix_cpu_timer_create(struct k_itimer *new_timer)
 327{
 328        int ret = 0;
 329        const pid_t pid = CPUCLOCK_PID(new_timer->it_clock);
 330        struct task_struct *p;
 331
 332        if (CPUCLOCK_WHICH(new_timer->it_clock) >= CPUCLOCK_MAX)
 333                return -EINVAL;
 334
 335        INIT_LIST_HEAD(&new_timer->it.cpu.entry);
 336
 337        rcu_read_lock();
 338        if (CPUCLOCK_PERTHREAD(new_timer->it_clock)) {
 339                if (pid == 0) {
 340                        p = current;
 341                } else {
 342                        p = find_task_by_vpid(pid);
 343                        if (p && !same_thread_group(p, current))
 344                                p = NULL;
 345                }
 346        } else {
 347                if (pid == 0) {
 348                        p = current->group_leader;
 349                } else {
 350                        p = find_task_by_vpid(pid);
 351                        if (p && !has_group_leader_pid(p))
 352                                p = NULL;
 353                }
 354        }
 355        new_timer->it.cpu.task = p;
 356        if (p) {
 357                get_task_struct(p);
 358        } else {
 359                ret = -EINVAL;
 360        }
 361        rcu_read_unlock();
 362
 363        return ret;
 364}
 365
 366/*
 367 * Clean up a CPU-clock timer that is about to be destroyed.
 368 * This is called from timer deletion with the timer already locked.
 369 * If we return TIMER_RETRY, it's necessary to release the timer's lock
 370 * and try again.  (This happens when the timer is in the middle of firing.)
 371 */
 372static int posix_cpu_timer_del(struct k_itimer *timer)
 373{
 374        struct task_struct *p = timer->it.cpu.task;
 375        int ret = 0;
 376
 377        if (likely(p != NULL)) {
 378                read_lock(&tasklist_lock);
 379                if (unlikely(p->sighand == NULL)) {
 380                        /*
 381                         * We raced with the reaping of the task.
 382                         * The deletion should have cleared us off the list.
 383                         */
 384                        BUG_ON(!list_empty(&timer->it.cpu.entry));
 385                } else {
 386                        spin_lock(&p->sighand->siglock);
 387                        if (timer->it.cpu.firing)
 388                                ret = TIMER_RETRY;
 389                        else
 390                                list_del(&timer->it.cpu.entry);
 391                        spin_unlock(&p->sighand->siglock);
 392                }
 393                read_unlock(&tasklist_lock);
 394
 395                if (!ret)
 396                        put_task_struct(p);
 397        }
 398
 399        return ret;
 400}
 401
 402static void cleanup_timers_list(struct list_head *head,
 403                                unsigned long long curr)
 404{
 405        struct cpu_timer_list *timer, *next;
 406
 407        list_for_each_entry_safe(timer, next, head, entry)
 408                list_del_init(&timer->entry);
 409}
 410
 411/*
 412 * Clean out CPU timers still ticking when a thread exited.  The task
 413 * pointer is cleared, and the expiry time is replaced with the residual
 414 * time for later timer_gettime calls to return.
 415 * This must be called with the siglock held.
 416 */
 417static void cleanup_timers(struct list_head *head,
 418                           cputime_t utime, cputime_t stime,
 419                           unsigned long long sum_exec_runtime)
 420{
 421
 422        cputime_t ptime = utime + stime;
 423
 424        cleanup_timers_list(head, cputime_to_expires(ptime));
 425        cleanup_timers_list(++head, cputime_to_expires(utime));
 426        cleanup_timers_list(++head, sum_exec_runtime);
 427}
 428
 429/*
 430 * These are both called with the siglock held, when the current thread
 431 * is being reaped.  When the final (leader) thread in the group is reaped,
 432 * posix_cpu_timers_exit_group will be called after posix_cpu_timers_exit.
 433 */
 434void posix_cpu_timers_exit(struct task_struct *tsk)
 435{
 436        cputime_t utime, stime;
 437
 438        add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
 439                                                sizeof(unsigned long long));
 440        task_cputime(tsk, &utime, &stime);
 441        cleanup_timers(tsk->cpu_timers,
 442                       utime, stime, tsk->se.sum_exec_runtime);
 443
 444}
 445void posix_cpu_timers_exit_group(struct task_struct *tsk)
 446{
 447        struct signal_struct *const sig = tsk->signal;
 448        cputime_t utime, stime;
 449
 450        task_cputime(tsk, &utime, &stime);
 451        cleanup_timers(tsk->signal->cpu_timers,
 452                       utime + sig->utime, stime + sig->stime,
 453                       tsk->se.sum_exec_runtime + sig->sum_sched_runtime);
 454}
 455
 456static void clear_dead_task(struct k_itimer *itimer, unsigned long long now)
 457{
 458        struct cpu_timer_list *timer = &itimer->it.cpu;
 459
 460        /*
 461         * That's all for this thread or process.
 462         * We leave our residual in expires to be reported.
 463         */
 464        put_task_struct(timer->task);
 465        timer->task = NULL;
 466        if (timer->expires < now) {
 467                timer->expires = 0;
 468        } else {
 469                timer->expires -= now;
 470        }
 471}
 472
 473static inline int expires_gt(cputime_t expires, cputime_t new_exp)
 474{
 475        return expires == 0 || expires > new_exp;
 476}
 477
 478/*
 479 * Insert the timer on the appropriate list before any timers that
 480 * expire later.  This must be called with the tasklist_lock held
 481 * for reading, interrupts disabled and p->sighand->siglock taken.
 482 */
 483static void arm_timer(struct k_itimer *timer)
 484{
 485        struct task_struct *p = timer->it.cpu.task;
 486        struct list_head *head, *listpos;
 487        struct task_cputime *cputime_expires;
 488        struct cpu_timer_list *const nt = &timer->it.cpu;
 489        struct cpu_timer_list *next;
 490
 491        if (CPUCLOCK_PERTHREAD(timer->it_clock)) {
 492                head = p->cpu_timers;
 493                cputime_expires = &p->cputime_expires;
 494        } else {
 495                head = p->signal->cpu_timers;
 496                cputime_expires = &p->signal->cputime_expires;
 497        }
 498        head += CPUCLOCK_WHICH(timer->it_clock);
 499
 500        listpos = head;
 501        list_for_each_entry(next, head, entry) {
 502                if (nt->expires < next->expires)
 503                        break;
 504                listpos = &next->entry;
 505        }
 506        list_add(&nt->entry, listpos);
 507
 508        if (listpos == head) {
 509                unsigned long long exp = nt->expires;
 510
 511                /*
 512                 * We are the new earliest-expiring POSIX 1.b timer, hence
 513                 * need to update expiration cache. Take into account that
 514                 * for process timers we share expiration cache with itimers
 515                 * and RLIMIT_CPU and for thread timers with RLIMIT_RTTIME.
 516                 */
 517
 518                switch (CPUCLOCK_WHICH(timer->it_clock)) {
 519                case CPUCLOCK_PROF:
 520                        if (expires_gt(cputime_expires->prof_exp, expires_to_cputime(exp)))
 521                                cputime_expires->prof_exp = expires_to_cputime(exp);
 522                        break;
 523                case CPUCLOCK_VIRT:
 524                        if (expires_gt(cputime_expires->virt_exp, expires_to_cputime(exp)))
 525                                cputime_expires->virt_exp = expires_to_cputime(exp);
 526                        break;
 527                case CPUCLOCK_SCHED:
 528                        if (cputime_expires->sched_exp == 0 ||
 529                            cputime_expires->sched_exp > exp)
 530                                cputime_expires->sched_exp = exp;
 531                        break;
 532                }
 533        }
 534}
 535
 536/*
 537 * The timer is locked, fire it and arrange for its reload.
 538 */
 539static void cpu_timer_fire(struct k_itimer *timer)
 540{
 541        if ((timer->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
 542                /*
 543                 * User don't want any signal.
 544                 */
 545                timer->it.cpu.expires = 0;
 546        } else if (unlikely(timer->sigq == NULL)) {
 547                /*
 548                 * This a special case for clock_nanosleep,
 549                 * not a normal timer from sys_timer_create.
 550                 */
 551                wake_up_process(timer->it_process);
 552                timer->it.cpu.expires = 0;
 553        } else if (timer->it.cpu.incr == 0) {
 554                /*
 555                 * One-shot timer.  Clear it as soon as it's fired.
 556                 */
 557                posix_timer_event(timer, 0);
 558                timer->it.cpu.expires = 0;
 559        } else if (posix_timer_event(timer, ++timer->it_requeue_pending)) {
 560                /*
 561                 * The signal did not get queued because the signal
 562                 * was ignored, so we won't get any callback to
 563                 * reload the timer.  But we need to keep it
 564                 * ticking in case the signal is deliverable next time.
 565                 */
 566                posix_cpu_timer_schedule(timer);
 567        }
 568}
 569
 570/*
 571 * Sample a process (thread group) timer for the given group_leader task.
 572 * Must be called with tasklist_lock held for reading.
 573 */
 574static int cpu_timer_sample_group(const clockid_t which_clock,
 575                                  struct task_struct *p,
 576                                  unsigned long long *sample)
 577{
 578        struct task_cputime cputime;
 579
 580        thread_group_cputimer(p, &cputime);
 581        switch (CPUCLOCK_WHICH(which_clock)) {
 582        default:
 583                return -EINVAL;
 584        case CPUCLOCK_PROF:
 585                *sample = cputime_to_expires(cputime.utime + cputime.stime);
 586                break;
 587        case CPUCLOCK_VIRT:
 588                *sample = cputime_to_expires(cputime.utime);
 589                break;
 590        case CPUCLOCK_SCHED:
 591                *sample = cputime.sum_exec_runtime + task_delta_exec(p);
 592                break;
 593        }
 594        return 0;
 595}
 596
 597#ifdef CONFIG_NO_HZ_FULL
 598static void nohz_kick_work_fn(struct work_struct *work)
 599{
 600        tick_nohz_full_kick_all();
 601}
 602
 603static DECLARE_WORK(nohz_kick_work, nohz_kick_work_fn);
 604
 605/*
 606 * We need the IPIs to be sent from sane process context.
 607 * The posix cpu timers are always set with irqs disabled.
 608 */
 609static void posix_cpu_timer_kick_nohz(void)
 610{
 611        schedule_work(&nohz_kick_work);
 612}
 613
 614bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)
 615{
 616        if (!task_cputime_zero(&tsk->cputime_expires))
 617                return false;
 618
 619        if (tsk->signal->cputimer.running)
 620                return false;
 621
 622        return true;
 623}
 624#else
 625static inline void posix_cpu_timer_kick_nohz(void) { }
 626#endif
 627
 628/*
 629 * Guts of sys_timer_settime for CPU timers.
 630 * This is called with the timer locked and interrupts disabled.
 631 * If we return TIMER_RETRY, it's necessary to release the timer's lock
 632 * and try again.  (This happens when the timer is in the middle of firing.)
 633 */
 634static int posix_cpu_timer_set(struct k_itimer *timer, int flags,
 635                               struct itimerspec *new, struct itimerspec *old)
 636{
 637        struct task_struct *p = timer->it.cpu.task;
 638        unsigned long long old_expires, new_expires, old_incr, val;
 639        int ret;
 640
 641        if (unlikely(p == NULL)) {
 642                /*
 643                 * Timer refers to a dead task's clock.
 644                 */
 645                return -ESRCH;
 646        }
 647
 648        new_expires = timespec_to_sample(timer->it_clock, &new->it_value);
 649
 650        read_lock(&tasklist_lock);
 651        /*
 652         * We need the tasklist_lock to protect against reaping that
 653         * clears p->sighand.  If p has just been reaped, we can no
 654         * longer get any information about it at all.
 655         */
 656        if (unlikely(p->sighand == NULL)) {
 657                read_unlock(&tasklist_lock);
 658                put_task_struct(p);
 659                timer->it.cpu.task = NULL;
 660                return -ESRCH;
 661        }
 662
 663        /*
 664         * Disarm any old timer after extracting its expiry time.
 665         */
 666        BUG_ON(!irqs_disabled());
 667
 668        ret = 0;
 669        old_incr = timer->it.cpu.incr;
 670        spin_lock(&p->sighand->siglock);
 671        old_expires = timer->it.cpu.expires;
 672        if (unlikely(timer->it.cpu.firing)) {
 673                timer->it.cpu.firing = -1;
 674                ret = TIMER_RETRY;
 675        } else
 676                list_del_init(&timer->it.cpu.entry);
 677
 678        /*
 679         * We need to sample the current value to convert the new
 680         * value from to relative and absolute, and to convert the
 681         * old value from absolute to relative.  To set a process
 682         * timer, we need a sample to balance the thread expiry
 683         * times (in arm_timer).  With an absolute time, we must
 684         * check if it's already passed.  In short, we need a sample.
 685         */
 686        if (CPUCLOCK_PERTHREAD(timer->it_clock)) {
 687                cpu_clock_sample(timer->it_clock, p, &val);
 688        } else {
 689                cpu_timer_sample_group(timer->it_clock, p, &val);
 690        }
 691
 692        if (old) {
 693                if (old_expires == 0) {
 694                        old->it_value.tv_sec = 0;
 695                        old->it_value.tv_nsec = 0;
 696                } else {
 697                        /*
 698                         * Update the timer in case it has
 699                         * overrun already.  If it has,
 700                         * we'll report it as having overrun
 701                         * and with the next reloaded timer
 702                         * already ticking, though we are
 703                         * swallowing that pending
 704                         * notification here to install the
 705                         * new setting.
 706                         */
 707                        bump_cpu_timer(timer, val);
 708                        if (val < timer->it.cpu.expires) {
 709                                old_expires = timer->it.cpu.expires - val;
 710                                sample_to_timespec(timer->it_clock,
 711                                                   old_expires,
 712                                                   &old->it_value);
 713                        } else {
 714                                old->it_value.tv_nsec = 1;
 715                                old->it_value.tv_sec = 0;
 716                        }
 717                }
 718        }
 719
 720        if (unlikely(ret)) {
 721                /*
 722                 * We are colliding with the timer actually firing.
 723                 * Punt after filling in the timer's old value, and
 724                 * disable this firing since we are already reporting
 725                 * it as an overrun (thanks to bump_cpu_timer above).
 726                 */
 727                spin_unlock(&p->sighand->siglock);
 728                read_unlock(&tasklist_lock);
 729                goto out;
 730        }
 731
 732        if (new_expires != 0 && !(flags & TIMER_ABSTIME)) {
 733                new_expires += val;
 734        }
 735
 736        /*
 737         * Install the new expiry time (or zero).
 738         * For a timer with no notification action, we don't actually
 739         * arm the timer (we'll just fake it for timer_gettime).
 740         */
 741        timer->it.cpu.expires = new_expires;
 742        if (new_expires != 0 && val < new_expires) {
 743                arm_timer(timer);
 744        }
 745
 746        spin_unlock(&p->sighand->siglock);
 747        read_unlock(&tasklist_lock);
 748
 749        /*
 750         * Install the new reload setting, and
 751         * set up the signal and overrun bookkeeping.
 752         */
 753        timer->it.cpu.incr = timespec_to_sample(timer->it_clock,
 754                                                &new->it_interval);
 755
 756        /*
 757         * This acts as a modification timestamp for the timer,
 758         * so any automatic reload attempt will punt on seeing
 759         * that we have reset the timer manually.
 760         */
 761        timer->it_requeue_pending = (timer->it_requeue_pending + 2) &
 762                ~REQUEUE_PENDING;
 763        timer->it_overrun_last = 0;
 764        timer->it_overrun = -1;
 765
 766        if (new_expires != 0 && !(val < new_expires)) {
 767                /*
 768                 * The designated time already passed, so we notify
 769                 * immediately, even if the thread never runs to
 770                 * accumulate more time on this clock.
 771                 */
 772                cpu_timer_fire(timer);
 773        }
 774
 775        ret = 0;
 776 out:
 777        if (old) {
 778                sample_to_timespec(timer->it_clock,
 779                                   old_incr, &old->it_interval);
 780        }
 781        if (!ret)
 782                posix_cpu_timer_kick_nohz();
 783        return ret;
 784}
 785
 786static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp)
 787{
 788        unsigned long long now;
 789        struct task_struct *p = timer->it.cpu.task;
 790        int clear_dead;
 791
 792        /*
 793         * Easy part: convert the reload time.
 794         */
 795        sample_to_timespec(timer->it_clock,
 796                           timer->it.cpu.incr, &itp->it_interval);
 797
 798        if (timer->it.cpu.expires == 0) {       /* Timer not armed at all.  */
 799                itp->it_value.tv_sec = itp->it_value.tv_nsec = 0;
 800                return;
 801        }
 802
 803        if (unlikely(p == NULL)) {
 804                /*
 805                 * This task already died and the timer will never fire.
 806                 * In this case, expires is actually the dead value.
 807                 */
 808        dead:
 809                sample_to_timespec(timer->it_clock, timer->it.cpu.expires,
 810                                   &itp->it_value);
 811                return;
 812        }
 813
 814        /*
 815         * Sample the clock to take the difference with the expiry time.
 816         */
 817        if (CPUCLOCK_PERTHREAD(timer->it_clock)) {
 818                cpu_clock_sample(timer->it_clock, p, &now);
 819                clear_dead = p->exit_state;
 820        } else {
 821                read_lock(&tasklist_lock);
 822                if (unlikely(p->sighand == NULL)) {
 823                        /*
 824                         * The process has been reaped.
 825                         * We can't even collect a sample any more.
 826                         * Call the timer disarmed, nothing else to do.
 827                         */
 828                        put_task_struct(p);
 829                        timer->it.cpu.task = NULL;
 830                        timer->it.cpu.expires = 0;
 831                        read_unlock(&tasklist_lock);
 832                        goto dead;
 833                } else {
 834                        cpu_timer_sample_group(timer->it_clock, p, &now);
 835                        clear_dead = (unlikely(p->exit_state) &&
 836                                      thread_group_empty(p));
 837                }
 838                read_unlock(&tasklist_lock);
 839        }
 840
 841        if (unlikely(clear_dead)) {
 842                /*
 843                 * We've noticed that the thread is dead, but
 844                 * not yet reaped.  Take this opportunity to
 845                 * drop our task ref.
 846                 */
 847                clear_dead_task(timer, now);
 848                goto dead;
 849        }
 850
 851        if (now < timer->it.cpu.expires) {
 852                sample_to_timespec(timer->it_clock,
 853                                   timer->it.cpu.expires - now,
 854                                   &itp->it_value);
 855        } else {
 856                /*
 857                 * The timer should have expired already, but the firing
 858                 * hasn't taken place yet.  Say it's just about to expire.
 859                 */
 860                itp->it_value.tv_nsec = 1;
 861                itp->it_value.tv_sec = 0;
 862        }
 863}
 864
 865static unsigned long long
 866check_timers_list(struct list_head *timers,
 867                  struct list_head *firing,
 868                  unsigned long long curr)
 869{
 870        int maxfire = 20;
 871
 872        while (!list_empty(timers)) {
 873                struct cpu_timer_list *t;
 874
 875                t = list_first_entry(timers, struct cpu_timer_list, entry);
 876
 877                if (!--maxfire || curr < t->expires)
 878                        return t->expires;
 879
 880                t->firing = 1;
 881                list_move_tail(&t->entry, firing);
 882        }
 883
 884        return 0;
 885}
 886
 887/*
 888 * Check for any per-thread CPU timers that have fired and move them off
 889 * the tsk->cpu_timers[N] list onto the firing list.  Here we update the
 890 * tsk->it_*_expires values to reflect the remaining thread CPU timers.
 891 */
 892static void check_thread_timers(struct task_struct *tsk,
 893                                struct list_head *firing)
 894{
 895        struct list_head *timers = tsk->cpu_timers;
 896        struct signal_struct *const sig = tsk->signal;
 897        struct task_cputime *tsk_expires = &tsk->cputime_expires;
 898        unsigned long long expires;
 899        unsigned long soft;
 900
 901        expires = check_timers_list(timers, firing, prof_ticks(tsk));
 902        tsk_expires->prof_exp = expires_to_cputime(expires);
 903
 904        expires = check_timers_list(++timers, firing, virt_ticks(tsk));
 905        tsk_expires->virt_exp = expires_to_cputime(expires);
 906
 907        tsk_expires->sched_exp = check_timers_list(++timers, firing,
 908                                                   tsk->se.sum_exec_runtime);
 909
 910        /*
 911         * Check for the special case thread timers.
 912         */
 913        soft = ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur);
 914        if (soft != RLIM_INFINITY) {
 915                unsigned long hard =
 916                        ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max);
 917
 918                if (hard != RLIM_INFINITY &&
 919                    tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
 920                        /*
 921                         * At the hard limit, we just die.
 922                         * No need to calculate anything else now.
 923                         */
 924                        __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
 925                        return;
 926                }
 927                if (tsk->rt.timeout > DIV_ROUND_UP(soft, USEC_PER_SEC/HZ)) {
 928                        /*
 929                         * At the soft limit, send a SIGXCPU every second.
 930                         */
 931                        if (soft < hard) {
 932                                soft += USEC_PER_SEC;
 933                                sig->rlim[RLIMIT_RTTIME].rlim_cur = soft;
 934                        }
 935                        printk(KERN_INFO
 936                                "RT Watchdog Timeout: %s[%d]\n",
 937                                tsk->comm, task_pid_nr(tsk));
 938                        __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
 939                }
 940        }
 941}
 942
 943static void stop_process_timers(struct signal_struct *sig)
 944{
 945        struct thread_group_cputimer *cputimer = &sig->cputimer;
 946        unsigned long flags;
 947
 948        raw_spin_lock_irqsave(&cputimer->lock, flags);
 949        cputimer->running = 0;
 950        raw_spin_unlock_irqrestore(&cputimer->lock, flags);
 951}
 952
 953static u32 onecputick;
 954
 955static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
 956                             unsigned long long *expires,
 957                             unsigned long long cur_time, int signo)
 958{
 959        if (!it->expires)
 960                return;
 961
 962        if (cur_time >= it->expires) {
 963                if (it->incr) {
 964                        it->expires += it->incr;
 965                        it->error += it->incr_error;
 966                        if (it->error >= onecputick) {
 967                                it->expires -= cputime_one_jiffy;
 968                                it->error -= onecputick;
 969                        }
 970                } else {
 971                        it->expires = 0;
 972                }
 973
 974                trace_itimer_expire(signo == SIGPROF ?
 975                                    ITIMER_PROF : ITIMER_VIRTUAL,
 976                                    tsk->signal->leader_pid, cur_time);
 977                __group_send_sig_info(signo, SEND_SIG_PRIV, tsk);
 978        }
 979
 980        if (it->expires && (!*expires || it->expires < *expires)) {
 981                *expires = it->expires;
 982        }
 983}
 984
 985/*
 986 * Check for any per-thread CPU timers that have fired and move them
 987 * off the tsk->*_timers list onto the firing list.  Per-thread timers
 988 * have already been taken off.
 989 */
 990static void check_process_timers(struct task_struct *tsk,
 991                                 struct list_head *firing)
 992{
 993        struct signal_struct *const sig = tsk->signal;
 994        unsigned long long utime, ptime, virt_expires, prof_expires;
 995        unsigned long long sum_sched_runtime, sched_expires;
 996        struct list_head *timers = sig->cpu_timers;
 997        struct task_cputime cputime;
 998        unsigned long soft;
 999
1000        /*
1001         * Collect the current process totals.
1002         */
1003        thread_group_cputimer(tsk, &cputime);
1004        utime = cputime_to_expires(cputime.utime);
1005        ptime = utime + cputime_to_expires(cputime.stime);
1006        sum_sched_runtime = cputime.sum_exec_runtime;
1007
1008        prof_expires = check_timers_list(timers, firing, ptime);
1009        virt_expires = check_timers_list(++timers, firing, utime);
1010        sched_expires = check_timers_list(++timers, firing, sum_sched_runtime);
1011
1012        /*
1013         * Check for the special case process timers.
1014         */
1015        check_cpu_itimer(tsk, &sig->it[CPUCLOCK_PROF], &prof_expires, ptime,
1016                         SIGPROF);
1017        check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime,
1018                         SIGVTALRM);
1019        soft = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
1020        if (soft != RLIM_INFINITY) {
1021                unsigned long psecs = cputime_to_secs(ptime);
1022                unsigned long hard =
1023                        ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
1024                cputime_t x;
1025                if (psecs >= hard) {
1026                        /*
1027                         * At the hard limit, we just die.
1028                         * No need to calculate anything else now.
1029                         */
1030                        __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
1031                        return;
1032                }
1033                if (psecs >= soft) {
1034                        /*
1035                         * At the soft limit, send a SIGXCPU every second.
1036                         */
1037                        __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
1038                        if (soft < hard) {
1039                                soft++;
1040                                sig->rlim[RLIMIT_CPU].rlim_cur = soft;
1041                        }
1042                }
1043                x = secs_to_cputime(soft);
1044                if (!prof_expires || x < prof_expires) {
1045                        prof_expires = x;
1046                }
1047        }
1048
1049        sig->cputime_expires.prof_exp = expires_to_cputime(prof_expires);
1050        sig->cputime_expires.virt_exp = expires_to_cputime(virt_expires);
1051        sig->cputime_expires.sched_exp = sched_expires;
1052        if (task_cputime_zero(&sig->cputime_expires))
1053                stop_process_timers(sig);
1054}
1055
1056/*
1057 * This is called from the signal code (via do_schedule_next_timer)
1058 * when the last timer signal was delivered and we have to reload the timer.
1059 */
1060void posix_cpu_timer_schedule(struct k_itimer *timer)
1061{
1062        struct task_struct *p = timer->it.cpu.task;
1063        unsigned long long now;
1064
1065        if (unlikely(p == NULL))
1066                /*
1067                 * The task was cleaned up already, no future firings.
1068                 */
1069                goto out;
1070
1071        /*
1072         * Fetch the current sample and update the timer's expiry time.
1073         */
1074        if (CPUCLOCK_PERTHREAD(timer->it_clock)) {
1075                cpu_clock_sample(timer->it_clock, p, &now);
1076                bump_cpu_timer(timer, now);
1077                if (unlikely(p->exit_state)) {
1078                        clear_dead_task(timer, now);
1079                        goto out;
1080                }
1081                read_lock(&tasklist_lock); /* arm_timer needs it.  */
1082                spin_lock(&p->sighand->siglock);
1083        } else {
1084                read_lock(&tasklist_lock);
1085                if (unlikely(p->sighand == NULL)) {
1086                        /*
CPU25r>;
k_itimer *k_itimer *
         */
8e=out" clax-cpu-timers.c#L990" id=lax-c   cmers.c#L1030" id="L1030" class="line" name="L1030">1030                        check_process_t.cs=">.cs=a href="+code=x" class="sref">x;
 == expires = 0;
cpu.task;
1063 .it.1086.csode=p" class="sref">ppires = 0;
cpu.task;
 972                }
signal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" class="line" ="+codename="L1080">1080<="+code86utime,  >->exit_state)) {
1078it<> = 0;
 ==                         sum="unt>.csCPU25r>;
/*list_head *li>.csmers.c#L1037" id="L1037" class="line" name="L1037">10iWte" nav9">1tic029"ss="lass=hime"cpu-f">n, b0CPU25r>;
task_cputime .cslasef="+code=k_itimer" class="sref">k_itimer *1t yetstimer"   Takss=hpu-opportunity to/aERTHREAD" class="sref">CPU25r>;
soft;
>.csow.
         */
9e=out" cla class="line" name="L100la cl>.csmers.c#L1030" id="L1030" class="line" name="L1030">1030                        x;
it_clock, p, &now);
1076                expires = 0;
, now);
1079                        goto ppires1080<="+code86thread_group_cputi1erutimetaskf="+code=sighand" class="sref">sighand->siglock);
1083        } else {
ptimetimerit_clock, p, &now);
1076               {
 *timer, now);
1077                if (10010nfo(1085 1085rs.c1014" ctime below">1082                p1of_expires =  979
p1oclass="line" name="L100l1+code10/a>        /*
1ss="sref">1ched_expires = /*
1she curren1" class="line" name="L1011">10111kernel/posix-cpu-timers.c#L1002" id="LNow8cl-arm.c1014" cnewe="L1073">1073         */1a href="ke1nel/posix-cpu-timers.c#L1113" i11="L1003" class="line" name="L1003">1003        1BUG_ON>);
)
);
<)                if (cputime_to"line" na"kernel/posix-c"line" na>);
check_cpu_itimer(tsk10"sref"+codeghand->siglock);
1083        } else {
SIGPROF);
<1 href1"kerne      } else {
check_cpu_itimer(1080<="+code86p1lass="sref">SIGVTALRM1;
10ime" "+codeosix-cpu-timers.c#L1085" id="L1085" class="line" name="L1085">1085                if (        /*
1ref">soft<1a> != 1080 :      } else {
psecs = 1a hre12class="sref">cputime_expiresref="+code=p" class="sref">p, &.p, &hard =
p, &ACCESS_ONCE<1a>(, p, &cputime_t 
psecs >= /*
/*
105 href="ker    /*
1      * At1the hard limit, we just d1e.
 97d - Comparss=wo time_expires ix-itie068                 *1      * No1need to calculate anythin1 else1now.
/*
1 soft 1pan>
 9ation68                 *1group_send1sig_info" class="sref">__1roup_1end_sic#L1030" id="L1030" cla* @2"> 972:de=sE"> 9ation3">10s, agait;                 *1gde=psecs"1x-cpu-timers.c#L1032" id=1L103213kernel/posix-cpu-timers.c#L1 href="ker    /*
1pu-timers.1#L1033" id="L1033" class=1line"13="L1003" class="line" name="14" id=s @e073"  agait; 9721to se> >-&d=y field of @e073"  ROF"2"> 97d68                 *1g the spec1f">psecs >=                  *1ga href="k1an>
1O88"rwise32 s fals073         */1      * At1the soft limit, send a SI1XCPU 1very second.

cputime;
 97dass="line" name="L1 97dosix->cputime;
it                        __1roup_1end_sig_info(cputime;
 981                         soft < <1 href1"+code                       soft++;1 981 /a>, &it<> = 0;
it/a>, & 981 /a>, &sig->1a hre1="+code=rlim" class="s2  1               if ( 981 /a>, &1006p="sref">it<> = 0;
it/a>, &it/a>, &1006p=4" id="L1034" class=lass="line" name="L981"> 981 /a>, &1006               if (1043 2  1               if ( 981 /a>, &1007
cpu-0p="sref">it              if (prof_expires || 1a href="+code=x" cime" class="sre;it/a>, &1007
c=4" id="L1034" class=lass="line" name="L981"> 981 /a>, &1007
               if (prof_expire1 1   1               if (12               }
11041        -&g1;/*
1sig-&g1;/*         */1sig-&g1;/*
1ero" class1"sref">task_cputime_zero<1a>(&a15="L1003" class="line" name="14@tsk:L1047">1s.c#L1068(=hime") bee="Lass="rs68                 *1ss_timers"1class="sref">stop_process1timer15="L1074" class="line" name="*8                 *1sa href="k15" class="line" name="L1015">1015="L1015" class="line" name="* " id="lass="L1id="L=hime"cclass014">101  If both arss cla8(=herssarssno/aERTHREAD" class="sref">CPU25r>;
10515ery second.
CPU25r>;
1"0m>/* 9ation3">10s7>1R /aERTHREAD" class="sref">CPU25r>;

 97d,4 2  fals07/aERTHREAD" class="sref">CPU25r>;
);
cputime);
p = timer->1038       posix_cpu_timer_sc1edule1/a>(st                       1016"line" name="sref">p = 1054            }
task_struct *1018  ig" class="sref">sline" name="L1006">1006            }
now;
10616res" class="sref">cputime_toa>;
it[1018  iref">cputime_expires<"line" name="L1006">1006             }
/*

x < <">sig->cputime_expirese=it" class="sref">itsix-cpu-timers.c#L1053" id="L1053" class="line" name="L1053">1053                          cputime;
 = 1018                         out;
1006ptimers.c#L1052" id"line" name="L1006">1006                        10717=a href="+code=x" class="sref"L1063" class="l=07" id="L1007" class="line" name="L1007">1007
citsix-cpu-timers.c#L10s class="line" nam
"L1063" class="l=07" id="L1007" class="line" name="L1007">1007
                       ex}            }
soft) {
;
 97dass="line" name="L1 97dosix-cpu-timers.c#L1085" id="decputime_expirese=it" class="sref">itsix-cpu-timers.c#L1053" id="L1053" class="line" name="L1053">1053             }
CPUCLOCK_PERTHREA1(17ode=tasklist_lock" clllllllll2  1               if (cpu_clock_sampl1(1a href="+code=bump_cpu_timerunlikely(1054citsix-cpu-timers.c#L10srs.c#r" class="sref"ers.c#            }
clear_de1d_tas1())

"L1063" class="l">1ntime);
1ntim a                       out;
cputime;
 =         /*
1 class="sr1f">read_lock(&tasklaw_f="+code=sighand" class=law_f="+code=osix-cpu-timers.c#L1085" r/a>))

"L1063" class="lode=sighand" class=1085                if (spin_lock(&p->))

"L1063" class="la href="kernel/posix-cmers.c#L998               if ((10iaw_f="+c"+codeosix-cpu-timers.c#L1085" r/a>))

"L1063" class="lode=sighand" class=1085                if (read_lock(&unlikely(p-> 97dass="line" name="L1 97dosix-cpu-timers.c#L1085" END_SIGcputime_expires))
1053                /*
  1               if (1048
                       }
check_process_t.1s=">.1s=a hr.19="L1003" class="line" name=a href="ker    /*
1s-timers.c1ref">signal_struct *c1ref>.19="L1074" class="line" name="* six-cpu-timers.c#L1058" pu-timinterrupt timeler.>1s.c#irq timelermROFhref="ker    /*
1sa href="k1s="sref">utime, 10s7>1We"L1029" cl id=">-&d=y >/*1029                  19y" class=1untime" class="sref">sum=1unt>.19ery second.
                  19nt">/*list_head *li>.1smers.c#L1037" id="L1037" cla=03        task_cputime .1slasefruct nownowp = timer->1038       soft;
>.19+code                       cputime_expiresLIST_H1er/a>);
1                if (timer)
1061{,id="L1061" class="L10" name="L1061">"L10L998               if (thread_group_cputi2er1BUG_ON>);
)
);
<)                if (utimeptime/*
2"6ptime * 97dL=hime"c1014"ime"href="ker    /*
2"7ptimetask_cputime 10020lasef="+code=k_itimer" class="sref">*cclass014">101  If "ss=e" nameso, justt2 29                  2s="sref">p2of_expires = 
p2oclass="line" name="L100l2+code20="kernel/posi>-&ga>)
);
1038        2ched_expires = 10121ires"a href="kernel/posix-cpu-timers.c#L1042a href="ke2nel/posix-cpu-timers.c#L1213" i21;timer href="kernel/posix-cclass>timer href=L998gt;it[
21/a>(utime/*
2<>ptimecheck_cpu_itimer(
*cHsrsswss="ke off "sksix-cers.c#six-cf">now/*
2<6ptimeSIGPROF);
<2 href21mers.c#L1037" id="L1037" class="line h"sksix-cf">now1, ef=L9ef="ker    /*
2<7ptimecheck_cpu_itimer(*cputs=hem onel/po068">1 085"29                  2I="sref">p2lass="sref">SIGVTALRM2;

soft 2 cputime_expiresass="_uhime" owit[1er/a>);
1                if (soft<2a> != /*
2ode=psecs"2class="sref">psecs = 2a hre22kernel/posix-cpu-timers.c#L1002" id="LIf "ssrssarssd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" class="sref">soft) {
;
 97dass="line" name="L1 97dosix-cpu-timers.c#L1085" id="deche 08tals.it[soft 2 it_clock)) {
/*
1075      ())
out;
cputime;
it_clock)) {
/*/*2/span22+code=now" class="sref">now);
1055
105="+code=RLIM2INFIN229e499e05ef033ac664b362d0f_3/1000">/*
2ode=psecs"2class="sref">psecs = 2"comment">="kernel/posix-cpu* time_2xpire22" class="sref">itsix-cpu-timers.c#L10sr2          2 *1      * No1need to cal2ulate227LIf "ssrssarssd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" class2E" cl21cl0" id="L1030" cla* @e073"2:de=s2s.c#L106_expires e=time="L1tod="L1074" We mode=releasf="kesf=s2alne" forlass=e=th29soft 2 __1roup_1endd="L1074" Tix-cpis a pot/*/po0egroup_cput2>soft 2    2             *1gde=psecs"2x-cpu2timers.c#L1032" id=1L103213ked="L1074" itimer  code=thread_nterr"+codseakss=hpu-opportunity to/aERTHREAD" class="sref2="L1003" c2ass="line" name="14" id=s2@e0732  agait; 9721to se> >-&"+code=k_it="+code=thutim in eacpotde=u,ef=po068"> dele97d,4003                 *1g th2 spec2f">psecs >= 1069                  2I="sref="comment"2                 *1ga hre2="k1a2>
kss=""keu-tiofsref">* ass=1oclaspan class="comment">                  2I="sref=an>
1      2 At1t2e soft limit, send a SI1XCPU t_clock" class="sref">it_clock)) {

21/a>(utime
2ode=psecs"2class="sref">psecs =  href="2">297dosix->cput23" class="sref">itsix-cpu-timers.c#L10sr2href="+cod2=itlass="line" name="L9812> 981237LIf "ssrssarssd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" clasodlass="li2e" name="L981"> 981 /2>, &a23.c#L106_expires e=time="L1tod="L1074" 3uts=hem onel/pd,4a hrreadr"+codt="+code=thutim,-cp.1"a href="k1-timers.c#L1074" 17=soft" clasef">it<> =20;
__1roup_1endd="L1074" nopd,commenttouss="liihrreadrp_1ries  Ta umInter"srefentts="-cp.1"a href="k1-timers.c#L1074" 17=soft" clas name=">-&2t;it<> =20;
 9721to se> >-&"+code=k_it ass=ef">pmment"liL1fe             1BUG_ON>);
)
2"L1007">1027
cpu-0p="sref">it   2     242">utime
21/a>class="ers.c#L1064" it;/*signal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" clas_1ry"+code=sig" clas_1rytimers.c#L998" = 10072/a>
c=4" id="L1034" class2lass=2line" name="L981">>>>>name="L1038">103812               }
cputime_expirese=it" class2kernel/pos2x-cpu-timers.c#L1051" id=2L104124077                if (1083        } else {
p->-&g1;signal_ref="del_inrslse {
signal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" clas_1ry"+code=sig" clas_1rytimere1="+co1e=p" class="sref">p->/*2/span24ass="sre1">out;
<="L1038">1038hard =
signal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" cla   /*p->it<> =230" id="L1030" cla* fastp2th"de24ref="kernel/posix-cp.f">hard =
signal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" cla   /*2s.c#L1068(=hime") bee="Lass="""""""""""""""""code=k_ode=thutim is -11075we030">idednel/poa reseakss=hpu-opportunity to/aERTHREAD" class="sref2*1ss_timer2"1class="sref">stop_proce2s1tim2r15="L1074" class="line" name""""""""""""""""cocond.1029101  I""""""""""""""""coalmost-_ode=thaspan  &  an ="L1d_group_cput2>soft 2 CPU25r>;
10515""""""""""""""""c"kernrqs_disable="kernel/posix-cnrqs_disable=>2"sref">CPU25r>;
cputime_expires))
lass   CP225r>;
k_itimer *lass=emptslass   claan class="commelass   cla timers.
21/a>class="ers.c#L1064" it;p->1083        } else {
p->);
25s = p = psecs2href=ers.c2de=timer" class="sref"ers2c#de=26"LIf "ssrssarssd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" clas/a>       2    }
 97"keu d="omem onel/pwx-cpreschedu"linafe01if e css2ine" name="L1006">1006psecs >= 
1 soft 1pan>
->it_clock)) {
12181075      ())
out;
cputime;
it_clock)) {
signow);
p->it<2a>six-cpu-timers.c#L1053"2id="L2053" ce1="+co119e499e05ef033ac664b362d0f_3/102ode=it_cl"2code__1roup_1end_sSetpd,cocond.
1 soft 1pan>
itsix-cpu-timers.c2L10s 27pires15kernel/posix-cpu-timerslass="sksix-cf"roupksix-cf"s2alsmode=be h    by09"sref">er>
1 soft 1pan>
it_clock)) {
 97dass="li2e" na2e="L1< name="L1038">1038;
>.19+code                       1038it_clock)) {
cputime_expireseitimer *lass=emptslasef="_timers"1="sref">now;
now;
it_clock)) {
 = unl2kely(1085 1085rs.ce1="+co1e=p" class="sref">p->1054citsix-cpu-timers.c#L10sr2.c#r" clas2="sref"ers.c#        2   }
2a href="kernel/posix-cp.1ear_e=cputime2to_ex20/a>        if (="L1038">1038hard =
tCPUCLOCK_SCHE p->);
1nt2m27"+code=unlik1>soft 1 10l    =idx/posix-cpu-timer    =idx"L10,ar_de1d_tas1(now);
psecs2>tasklaw_f2"+code=sighand" class=law2f="+c28"LIf "ssrssar075">1075      oldvel/posix-cpu-timeoldveltimers.c#L998" = 
"L16_expires e=time="L1tid-cp.1"a href="k1-timers.c#L1074" 17=soft" clas/posix-cpu2timers.c#L1053" id=f="+co2e=sig2815="L1074" class="line" name""""""""""""""""coWcpu-tiseate=thit=sof.slass*oldvelpis absolu>  and5we0/span>-cp.1"a href="k1-timers.c#L1074" 17=soft" clas/101  I""""""""""""""""coitE"> 9atrela#L10, *="wvelpu-gu>101pis rela#L10 and5we0/span>-cp.1"a href="k1-timers.c#L1074" 17=soft" clas/a href="+2;
 97dass="li2e" na28ss="line" name="L1051">10515""""""""""""""""coitE"> 9atabsolu> >
1 soft 1pan>
);
<2 href21mers.c#L1037" id="""""""""cclass="sref">it_clock)) {
10482/a>
 =  = now = out;
  cla."cclass="sref">it_clock)) {
;d,c_jiffsrs.ce1="+co1e=p" class="sref">p->
"L1063" cl}ode=th.c#L998" = /*<2span>29sig" cla3" id=f/a>
"Le" name=""""""""c"+cod0lag classoldvel/posix-cpu-timeoldveltime -    * At1 class="e=now" class="sref">nowp->
"L1063"1063" cl}1="+co1e=p" class="sref">p->/*
1sa href="k2s="sr29ref">cputime_expirese}1="+co1e=p" class="sref">p->
2"6ptime * *li>.1smers.c#L1032" id=29 iref">cputime_expiresit_clock)) {
now29r" class="sref">k_itimer go"> "+cod0lag classop, &p->timer-> = nowp->psecs3="L1061" c3ass="L10" name="L1061">"L30L99830"LIf "ssrssarssd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3en2 lass="3ine" name="L993"r2003" 203xpir 30> 97dass="line" name="L1 9Uspan>OF"2"> 97d,4cache1075we0ref="ke earliest/tde=u,e, ag"L1dualuhimp.1"a href="k1-timers.c#L1074" 17=soft" cla3e22 lass="3iss="line" name="* six-cp3ref="30/posix-cpu-timers.c#L1074" id="L1074" RLIMIT_CPU limi1pis earlie1if 88"profcode "+cit ass=01  If>
1 soft 1pan>
->it_clock)) {
/30ine" name="L1switch5">1075      l    =idx/posix-cpu-timer    =idx"L10as.c#L998" = hard =
tCPUCLOCK_PROFhref:c#L998" = d="L1080" clasde=unl_g, &
21/a>))
out;
cputimeit_clock)) {
p2of_expires 3  = 
21/a>))
out;
cputimep->-&ga>)
out;
p->hard =
tCPUCLOCK_VIRThref:c#L998" = d="L1080" clasde=unl_g, &
21/a>))
out;
cputimeit_clock)) {
ti31sig" cla3" id=f/a>
"Le" name=rs.
21/a>))
out;
cputimep->it[<3 href="+code=CPUCLO0lag c3ass="31cla3" id=f/a>
"L1063"breake1="+co1e=p" class="sref">p->*cHsr"+cod0lag classop, & = SIG31c#L1083" id="L1083" class="lut19ar_dead_t1f_kial_nohzref="kernel/posut19ar_dead_t1f_kial_nohz=utimee1="+co1e=p" class="sref">p->
2<7ptimec3eck_c3153" ce1="+co119e499e05ef033ac664b362d0f_3/103">p2lass="3ref">SIGVTALRM2;
cputime_expire3ass="3uhime"imer" cname="L1038">10381038n    id_t#L108="L1038">1038span _ce1038utimeit_clock)) {
1e3/a>);31id="L1071" class="line" name="""";
>f="specs="ers.c#L1064" it;spec;
tals.signal_structrref">it_clock)) {
10543s="sref">s3ft) {
;
task_struct *>f="ss="ers.c#L1064" it;p->it[<3      if (1038p->it[
/*
/*<3 /*3/span32OF);
<2 href21mers.c#L1037" id="L1Setp1069 3 goline>
1 soft 1pan>
it_clock)) {
signal_memse =utim
>f="ss="ers.c#L1064" it;p->soft 1 signal_      } e_inrs=utim
cputime *(p->[1            >class="ers.c#L1064" it;cputimeix-cep->   3             *1gde=psecs"3x-cpu330 hreff68">1            >class="ers.c#L1064" it;cputimeix- &            erross="ers.c#L1064"errosa hr     * At1 class="ut19ar_dead_t1f_creataan class="commeut19ar_dead_t1f_creata=utim
p->it[<3">                 *1g th3 spec33     }
cputimeix-me="L10time     * At1 class="nurrlasemers"1="sref">nurrlashrefe1="+co1e=p" class="sref">p-> = >>>>imer" c;
tals.om1T_rs.c#ref">signal_om1T_rshrefe1="+co1e=p" class="sref">p->/*<3a &);
33es" class="sref">cputime_expirese=it" class3 href="2">397dosix->cput33077                if (signal_memse =utim"+cod0lag class" .c#ref">signal_struct, 0mesignal_structre1="+co1e=p" class="sref">p->signal_struct
p-> 981 /3>, &a33sref">check_process_t.1s=">.1s=a hrit<> =30;
hard =
<      } e_irq.c#ref">signal_      } e_irq=utim
cputime *(p->signal_ut19ar_dead_t1f_se =utim
1038utimesignal_struct,+c signal_NULLp->
"L075"">d="L1080" clasrross="ers.c#L1064"errosa hras.c#L998" = -&3t;
"L1063"1063" clf">hard =
<           =irq.c#ref">signal_           =irq=utim
cputime *(p->
cpu-0p="sref">it   3     34ref">cputime_expireseitimer1038p->10073/a>
c=4" id="L1034" class3lass=3line" name="L981">>>>>e1="+co119e499e05ef033ac664b362d0f_3/1031047">12               }
cputime_expirese=it" class3kernel/pos3x-cpu-timers.c#L1051" id=3L104134077              spale        nurrlashref)as.c#L998" = -&g1;d="L1080" cla>class="ers.c#L1064" it;cputimesignal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" clas              if ( = /*3/span34ass="sre1">out;
<
"L1063"1063" clfsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3 f">it<> =330" id="L1030" cla* fastp3th"de34o" class="sref">__1roup_1endd="L1074444444444444444444444444* Our/a>1sig3/a>-&g1;
1 soft 1pan>
3s.c#L1068(=hime") bee="Lass="""""""""""""""""4444444444444444*class="sref">it_clock)) {
stop_proce3s1tim35cla3" id=f/a>
"L1063"1063" cl1063" clf * At1 class="ut19ar_dead_t1f_del.c#ref">signal_ut19ar_dead_t1f_del=utim
p->cputime_expireseitimer 3" clf * At1 class="           =irq.c#ref">signal_           =irq=utim
cputime *(p->CPU35r>;
>>>>>>>>>>>>>>>>>>>>ass="srefr1e=l>.1sires"a href="kernel/posix-cpu3"sref">CPU35r>;
cputime_expireeeeeeeeee1="+co119e499e05ef033ac664b362d0f_3/103="sref">CP325r>;
itsix-cpu-timers.c#L10sr3"ke1" id="31041was delivered and we 3ave1t35ires =  3" clfsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3" clasuct 3a &);
35.c#L106_expires e=time="L1tod="L10744444444444444444* Bs2alst 1alacass   cla (or a rs.c#L)iws="s umI-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3"f">it<> =3s="osix-sref">p = __1roup_1endd="L10744444444444444444*class="sref">it_clock)) {

"L1063" clref">cputimep->       3    }

"Le" name=rs.
21/a           =irq.c#ref">signal_           =irq=utim
cputime *(p->s3ine" name="L1006">1006
"L1063"1063" clf">hard =
< chedu"l.c#ref">signal_ chedu"l=utimee1="+co1e=p" class="sref">p->cputime_expireseitimerhard =
<      } e_irq.c#ref">signal_      } e_irq=utim
cputime *(p->1318>>>>e1="+co119e499e05ef033ac664b362d0f_3/103 <">sigcputime_expirese=it" class3"sref">it<3a>six-cpu-timers.c#L1053"3id="L36077               sd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3ode=it_cl"3code
>>>>>>>>cclass="sref">it_clock)) {
it<> =3               hard =
< 6" clato_>f="specs="ers.c#L1064" 6" clato_>f="spec=utim"+cod0lag classspan _cespan _ced="L1080" cla>class="ers.c#L1064" it;cputimesignal_struct *c#ref>.csref="+code=sig" class="sref">d="L1080" clas              if (d="L1080" clarqteref="kernel/posrqtehrefre1="+co1e=p" class="sref">p->itsix-cpu-timers.c3L10s 37ke2nel/posix-cpu-timesa>            erross="ers.c#L1064"errosa hr     * At1 class="ut19ar_dead_t1f_se .c#ref">signal_ut19ar_dead_t1f_se =utim
, signal_om1T_rshref,+c signal_structre1="+co1e=p" class="sref">p->       3f="kernel/posix-cp.1es_ti3ers"137sig" cla3" id=f/a>
"L075"       =  97dass="li3e" na37cla3" id=f/a>
"L1063"1063" clfsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3
101  I"""""""""""""""">>>>>>>>coT>10515"""""""""""""""">>>>>>>>cclass="sref">it_clock)) {
unl37 iref">cputime_expireeeeeeeeef * At1 class="ut19ar_dead_t1f_del.c#ref">signal_ut19ar_dead_t1f_del=utim
p->1054c        3   }
37ires = signal_           =irq=utim
cputime *(p->);
1nt3m37sref">check_process_t.1s=">.1s=a hr          3 }
            erross="ers.c#L1064"errosa hr      * At1 class="TIMER_RETRYan class="commeTIMER_RETRYa hras.c#L998" = 
"L1063" clrsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3ernel/posi3-cpu-timers.c#L1053" id=f3"+cod38.c#L1068(=hime") bee="Lass="""""""""""""""""44444444coWcpnef "so roupleseu d=woen a>soft 2 soft 2 101  I""""""""""""""""44444444counlourcemI-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3/a href="+3;
 97dass="li3e" na38ss="line" name="L1051">10515""""""""""""""""44444444cclass="sref">it_clock)) {
cputime_expireeeeeeeeef * At1 class="      } e_irq.c#ref">signal_      } e_irq=utim
cputime *(p->10483/a>
signal_ut19ar_dead_t1f_del=utim
p-> = signal_           =irq=utim
cputime *(p->out;
psecs3timers.c#L30419class="sr1class="line3 name39ass="line" nam
"L075"m"+cod0lag class" .c#ref">signal_struct
cputimesignal_struct
cputime = /*<3span>39sig" cla3" id=f/a>
"Le" name=rsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3tposix-cpu3ass="line" name="* six-cp3-time3915="L1074" class="line" name""""""""""""""""44444444coIts.c#ualuh did f If0recond.I-cp.1"a href="k1-timers.c#L1074" 17=soft" cla3t/*
1sa href="k3s="sr39id="L=hime"cclass014">101  I""""""""""""""""44444444cclass="sref">it_clock)) {
>>>>>>>>>>>>ass="srefr1e=l>.1sires"a href="kernel/posix-cpu3ad *li>.1smers.c#L1033" id=39 iref">cputime_expiree1="+co119e499e05ef033ac664b362d0f_3/103slasefruct3now39" class="sref">itsix-cpu-timers.c#L10sr3tc#r" clas3ef">timer-> = p->psecs4="L1061" c4ass="L10" name="L1061">"L40L99840"LIf "ssrssarass="sr="L1038">1038p-> 97de1="+co119e499e05ef033ac664b362d0f_3/104e22 lass="4iss="line" name="* six-cp4ref="40/posi1="+co119e499e05ef033ac664b362d0f_3/104e32 lass="4it">/*
1sa href="k4e=unl40mersignal_ut19ar_deansleee_unltar =utim;
unltar _beunltar _bep->/40/span>
2"6ptime *1038signal_ut19ar_deansleee=utimconsme="L1038">1038n    id_t#L108="L1038">1038span _ce1038utimeit_clock)) {
;
>f="specs="ers.c#L1064" it;spec;
>f="specs="ers.c#L1064" it;speccputimeit_clock)) {
timer-> = ou;
unltar _beunltar _be = nurrlas_thcond_info=utime
p->;
tals." .c#ref">signal_structe1="+co1e=p" class="sref">p->ti41sig" cla3" id9ame="L1038">1038p->it[<4 href="+code=CPUCLO0lag c4ass="41/posi1="+co119e499e05ef033ac664b362d0f_3/104ss="sr3" c4ass="line" name=a href="k4r    4span class="corsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla42href=21er4 second.
10515""""""""* Diagnosatrequ If "erross+codsd_group_cput2>soft 2 SIG41OF);
<2 href21mers.c#L1037" id="Lclass="sref">it_clock)) {

2<7ptimec4eck_c41ers.c#L1041la075"">d="L1080" claCPUCLOCK_PERTHREA href="+codef">tCPUCLOCK_PERTHREA =utim"+cod0lag classspan _cespan _ceit_clock)) {
SIGVTALRM2;
 = d="L1080" claCPUCLOCK_PI href="+codef">tCPUCLOCK_PI =utim"+cod0lag classspan _cespan _ceit_clock)) {
cputime_expire4ass="41ass="sre1">out">d="L1080" claCPUCLOCK_PI href="+codef">tCPUCLOCK_PI =utim"+cod0lag classspan _cespan _cenurrlasruct
signal_uidhref)rref">it_clock)) {
1e4/a>);41id="L1071" class="linass="sr-f * At1 class="EINVAL.c#ref">signal_EINVALa hre1="+co1e=p" class="sref">p->p->1            erross="ers.c#L1064"errosa hr     * At1 class="dor_deananosleeeref="kernel/posdor_deananosleee=utim"+cod0lag classspan _cespan _ced="L1080" claaref="+code=unlik2s>utimesignal_structre1="+co1e=p" class="sref">p->it[<4      if ( = /*

2"6ptime */*<4 /*4/span42 iref">cputime_expires))
utimeit_clock)) {
tERESTARTNOHAN a hre1="+co1e=p" class="sref">p-> = >>>>>>>>c Rer#L1 back"so "ke usasnd.soft 2 __1roup_1endd="L107444444444Lclass="sref">it_clock)) {
   4             *1gde=psecs"4x-cpu43ke2nel/posix-cpu-time075"">d="L1080" clarmteref="kernel/posrmtehref.
signal_structsref">cputimeit_clock)) {

"Le" name=ass="sr-f * At1 class="EFAULThref="+codef">tEFAULTa hre1="+co1e=p" class="sref">p->it[<4">                 *1g th4 spec43/posi1="+co119e499e05ef033ac664b362d0f_3/104ms="sr3" c4                 *1ga hre4="k1a43ref">cputime_expireseref="kernel/posrnltar _beunltar _besignal_ut19ar_deansleee_unltar =utie1="+co1e=p" class="sref">p->
1      4 At1t43ine" name="L981">>>>>ref="kernel/posrnltar _beunltar _be *c#ref>.csre    idimers"1="sref">n    ida hr     * At1 class="span _cespan _cep->/*<4a &);
43+code=now" class="sref">now);
unltar _be *c#ref>.csrrmteref="kernel/posrmtehref.    * At1 class="rmteref="kernel/posrmtehrefe1="+co1e=p" class="sref">p->unltar _be *c#ref>.csrs              if (>f="specato_n         if (f="specato_n =utim"+cod0lag classrqteref="kernel/posrqtehrefre1="+co1e=p" class="sref">p-> 981 /4>, &a43ass="sre1">ouass="sr="L1038">1038p->it<> =40;
-&4t;p->signal_ut19ar_deansleee_unltar =utim;
unltar _beunltar _bep->it[<4t; = 
cpu-0p="sref">it   4     44ref">cputime_="L1038">1038n    id_t#L108="L1038">1038span _cen    ida hre1="+co1e=p" class="sref">p->10074/a>
c=4" id="L1034" class4lass=4line" name="L9;
>f="specs="ers.c#L1064" it;speccputimep->/*<4>               }
tals." .c#ref">signal_structe1="+co1e=p" class="sref">p->      9ame="L1038">1038p->-&g1;/*4/span44"+code=unlik1>soft 1 f="spec=utim"+cod0lag classrnltar _beunltar _be *c#ref>.csrs              if (p->it<> =430" id="L1030" cla* fastp4th"de44l/posix-c1ode=psecs"1class="sref">psecs4/span>1sig4/a>-&g1;1            erross="ers.c#L1064"errosa hr     * At1 class="dor_deananosleeeref="kernel/posdor_deananosleee=utim"+cod0lag classspan _cespan _ced="L1080" claTIMER_ABSTIMEan class="commeTIMER_ABSTIMEhrefme
signal_structre1="+co1e=p" class="sref">p->4s.c#L11="+co1e=p" class="sref">p->it[<4"1class="sref">stop_proce4s1tim45cla3" id=f/a>98  sa>            erross="ers.c#L1064"errosa hr    -f * At1 class="ERESTART_RESTARTBLOCKs="ers.c#L1064"ERESTART_RESTARTBLOCKa hras.c#L998" = cputime_expirese;
>f="specs="ers.c#L1064" it;speccputimep->CPU45r>;
>>>>fsd=y activfcode=SIGPwid-cp.1"a href="k1-timers.c#L1074" 17=soft" cla4"sref">CPU45r>;
);
<2 href21mers.c#L1037" id="""""""""c Rer#L1 back"so "ke usasnd.soft 2 CP425r>;
(it_clock)) {
d="L1080" clarmteref="kernel/posrmtehref.
signal_structsref">cputimeit_clock)) {
);
45ass="sre1">out;
<
"L1063"ass="sr-f * At1 class="EFAULThref="+codef">tEFAULTa hre1="+co1e=p" class="sref">p->it<> =4s="osix-sref">p = psecs4href=ers.c4de=timer" class="sref"ers4c#de=46ass="line" nam
"L  * At1 class="rnltar _beunltar _be *c#ref>.csrs              if (>f="specato_n         if (f="specato_n =utim
p->       4    }
s4ine" name="L1006">1006ass="sr="L1038">1038p->it[1418CPU4->cputime_expirese=it" class4"sref">it<4a>six-cpu-timers.c#L1053"4id="L4607710381038d="L1080" claCPUCLOCK_SCHE href="+codef">tCPUCLOCK_SCHE LIf r1="+co1e=p" class="sref">p->
<#defmerr="L1038">10381038d="L1080" claCPUCLOCK_SCHE href="+codef">tCPUCLOCK_SCHE LIf r1="+co1e=p" class="sref">p->check_process_t.1s=">.1s=a hrit<> =4               10381038n    id_t#L108="L1038">1038span _cecheck_process_t.1s=">.1s=a hritsix-cpu-timers.c4L10s 47ke2nel/posix-cpu-timeeeeeeeeeeeeeeeeeeeee;
>f="specs="ers.c#L1064" it;specit_clock)) {
 =  97dass="li4e" na47cla3" id=f/a>ass="sr="L1038">1038d="L1080" cla>eref="kernel/postehrefre1="+co1e=p" class="sref">p->10381038n    id_t#L108="L1038">1038span _cecheck_process_t.1s=">.1s=a hrCPU4el/posix-c1ly" class=1sre4">unl47 iref">cputime_expireeeeeeeeeeeeeeeeee;
>f="specs="ers.c#L1064" it;specit_clock)) {
it<44">1054c =         4   }
47ires = 1038d="L1080" cla>eref="kernel/postehrefre1="+co1e=p" class="sref">p->);
1nt4m47sref"e1="+co119e499e05ef033ac664b362d0f_3/1041f">it<> =4ND_SIG          4 }
1038;
ik2the curren2 process totals.10544ernel/posi4-cpu-timers.c#L1053" id=f4"+cod481 hreff68">1            tclass="ers.c#L1064" it;p->ass="sr="L1038">1038p-> 97dass="li4e" na48ss="limer" cname="L1038">1038signal_ue="L10r_deansleee=utimconsme="L1038">1038n    id_t#L108="L1038">1038span _ce1038utimeit_clock)) {
cputime_expireeeeeeeeeeeeeee;
>f="specs="ers.c#L1064" it;specit_clock)) {
it<4/a>
>f="specs="ers.c#L1064" it;speccputime = ouass="sr="L1038">1038signal_ut19ar_deansleee=utim"+cod0lag classPROCESS_CLOCKs="ers.c#L1064"PROCESS_CLOCKla3"me">d="L1080" claaref="+code=unlik2s>utimep->it<> =4x-cpu-timers.c#L10419clas4="sr148ref="e1="+co119e499e05ef033ac664b362d0f_3/104timers.c#L40419class="sr1class="line4 name49ass="imer" cnel/posix-cp.2mer" cue="L10r_deansleee_unltar .c#ref">signal_ue="L10r_deansleee_unltar =utim;
unltar _beunltar _bep->/*<4span>49sig" .c#L998" = ass="sr-f * At1 class="EINVAL.c#ref">signal_EINVALa hre1="+co1e=p" class="sref">p->/*
1sa href="k4s="sr49id="Le1="+co119e499e05ef033ac664b362d0f_3/104ta href="+4              19y" class=4untim49ss="limer" cname="L1038">10381038n    id_t#L108="L1038">1038span _cecheck_process_t.1s=">.1s=a hr *li>.1smers.c#L1034" id=49 iref">cputime_expirereeeeeeeeeeeeeeeeee;
>f="specs="ers.c#L1064" it;specit_clock)) {
now49077 = timer-> = 1038d="L1080" cla>eref="kernel/postehrefre1="+co1e=p" class="sref">p->10381038n    id_t#L108="L1038">1038span _cecheck_process_t.1s=">.1s=a hr"L50L99850ke2nel/posix-cpu-timeeeeeeeeeeeeeeeee;
>f="specs="ers.c#L1064" it;specit_clock)) {
 = ass="sr="L1038">1038d="L1080" cla>eref="kernel/postehrefre1="+co1e=p" class="sref">p->/*
1sa href="k5e=unl50id="Le1="+co119e499e05ef033ac664b362d0f_3/105ame=a href5"ker    /50ss="limer" cname="L1038">1038ik2the curren2 process totals. =             tclass="ers.c#L1064" it;p->timer-> = 1038p->-&ga>)
psecs5ref="kerne5/posix-cpu-timers.c#L10425 href51ass="ima>;
ikcek-ce1038n    _ut19ar_detime   .c#L998" =  *c#ref>.csre    =get           if (.1s=a hrit[<5 href="+code=CPUCLO0lag c5ass="512ig" cla3" id *c#ref>.csre    =se .c#ref">signal_e    =se ig" cla3"     * At1 class="ut19ar_dear    =se .c#ref">signal_ut19ar_deae    =se ig" m>check_process_t.1s=">.1s=a hr *c#ref>.csre    =get        if (.1s=a hr
check_process_t.1s=">.1s=a hr
2<6ptimeSIG515an class="co *c#ref>.csrnsleee.c#ref">signal_nsleee=utieeeeeeeee    * At1 class="ut19ar_deansleee.c#ref">signal_ut19ar_deansleee=utim>check_process_t.1s=">.1s=a hr
2<7ptimec5eck_c51ers.c#L1041la *c#ref>.csrnsleee_unltar .c#ref">signal_nsleee_unltar =uti     * At1 class="ut19ar_deansleee_unltar .c#ref">signal_ut19ar_deansleee_unltar =utim>check_process_t.1s=">.1s=a hrSIGVTALRM2;
 =  *c#ref>.csrd_t1f_se .c#ref">signal_d_t1f_se ig" cla3"     * At1 class="ut19ar_dead_t1f_se .c#ref">signal_ut19ar_dead_t1f_se =utim>check_process_t.1s=">.1s=a hrcputime_expire5ass="51ass="sre1">ou *c#ref>.csrd_t1f_del.c#ref">signal_d_t1f_delig" cla3"     * At1 class="ut19ar_dead_t1f_del.c#ref">signal_ut19ar_dead_t1f_del=utim>check_process_t.1s=">.1s=a hr1e5/a>);51id="L1071" cl *c#ref>.csrd_t1f_get        if (check_process_t.1s=">.1s=a hrp->p->it[<5      if (cputimesignal___in" ig" cname="L1038">1038 = /*
ikcek-ce1038signal_ue="L10time   .c#L998" = /*<5 /*5/span52 iref">cputime_expire *c#ref>.csre    =get           if (.1s=a hr.1s=a hr =  *c#ref>.csrd_t1f_creataan class="commet_t1f_creata=uti3"     * At1 class="ue="L10r_dead_t1f_creataan class="commeue="L10r_dead_t1f_creata=utim>check_process_t.1s=">.1s=a hrout;
< *c#ref>.csrnsleee.c#ref">signal_nsleee=utieeeeeeeee    * At1 class="ue="L10r_deansleee.c#ref">signal_ue="L10r_deansleee=utim>check_process_t.1s=">.1s=a hrsignal_nsleee_unltar =uti     * At1 class="ue="L10r_deansleee_unltar .c#ref">signal_ue="L10r_deansleee_unltar =utim>check_process_t.1s=">.1s=a hr   5             *1gde=psecs"5x-cpu53ke2nel/posix-}e1="+co1e=p" class="sref">p->;
ikcek-ce1038 =                  *1g th5 spec53cla3" id=f/a>
"L1063" *c#ref>.csre    =get           if (.1s=a hrcputime_expirese *c#ref>.csre    =get        if (.1s=a hr
1      5 At1t53ine" name="L981">>>>> *c#ref>.csrd_t1f_creataan class="commet_t1f_creata=uti3"     * At1 class="thcond__dead_t1f_creataan class="commethcond__dead_t1f_creata=utim>check_process_t.1s=">.1s=a hr/*<5a &);
53+code=now" cl}e1="+co1e=p" class="sref">p->>f="specs="ers.c#L1064" it;speccputimep-> 981 /5>, &a53"+code=unlik1>soft 1 ut19ar362d0f_ungist1f_cetCLOCK_PROCESS_CPUTIME_I la3"me
signal_ue="L10timere1="+co1e=p" class="sref">p->it<> =50;
tCLOCK_THREA _CPUTIME_I la3"me
p->p->1            ">p/a>-ato_>f="specs="ers.c#L1064"">p/a>-ato_>f="spec=utim"+cod0lag class">p/a>-aone_jiffys="ers.c#L1064"">p/a>-aone_jiffyla3"me
p->it[<5t;1            one">p/a/a1 list_headone">p/a/a=uti     * At1 class="t         if (cputimep->
cpu-0p="sref">it   5     54ref">cputime_="L1038">1038cputimep->

c=4" id="L1034" class5lass=54/span>
2"6ptime */*<5>               }
.1sires"a href="kernel/posix-cpu5kernel/pos5x-cpu-timers.c#L1051" id=5L104154077-&g1;cputimesignal___in" call=utim"+cod0lag classin" _ut19ar_deat_t1f         if (p->/*5/span54"+cod


The original LXR software bynd.LXR f=21un" yla3"methis experi1lasal v-&gion byn="+co1e=pmailto:lxf@s="ux.no">lxf@s="ux.nola3"s
lxf.s="ux.no kindly host1d byn="+co1e=phttp://www.redpill-s="pro.no">Redpill L="pro ASla3"meprovider of L="ux consulting and operations servi"L1 since 1995.