From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753947AbbHDQdb (ORCPT ); Tue, 4 Aug 2015 12:33:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753833AbbHDQda (ORCPT ); Tue, 4 Aug 2015 12:33:30 -0400 Date: Tue, 4 Aug 2015 18:31:25 +0200 From: Oleg Nesterov To: kernel test robot Cc: lkp@01.org, LKML , "David S. Miller" , Jesper Brouer Subject: Re: [lkp] [net] 1fbe4b46cac: WARNING: CPU: 0 PID: 2245 at kernel/sched/core.c:7376 __might_sleep+0x8b/0xa8() Message-ID: <20150804163125.GA31395@redhat.com> References: <871tfqqtuy.fsf@yhuang-dev.intel.com> <20150730212020.GA8185@redhat.com> <20150803164958.GA17910@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150803164958.GA17910@redhat.com> 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 On 08/03, Oleg Nesterov wrote: > > Now that I can actually see the code, I think that we should simply remove > __set_current_state(TASK_RUNNING) and set_current_state(TASK_INTERRUPTIBLE). > But let me re-check this once again tomorrow, I simply can't understand why > pktgen_thread_worker() does this. > > Unless I am totally confused they could be removed right after ef87979c273a2 > "pktgen: better scheduler friendliness" which in particular changed the main > loop to use wait_event(). Then later baac167b "pktgen: avoid expensive > set_current_state() call in loop" changed the 1st __set_current_state() to > set RUNNING, and moved the 2nd set_current_state(TASK_INTERRUPTIBLE) outside > the main loop for absolutely no reason. Yes, I am sending the patch. Both set_current_state()'s look obviously unneeded, and afaics we could hit the same warning even without 1fbe4b46caca. At least pktgen_rem_thread()->remove_proc_entry() can sleep. Oleg.