Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] message: fix-up schedule_timeout() usage

Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: "Moore, Eric Dean" <Eric.Moore@lsil.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Nishanth Aravamudan and committed by
Linus Torvalds
6521018d 8b93ec77

+11 -20
+4 -6
drivers/message/fusion/mptlan.c
··· 511 511 { 512 512 struct mpt_lan_priv *priv = netdev_priv(dev); 513 513 MPT_ADAPTER *mpt_dev = priv->mpt_dev; 514 - unsigned int timeout; 514 + unsigned long timeout; 515 515 int i; 516 516 517 517 dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n")); ··· 526 526 527 527 mpt_lan_reset(dev); 528 528 529 - timeout = 2 * HZ; 530 - while (atomic_read(&priv->buckets_out) && --timeout) { 531 - set_current_state(TASK_INTERRUPTIBLE); 532 - schedule_timeout(1); 533 - } 529 + timeout = jiffies + 2 * HZ; 530 + while (atomic_read(&priv->buckets_out) && time_before(jiffies, timeout)) 531 + schedule_timeout_interruptible(1); 534 532 535 533 for (i = 0; i < priv->max_buckets_out; i++) { 536 534 if (priv->RcvCtl[i].skb != NULL) {
+2 -4
drivers/message/fusion/mptscsih.c
··· 1013 1013 spin_lock_irqsave(&dvtaskQ_lock, flags); 1014 1014 if (dvtaskQ_active) { 1015 1015 spin_unlock_irqrestore(&dvtaskQ_lock, flags); 1016 - while(dvtaskQ_active && --count) { 1017 - set_current_state(TASK_INTERRUPTIBLE); 1018 - schedule_timeout(1); 1019 - } 1016 + while(dvtaskQ_active && --count) 1017 + schedule_timeout_interruptible(1); 1020 1018 } else { 1021 1019 spin_unlock_irqrestore(&dvtaskQ_lock, flags); 1022 1020 }
+5 -10
drivers/message/i2o/iop.c
··· 93 93 c->name); 94 94 return I2O_QUEUE_EMPTY; 95 95 } 96 - set_current_state(TASK_UNINTERRUPTIBLE); 97 - schedule_timeout(1); 96 + schedule_timeout_uninterruptible(1); 98 97 } 99 98 100 99 return m; ··· 484 485 osm_warn("%s: Timeout Initializing\n", c->name); 485 486 return -ETIMEDOUT; 486 487 } 487 - set_current_state(TASK_UNINTERRUPTIBLE); 488 - schedule_timeout(1); 488 + schedule_timeout_uninterruptible(1); 489 489 } 490 490 491 491 m = c->out_queue.phys; ··· 546 548 if (time_after(jiffies, timeout)) 547 549 break; 548 550 549 - set_current_state(TASK_UNINTERRUPTIBLE); 550 - schedule_timeout(1); 551 + schedule_timeout_uninterruptible(1); 551 552 } 552 553 553 554 switch (*status) { ··· 574 577 rc = -ETIMEDOUT; 575 578 goto exit; 576 579 } 577 - set_current_state(TASK_UNINTERRUPTIBLE); 578 - schedule_timeout(1); 580 + schedule_timeout_uninterruptible(1); 579 581 580 582 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); 581 583 } ··· 985 989 return -ETIMEDOUT; 986 990 } 987 991 988 - set_current_state(TASK_UNINTERRUPTIBLE); 989 - schedule_timeout(1); 992 + schedule_timeout_uninterruptible(1); 990 993 } 991 994 992 995 #ifdef DEBUG