Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp513014ybb; Wed, 1 Apr 2020 04:39:18 -0700 (PDT) X-Google-Smtp-Source: APiQypIF7x1QmOT449JfENOrjDjghbR1mCuFrbLhR6cOfs0Hf26uYhr2EnYha+/fmUVKka72Z9wC X-Received: by 2002:a05:6808:1c1:: with SMTP id x1mr2241503oic.55.1585741157940; Wed, 01 Apr 2020 04:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585741157; cv=none; d=google.com; s=arc-20160816; b=A3harhKattPfsE4pAKPE3DBGdSyWT68xhZKk2XK/CzP1tolQbF8QKEz4h32BYTIxKI CNJuDlXyr39QfLmCX0wi5IZGKPT3xnJfNYL4WBfwqxLDinKdgBKpdHEWhodfqmhF/vXX cp1A2Xyym7CP2o2QhL4t4wFy+mTb9YdfCrAh8b3LYOFgQZ6PTkNHluqz3acPrbeOQ0cU HwhO9jNy1SUcLkWq8r8//d97lgfY+ATe93QBv7WR+oAHiW1gMJlL7iSF8lvHAQSxZ5BN kuzqTAWWCOJgEMQ+1jxMrPs9XEDV+0fmlimx7LzpUXfAkJFkVc0NmgByazK0zoae3N0Y yw6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gp2YqlkY4pv8hkp+Y9HeAoM9N130azc4jQ8Q+utG8J8=; b=wwntth6iYU7KWz4JMa42jlK1YWjEnYUOI3gHqJggitPaU39wQi3PsoWo+IfucZUUba XnECyQF/HLqnh+s1nmZ2g0+oyQu8uTIXOGJgEY1g2kOCAp6t3V00jit5uFj8/rgbYfGK xtSQlVqzk7/QDESnR5C1ocTF8Uqms5xpqlaa43lfrZpKztvitmw8uSsfb2CO2MReLKL5 QxojQqvWPIvD1H1LaRAfMGYedNSbILF2NeXliOczrL1daDRckmyLayd40oteIag1vygk es/HEHOwaa2JBinwZlAP7dE/jhGgZloAbyvfo6zuaLJg1eTm0pJEPMZPgL6VYuUUhJUo +Hhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Uu3ng+uZ; 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 r70si707861oor.49.2020.04.01.04.38.59; Wed, 01 Apr 2020 04:39:17 -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=Uu3ng+uZ; 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 S1732169AbgDALMZ (ORCPT + 99 others); Wed, 1 Apr 2020 07:12:25 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46026 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731343AbgDALMY (ORCPT ); Wed, 1 Apr 2020 07:12:24 -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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gp2YqlkY4pv8hkp+Y9HeAoM9N130azc4jQ8Q+utG8J8=; b=Uu3ng+uZNxSDRt8Ayhjx+9es78 OSKNmvUX9WZ/y9pA+W6imaBcfoZNS5icnFyTzGwmIYjEFzH7hvj9YWknqCRHCd0jAkECoAY2Ox/GU qUDr4YPcQwAV9qonwJSRbwCfHDqLlp6SI+mRO0VVDg+vMmk4N+nQaAD7vHVprkxj4UD5Gty/9K9P8 gkzFZMqq6M0lHIDSOQtbSKtSlcrMgy29gfJfH9udCvygTuTwc1GGg3XlpYzujkiKbjdHGRC9mnj5W VQuGUN0yjRegeDaoyaQ+4Bwq4+B2vOUyh04A9awc1unPO/Gx89sqKLap/7P1ItAR30kJxhFczk/+E qp7Xwlfg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJbIB-0002Tm-1R; Wed, 01 Apr 2020 11:12:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 79C653025C3; Wed, 1 Apr 2020 13:12:17 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5EE5929DB2527; Wed, 1 Apr 2020 13:12:17 +0200 (CEST) Date: Wed, 1 Apr 2020 13:12:17 +0200 From: Peter Zijlstra To: Li Yueyi Cc: "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , liyueyi Subject: Re: [PATCH] kthread: set kthread state to TASK_IDLE. Message-ID: <20200401111217.GC20713@hirez.programming.kicks-ass.net> References: <20200401093904.GX20713@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? On Wed, Apr 01, 2020 at 10:40:28AM +0000, Li Yueyi wrote: > I create a kthread to do some work will trigger system restart, i don`t wake it up immediately but wakeup it in a HW irq handler. > So this kthread sleeps in TASK_UNINTERRUPTIBLE state until the HW irq coming up. > > Did i do something wrong? > Should i wake it up immediately and then call wait_event_xxxx function to sleep it? This!