Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185AbbHDQfk (ORCPT ); Tue, 4 Aug 2015 12:35:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44049 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752900AbbHDQfj (ORCPT ); Tue, 4 Aug 2015 12:35:39 -0400 Date: Tue, 4 Aug 2015 18:33:34 +0200 From: Oleg Nesterov To: "David S. Miller" , Huang Ying Cc: Alexei Starovoitov , Jan Stancek , Jesper Brouer , Marcelo Leitner , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: pktgen: don't abuse current->state in pktgen_thread_worker() Message-ID: <20150804163334.GA31842@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1499 Lines: 47 Commit 1fbe4b46caca "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 ef87979c273a2 "pktgen: better scheduler friendliness" which changed pktgen_thread_worker() to use wait_event_interruptible_timeout(). Reported-by: Huang Ying Signed-off-by: Oleg Nesterov --- net/core/pktgen.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 8e0181a..6717684 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -3432,8 +3432,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); @@ -3478,7 +3476,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); -- 1.5.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/