Skip to content

Commit b18d541

Browse files
Randy DunlapLinus Torvalds
authored andcommitted
[PATCH] janitor: schedule_timeout sets curr->state (arm)
From: Alexey Dobriyan <adobriyan@mail.ru> Don't set process state to TASK_RUNNING after a schedule_timeout(), since there's no way we will return from the scheduler if we're not running.
1 parent 2d2ec63 commit b18d541

File tree

12 files changed

+0
-15
lines changed

12 files changed

+0
-15
lines changed

arch/arm/common/sa1111-pcipool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle)
274274

275275
schedule_timeout (POOL_TIMEOUT_JIFFIES);
276276

277-
current->state = TASK_RUNNING;
278277
remove_wait_queue (&pool->waitq, &wait);
279278
goto restart;
280279
}

drivers/char/cyclades.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,6 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout)
27232723
/* Run one more char cycle */
27242724
current->state = TASK_INTERRUPTIBLE;
27252725
schedule_timeout(char_time * 5);
2726-
current->state = TASK_RUNNING;
27272726
#ifdef CY_DEBUG_WAIT_UNTIL_SENT
27282727
printk("Clean (jiff=%lu)...done\n", jiffies);
27292728
#endif

drivers/char/istallion.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,6 @@ static void stli_delay(int len)
14881488
if (len > 0) {
14891489
set_current_state(TASK_INTERRUPTIBLE);
14901490
schedule_timeout(len);
1491-
set_current_state(TASK_RUNNING);
14921491
}
14931492
}
14941493

drivers/char/rio/rio_linux.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ int RIODelay (struct Port *PortP, int njiffies)
332332
rio_dprintk (RIO_DEBUG_DELAY, "delaying %d jiffies\n", njiffies);
333333
current->state = TASK_INTERRUPTIBLE;
334334
schedule_timeout(njiffies);
335-
current->state = TASK_RUNNING;
336335
func_exit();
337336

338337
if (signal_pending(current))
@@ -350,7 +349,6 @@ int RIODelay_ni (struct Port *PortP, int njiffies)
350349
rio_dprintk (RIO_DEBUG_DELAY, "delaying %d jiffies (ni)\n", njiffies);
351350
current->state = TASK_UNINTERRUPTIBLE;
352351
schedule_timeout(njiffies);
353-
current->state = TASK_RUNNING;
354352
func_exit();
355353
return !RIO_FAIL;
356354
}

drivers/char/stallion.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,6 @@ static void stl_delay(int len)
12241224
if (len > 0) {
12251225
current->state = TASK_INTERRUPTIBLE;
12261226
schedule_timeout(len);
1227-
current->state = TASK_RUNNING;
12281227
}
12291228
}
12301229

drivers/sbus/char/bbc_envctrl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ static int kenvctrld(void *__unused)
469469

470470
current->state = TASK_INTERRUPTIBLE;
471471
schedule_timeout(POLL_INTERVAL);
472-
current->state = TASK_RUNNING;
473472
if (signal_pending(current))
474473
break;
475474

drivers/sbus/char/envctrl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ static int kenvctrld(void *__unused)
10361036
for (;;) {
10371037
current->state = TASK_INTERRUPTIBLE;
10381038
schedule_timeout(poll_interval);
1039-
current->state = TASK_RUNNING;
10401039

10411040
if(signal_pending(current))
10421041
break;
@@ -1184,7 +1183,6 @@ static void __exit envctrl_cleanup(void)
11841183

11851184
current->state = TASK_INTERRUPTIBLE;
11861185
schedule_timeout(HZ);
1187-
current->state = TASK_RUNNING;
11881186
}
11891187
kenvctrld_task = NULL;
11901188
}

drivers/serial/serial_core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,6 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
12771277
if (state->close_delay) {
12781278
set_current_state(TASK_INTERRUPTIBLE);
12791279
schedule_timeout(state->close_delay);
1280-
set_current_state(TASK_RUNNING);
12811280
}
12821281
} else if (!uart_console(port)) {
12831282
uart_change_pm(state, 3);

drivers/video/sa1100fb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,6 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
13881388
LCCR0 &= ~LCCR0_LEN; /* Disable LCD Controller */
13891389

13901390
schedule_timeout(20 * HZ / 1000);
1391-
set_current_state(TASK_RUNNING);
13921391
remove_wait_queue(&fbi->ctrlr_wait, &wait);
13931392
}
13941393

fs/nfsd/vfs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
781781
dprintk("nfsd: write defer %d\n", current->pid);
782782
set_current_state(TASK_UNINTERRUPTIBLE);
783783
schedule_timeout((HZ+99)/100);
784-
current->state = TASK_RUNNING;
785784
dprintk("nfsd: write resume %d\n", current->pid);
786785
}
787786

sound/core/rawmidi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,6 @@ static ssize_t snd_rawmidi_write(struct file *file, const char *buf, size_t coun
11821182
spin_unlock_irq(&runtime->lock);
11831183
set_current_state(TASK_INTERRUPTIBLE);
11841184
timeout = schedule_timeout(30 * HZ);
1185-
set_current_state(TASK_RUNNING);
11861185
remove_wait_queue(&runtime->sleep, &wait);
11871186
if (signal_pending(current))
11881187
return result > 0 ? result : -ERESTARTSYS;
@@ -1210,7 +1209,6 @@ static ssize_t snd_rawmidi_write(struct file *file, const char *buf, size_t coun
12101209
spin_unlock_irq(&runtime->lock);
12111210
set_current_state(TASK_INTERRUPTIBLE);
12121211
timeout = schedule_timeout(30 * HZ);
1213-
set_current_state(TASK_RUNNING);
12141212
remove_wait_queue(&runtime->sleep, &wait);
12151213
if (signal_pending(current))
12161214
return result > 0 ? result : -ERESTARTSYS;

sound/usb/usbaudio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ static int wait_clear_urbs(snd_usb_substream_t *subs)
732732
break;
733733
set_current_state(TASK_UNINTERRUPTIBLE);
734734
schedule_timeout(1);
735-
set_current_state(TASK_RUNNING);
736735
} while (--timeout > 0);
737736
if (alive)
738737
snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive);

0 commit comments

Comments
 (0)