Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4813349imm; Tue, 26 Jun 2018 00:38:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLGzIJL7QzdSPhFGF6J8bStRGZA2Js8xcsiFklLSFueVOcc7MZctlo8Sl4f/RL6TSDcp52Z X-Received: by 2002:a65:6094:: with SMTP id t20-v6mr396837pgu.264.1529998721136; Tue, 26 Jun 2018 00:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529998721; cv=none; d=google.com; s=arc-20160816; b=PeQ9X/Etf5Uxa1vMZomXS84DnsUWLn+znI8SB+uewboobBEwaTzw9W+qzansqHHFIw fIaQXKxml32EsKXlOW4vt5+tSb+gQ+dM0Hzx420bL1/Vu/DhwhR4qbCiEXNbWI714QxO ZlaFub+LWkLfT8+to3izpIrajYIDpMDFaQfvBGeawdOXz4IUyqBWFE4YZPoqBQRhrMi5 /g5A1wiHx9Gdvq962qyoQCcT3gxlCldH5miBXCXdvYhyUCMqMOYyx6yiS3HsnHVU4gdE 6pDT+Y1EGiClx/sYw8KMfyzJX7t2+9or9kQFBmtzjbwk07qYN9lUxFluwgzUMccnXHnG EfIQ== 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:dkim-signature :arc-authentication-results; bh=70o/HiBNRNbTRwkhWgdrQLPYiG4JnwjdJdvVA33ckIs=; b=r3ZOvNM3m/IDtZVffM60lgd/ZdIG7SqMwOljdQXf9W8enJXP5O79sBZVLWPacf5TO/ on8CoCdcm2OHVdJ0/EtL2bBSJf30PeVEKRV5CcAGUMw2OpZQEv6TOL8ZdHka1rOcWuri kZsoTwbVgwqH8+M3aZZzEq1z7MrGhhDe0G3X8MzEdg+8GMEf7XfZCY1c4q6f5o4dvO6w 864xoxRy0JXVaBWdhIvwyD5VTW4FrN3Thta+ih/OxveJgnzJgcE7BZOcbP4ydKryVo37 GC0KKbI8pcTHIkBiHIqRkq9FsMuASRN7MxQWBD9CfkzBQRff8uX9xV9dws7x30DKvi9Z qm3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=p9P8YPUL; 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 q130-v6si830554pgq.526.2018.06.26.00.38.26; Tue, 26 Jun 2018 00:38:41 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=p9P8YPUL; 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 S1752673AbeFZHhn (ORCPT + 99 others); Tue, 26 Jun 2018 03:37:43 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58330 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbeFZHhm (ORCPT ); Tue, 26 Jun 2018 03:37:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=70o/HiBNRNbTRwkhWgdrQLPYiG4JnwjdJdvVA33ckIs=; b=p9P8YPULxdzWMNAjCEjDY50cv8 ZStiKiWdfsYb/NJ0SUwwAfLE+MxFV2szumEkdtlt/CJWDIsUVHqtJV2X2ofW/6H0GRr6J1BNM8van N2i4lj7mcptfAjdbKqtfvesdjqJtm2j+sFjOy9ZpP8QqHlKtpCgYP6OfGKIEiUYE69Ox1zrlcwby+ awBFOuJ4q8YWi+6TDVlMJaBpY0/a9xLPf4E3ZcnkNbfpk9ZYEX/Tam+FnOwJWdu+YtI1CRQ6tNNpE xPay72CQ8Gp3ij96I7UCnJo1JiHFNQFbPgMC26ani0ssDkROr1X4hjk62VW9RnCDd2iDl3fhbZJ1B N5Ypq+7Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXiXX-0005u8-CI; Tue, 26 Jun 2018 07:37:27 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E20E62029FA0E; Tue, 26 Jun 2018 09:37:22 +0200 (CEST) Date: Tue, 26 Jun 2018 09:37:22 +0200 From: Peter Zijlstra To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , "Eric W . Biederman" , "Rafael J . Wysocki" , Andrew Morton , Gavin Schenk , kernel@pengutronix.de Subject: Re: [PATCH] RFC: siox: don't create a thread without starting it Message-ID: <20180626073722.GX2458@hirez.programming.kicks-ass.net> References: <20180625102056.28468-1-u.kleine-koenig@pengutronix.de> <20180625125105.GZ2494@hirez.programming.kicks-ass.net> <20180625192121.k3hx32xbbhqkyfu4@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180625192121.k3hx32xbbhqkyfu4@pengutronix.de> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 09:21:21PM +0200, Uwe Kleine-K?nig wrote: > > That said, irrespective of the whole UNINTERRUPTIBLE/IDLE thing, I find > > this construct fairly fragile. We rely on not getting any spurious > > wakeups without a 'special' state. > > Well, if the thread is woken up unintentionally nothing happens (apart In your case sure. But people rely on the task being 'idle/blocked' after kthread_create() to call things like kthread_bind() on it. If it were to be woken early because dodgy games, the kthread_bind() would fail, which in turn can lead to all sorts of 'fun' problems. That is the whole point of this intermediate blocked state, it allows you to muck with the kthread before it starts running custom code. Arguably one could do it differently, but this is what it is.