Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966AbbBFLvI (ORCPT ); Fri, 6 Feb 2015 06:51:08 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:43511 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbbBFLvH (ORCPT ); Fri, 6 Feb 2015 06:51:07 -0500 Date: Fri, 6 Feb 2015 12:50:51 +0100 From: Peter Zijlstra To: Bruno =?iso-8859-1?Q?Pr=E9mont?= Cc: Linus Torvalds , "Rafael J. Wysocki" , Ingo Molnar , Peter Hurley , Davidlohr Bueso , Linux Kernel Mailing List , Thomas Gleixner , Ilya Dryomov , Mike Galbraith , Oleg Nesterov Subject: Re: Linux 3.19-rc5 Message-ID: <20150206115051.GL23123@twins.programming.kicks-ass.net> References: <1421878320.4903.17.camel@stgolabs.net> <54C02E08.4080405@hurleysoftware.com> <1861286.x5DC37NGWz@vostro.rjw.lan> <20150205221436.01bc24f2@neptune.home> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150205221436.01bc24f2@neptune.home> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1745 Lines: 48 On Thu, Feb 05, 2015 at 10:14:36PM +0100, Bruno Pr?mont wrote: > The loop is now replaced by a single WARN() trace - I guess expected: > From my reading of the thread fixing pccardd/sched TASK_RUNNING usage/check > is another issue left for the future. Yeah, something like the below will make it go away -- under the assumption that that comment is actually correct, I don't know, the pcmcia people should probably write a better comment :/ Also, set_current_state(TASK_RUNNING) is almost always pointless, nobody cares about that barrier, so make it go away. --- drivers/pcmcia/cs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 5292db69c426..5678e161a17d 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -635,6 +635,12 @@ static int pccardd(void *__skt) skt->sysfs_events = 0; spin_unlock_irqrestore(&skt->thread_lock, flags); + /* + * Supposedly this is a rarely contended mutex and + * sleeping is therefore unlikely, the occasional + * extra loop iteration is harmless. + */ + sched_annotate_sleep(); mutex_lock(&skt->skt_mutex); if (events & SS_DETECT) socket_detect_change(skt); @@ -679,7 +685,7 @@ static int pccardd(void *__skt) try_to_freeze(); } /* make sure we are running before we exit */ - set_current_state(TASK_RUNNING); + __set_current_state(TASK_RUNNING); /* shut down socket, if a device is still present */ if (skt->state & SOCKET_PRESENT) { -- 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/