linux-mips
[Top] [All Lists]

[-mm PATCH 11/32] mips: fix-up schedule_timeout() usage

To: ralf@linux-mips.org
Subject: [-mm PATCH 11/32] mips: fix-up schedule_timeout() usage
From: Nishanth Aravamudan <nacc@us.ibm.com>
Date: Mon, 15 Aug 2005 11:14:29 -0700
Cc: akpm@osdl.org, linux-mips@linux-mips.org
In-reply-to: <20050815180514.GC2854@us.ibm.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050815180514.GC2854@us.ibm.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.9i
Description: Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also,
replace custom timespectojiffies() function with globally availabe
timespec_to_jiffies().

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

---

 arch/mips/kernel/irixsig.c |   17 ++---------------
 arch/mips/kernel/sysirix.c |    3 +--
 2 files changed, 3 insertions(+), 17 deletions(-)

diff -urpN 2.6.13-rc5-mm1/arch/mips/kernel/irixsig.c 
2.6.13-rc5-mm1-dev/arch/mips/kernel/irixsig.c
--- 2.6.13-rc5-mm1/arch/mips/kernel/irixsig.c   2005-08-07 09:57:44.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/arch/mips/kernel/irixsig.c       2005-08-11 
15:43:36.000000000 -0700
@@ -441,18 +441,6 @@ struct irix5_siginfo {
        } stuff;
 };
 
-static inline unsigned long timespectojiffies(struct timespec *value)
-{
-       unsigned long sec = (unsigned) value->tv_sec;
-       long nsec = value->tv_nsec;
-
-       if (sec > (LONG_MAX / HZ))
-               return LONG_MAX;
-       nsec += 1000000000L / HZ - 1;
-       nsec /= 1000000000L / HZ;
-       return HZ * sec + nsec;
-}
-
 asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
                                struct timespec *tp)
 {
@@ -490,14 +478,13 @@ asmlinkage int irix_sigpoll_sys(unsigned
                        error = -EINVAL;
                        goto out;
                }
-               expire = timespectojiffies(tp)+(tp->tv_sec||tp->tv_nsec);
+               expire = timespec_to_jiffies(tp) + (tp->tv_sec||tp->tv_nsec);
        }
 
        while(1) {
                long tmp = 0;
 
-               current->state = TASK_INTERRUPTIBLE;
-               expire = schedule_timeout(expire);
+               expire = schedule_timeout_interruptible(expire);
 
                for (i=0; i<=4; i++)
                        tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
diff -urpN 2.6.13-rc5-mm1/arch/mips/kernel/sysirix.c 
2.6.13-rc5-mm1-dev/arch/mips/kernel/sysirix.c
--- 2.6.13-rc5-mm1/arch/mips/kernel/sysirix.c   2005-08-07 09:57:22.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/arch/mips/kernel/sysirix.c       2005-08-11 
15:46:57.000000000 -0700
@@ -1035,8 +1029,7 @@ bad:
 
 asmlinkage int irix_sginap(int ticks)
 {
-       current->state = TASK_INTERRUPTIBLE;
-       schedule_timeout(ticks);
+       schedule_timeout_interruptible(ticks);
        return 0;
 }
 

<Prev in Thread] Current Thread [Next in Thread>
  • [-mm PATCH 11/32] mips: fix-up schedule_timeout() usage, Nishanth Aravamudan <=