Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7429964imm; Thu, 28 Jun 2018 03:47:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIpPX1ZIp4tRBSx8m56AnpAnXTkmTA7AlJZcPVmqwa99ZTlO0vo/UgXf75SpYfOk1ET50/o X-Received: by 2002:a17:902:a702:: with SMTP id w2-v6mr10110946plq.41.1530182853123; Thu, 28 Jun 2018 03:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530182853; cv=none; d=google.com; s=arc-20160816; b=FFVJBJoMRQFGKfjKS5S8J3If2DFs+6w0vDbNTvkEOvsJRK3RRYNvBf3xHzQq86m0oq MQOEqCqUwwJtwbitYnOyfUtnrqIg5+AKcpUJ5wbJ6WdvkGWUn8iRk8K9xXq8BlvX/ZfU cDQnJNu6wXas657cp6dGoQiGGPsRNggTxMwjcMr1icxIxyEIUvGCUg0fsDnFJkccbVld dloKXLLfK5vGYsWbLmYCtxYyZeD0ke9IH3zV1HH529gaSPJ2ShTeVDr+FqAe8jwbajpk 5+fTUKeQrK3fy5svPRKTYm8LObAWMCbvEfxA5hi2T7Z7IwZR6+aEa4R2zChVpdOu1ekr VNzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=hHhek3etVT1YREilg8+uprrIeudF+qJnTzE4uAuEA1g=; b=UyfUGxH7K515gAqAGJCRwUVgs6U/hM3yGdCXF2J/pc964jMHRfBnmLcyT7B7XwpSqM mFsmv+3IPA0bfVK3Vxex31NnwnKYG9VMyovpEEaGZOo5KMHMPN6r5KwSXkpHLXOCjUMc ZSkKNE1LsnyCqYs/Q7MLNu/5BwfeHVzqzs8uzawUfgIGpyMuALHseFityDgRkKjhXgHD 6wG+FUGra2nNNAgQw9ZZvNutM7yYBnhttefqpOEdsubWshDjH08oaRVRB2I1W4X2VLp4 bQzTU4MMieEcbv80RMFT9VGvzUpOOEp6IIN0RIjHkpai6zcpYk3CYnw7wwJypXHbo15t 9n1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e82-v6si186894pfh.64.2018.06.28.03.47.15; Thu, 28 Jun 2018 03:47:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753661AbeF1IEG (ORCPT + 99 others); Thu, 28 Jun 2018 04:04:06 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:54841 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752680AbeF1IED (ORCPT ); Thu, 28 Jun 2018 04:04:03 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYRuJ-00023d-35; Thu, 28 Jun 2018 10:03:59 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fYRuC-0003lh-EJ; Thu, 28 Jun 2018 10:03:52 +0200 Date: Thu, 28 Jun 2018 10:03:52 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Peter Zijlstra Cc: Gavin Schenk , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Oleg Nesterov , "Eric W . Biederman" , kernel@pengutronix.de, Andrew Morton Subject: Re: [PATCH] RFC: siox: don't create a thread without starting it Message-ID: <20180628080352.3l24sdhxz7633sfw@pengutronix.de> References: <20180625102056.28468-1-u.kleine-koenig@pengutronix.de> <20180625125105.GZ2494@hirez.programming.kicks-ass.net> <20180625192121.k3hx32xbbhqkyfu4@pengutronix.de> <20180626073841.GY2458@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180626073841.GY2458@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Peter, On Tue, Jun 26, 2018 at 09:38:41AM +0200, Peter Zijlstra wrote: > On Mon, Jun 25, 2018 at 09:21:21PM +0200, Uwe Kleine-K?nig wrote: > > > I don't think so, that patch has an issue with INTERRUPTIBLE, but IDLE > > > very much doesn't allow signals like INTERRUPTIBLE does. > > > > I don't think I can provide a good commit log for > > s/TASK_UNINTERRUPTIBLE/TASK_IDLE/ in kernel/kthread.c:kthread(). But I > > can confirm that this patch makes the warning go away, so if you want to > > address this, you can add my Tested-by:. > > Yeah, it's also a little bit more involved, I'd also have to change all > the kthread_bind() code and audit all kthread users to see if anybody > else actually relies on TASK_UNINTERRUPTIBLE. > > So I think I'll leave it as is for now, maybe another day ... :-) Should we add a reminder to kthread() ? la: --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -227,7 +227,14 @@ static int kthread(void *_create) init_completion(&self->parked); current->vfork_done = &self->exited; - /* OK, tell user we're spawned, wait for stop or wakeup */ + /* + * OK, tell user we're spawned, wait for stop or wakeup. + * It might be possible to use TASK_IDLE here to not trigger the + * hung-task-check if the creator doesn't run the thread immediately. + * Changing this would however need some research first as this has an + * effect on e.g. kthread_bind() or the caller might rely on + * TASK_UNINTERRUPTIBLE. + */ __set_current_state(TASK_UNINTERRUPTIBLE); create->result = current; complete(done); ? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |