diff options
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/pktgen.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index b3ad49fa7d78..ef430b1e8e42 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -1452,8 +1452,7 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer, | |||
| 1452 | thread_lock(); | 1452 | thread_lock(); |
| 1453 | t->control |= T_REMDEV; | 1453 | t->control |= T_REMDEV; |
| 1454 | thread_unlock(); | 1454 | thread_unlock(); |
| 1455 | current->state = TASK_INTERRUPTIBLE; | 1455 | schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */ |
| 1456 | schedule_timeout(HZ/8); /* Propagate thread->control */ | ||
| 1457 | ret = count; | 1456 | ret = count; |
| 1458 | sprintf(pg_result, "OK: rem_device_all"); | 1457 | sprintf(pg_result, "OK: rem_device_all"); |
| 1459 | goto out; | 1458 | goto out; |
| @@ -1716,10 +1715,9 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us) | |||
| 1716 | printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now)); | 1715 | printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now)); |
| 1717 | while (now < spin_until_us) { | 1716 | while (now < spin_until_us) { |
| 1718 | /* TODO: optimise sleeping behavior */ | 1717 | /* TODO: optimise sleeping behavior */ |
| 1719 | if (spin_until_us - now > (1000000/HZ)+1) { | 1718 | if (spin_until_us - now > jiffies_to_usecs(1)+1) |
| 1720 | current->state = TASK_INTERRUPTIBLE; | 1719 | schedule_timeout_interruptible(1); |
| 1721 | schedule_timeout(1); | 1720 | else if (spin_until_us - now > 100) { |
| 1722 | } else if (spin_until_us - now > 100) { | ||
| 1723 | do_softirq(); | 1721 | do_softirq(); |
| 1724 | if (!pkt_dev->running) | 1722 | if (!pkt_dev->running) |
| 1725 | return; | 1723 | return; |
| @@ -2449,8 +2447,7 @@ static void pktgen_run_all_threads(void) | |||
| 2449 | } | 2447 | } |
| 2450 | thread_unlock(); | 2448 | thread_unlock(); |
| 2451 | 2449 | ||
| 2452 | current->state = TASK_INTERRUPTIBLE; | 2450 | schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */ |
| 2453 | schedule_timeout(HZ/8); /* Propagate thread->control */ | ||
| 2454 | 2451 | ||
| 2455 | pktgen_wait_all_threads_run(); | 2452 | pktgen_wait_all_threads_run(); |
| 2456 | } | 2453 | } |
