Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a52dd50091b6a6e710a1293db741028f8cc5aac
Commit:     5a52dd50091b6a6e710a1293db741028f8cc5aac
Parent:     1020387f5f3b52929b387103cf976321981f8e26
Author:     Peter Zijlstra <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 21:08:32 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 21:08:32 2008 +0100

    sched: rt-watchdog: fix .rlim_max = RLIM_INFINITY
    
    Remove the curious logic to set it_sched_expires in the future. It useless
    because rt.timeout wouldn't be incremented anyway.
    
    Explicity check for RLIM_INFINITY as a test programm that had a 1s soft 
limit
    and a inf hard limit would SIGKILL at 1s. This is because RLIM_INFINITY+d-1
    is d-2.
    
    Signed-off-by: Peter Zijlsta <[EMAIL PROTECTED]>
    CC: Michal Schmidt <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/posix-cpu-timers.c |    3 ++-
 kernel/sched_rt.c         |    8 +-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 2c076b3..0b7c82a 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -1020,7 +1020,8 @@ static void check_thread_timers(struct task_struct *tsk,
                unsigned long hard = sig->rlim[RLIMIT_RTTIME].rlim_max;
                unsigned long *soft = &sig->rlim[RLIMIT_RTTIME].rlim_cur;
 
-               if (tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
+               if (hard != RLIM_INFINITY &&
+                   tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
                        /*
                         * At the hard limit, we just die.
                         * No need to calculate anything else now.
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index f1f215d..2dac5eb 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1125,13 +1125,7 @@ static void watchdog(struct rq *rq, struct task_struct 
*p)
 
                p->rt.timeout++;
                next = DIV_ROUND_UP(min(soft, hard), USEC_PER_SEC/HZ);
-               if (next > p->rt.timeout) {
-                       u64 next_time = p->se.sum_exec_runtime;
-
-                       next_time += next * (NSEC_PER_SEC/HZ);
-                       if (p->it_sched_expires > next_time)
-                               p->it_sched_expires = next_time;
-               } else
+               if (p->rt.timeout > next)
                        p->it_sched_expires = p->se.sum_exec_runtime;
        }
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to