Skip to content

Commit

Permalink
net: pktgen: don't abuse current->state in pktgen_thread_worker()
Browse files Browse the repository at this point in the history
Commit 1fbe4b4 "net: pktgen: kill the Wait for kthread_stop
code in pktgen_thread_worker()" removed (in particular) the final
__set_current_state(TASK_RUNNING) and I didn't notice the previous
set_current_state(TASK_INTERRUPTIBLE). This triggers the warning
in __might_sleep() after return.

Afaics, we can simply remove both set_current_state()'s, and we
could do this a long ago right after ef87979 "pktgen: better
scheduler friendliness" which changed pktgen_thread_worker() to
use wait_event_interruptible_timeout().

Reported-by: Huang Ying <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
oleg-nesterov authored and davem330 committed Aug 7, 2015
1 parent 57b2290 commit 7ba8bd7
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3514,8 +3514,6 @@ static int pktgen_thread_worker(void *arg)

set_freezable();

__set_current_state(TASK_RUNNING);

while (!kthread_should_stop()) {
pkt_dev = next_to_run(t);

Expand Down Expand Up @@ -3560,7 +3558,6 @@ static int pktgen_thread_worker(void *arg)

try_to_freeze();
}
set_current_state(TASK_INTERRUPTIBLE);

pr_debug("%s stopping all device\n", t->tsk->comm);
pktgen_stop(t);
Expand Down

0 comments on commit 7ba8bd7

Please sign in to comment.