Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp555573ybb; Wed, 1 Apr 2020 05:29:26 -0700 (PDT) X-Google-Smtp-Source: APiQypL9sLovlgTi1+hTY7REFkKxUZ7T30w7ZhkesDz1GXmYDUO0YhVJ9vVv8PvliDx8Kolj609j X-Received: by 2002:aca:3196:: with SMTP id x144mr2595043oix.77.1585744166560; Wed, 01 Apr 2020 05:29:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1585744166; cv=pass; d=google.com; s=arc-20160816; b=sAg1eA17ASa4Q9ADR5IktGr4iAPxzZfni81+YuSQIu3aNd0mCklBc+7xByUcH8AFDI 64T37vVeCXxsq0M4JFepG5OCEM/T6x2viYUDRyxduOJ1CZ1jqKJCZnGdX4zSoFKwtKYT ZDefOBcjWzLVcl50VjcWseIHjBJ7c6YWLW3s0qSQZXhuFZam7Pt522sx7t4lxiMBJQnf EVzH/ckNvKrG2uVzJt0kZg3eodQxnZNXK8CyfpRbX6GnBb/m+D0YHVf92+HSYKhinoe5 6wbAvSBOEXGaP6CmlqmHU74BtGwUq5M6IvOjJT7Ep21FAKURJHJ8UXLmb2/CIDSUKaUG oYTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=H2tivp2GTe3AODk37dMXfHLRzJL3WCloMRlOGkRCJxE=; b=Gv7OOkEu6OLhE/fPxI7R3UuHAWKdqW+wpEjUSGEpULJHS0dc68BaVCxYTtfguK/KlW A/EP3rt9AoqvVN0w/CYa+/QmkEj9aWpDjS1UTGOE/eSpsFgs43coL9PqGacnoUaRtD61 RghJ8JXkqU4XUeo77BOoUcBGWgF3LrQL/2zckbiXgKoCKYIMBPKlV7EJelgnLVkk8r4X T5JCf7UkexE/UztO8KyZvw31AFVhb0sPOnOJ+gDq+/5z0pgpFKYY/DF27C2SCZvjFtCz PdRj2oggrI12F2/3Hj9os+HVX3IT8K2lmcfIe+S8lkUXawLjXd1YG1hqkt5Hat/coDp5 vPYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@live.com header.s=selector1 header.b=qWy6Ut4u; arc=pass (i=1 spf=pass spfdomain=live.com dkim=pass dkdomain=live.com dmarc=pass fromdomain=live.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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=live.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si758257otp.103.2020.04.01.05.29.12; Wed, 01 Apr 2020 05:29:26 -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=pass header.i=@live.com header.s=selector1 header.b=qWy6Ut4u; arc=pass (i=1 spf=pass spfdomain=live.com dkim=pass dkdomain=live.com dmarc=pass fromdomain=live.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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=live.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732435AbgDAM1X (ORCPT + 99 others); Wed, 1 Apr 2020 08:27:23 -0400 Received: from mail-bn7nam10olkn2107.outbound.protection.outlook.com ([40.92.40.107]:6307 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726920AbgDAM1X (ORCPT ); Wed, 1 Apr 2020 08:27:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ei3dypfI7UieyetDod9WXYlzWdkfJgBOwosU9yCspjLuwB7n94sEMrLAKxhqJhGUS259NSwdguDEdWpdk4Aeb4//RV2uGncTVgMZStfgIjNVScI85LTbu+xqMZCTOQG2hV2lAf0L1oCfeHdM2SdYs4ooOaUVzqtNL43ubrRJ+QCc27Lj08jIR26GoI25Og+9fYooMaiav1Yngl7w7b/65fwxeBEUO1mjYwjf5FisA88j8w6l/dKMYxhnZjEVVri5a/A1CHRKb7nEcJjm3pWD9MGPeDHyL5LbZ4oexPSqe20MSqBAJnQ/IL5A4obwt/QKtZJqcz1IyTW05jjmaPhArw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H2tivp2GTe3AODk37dMXfHLRzJL3WCloMRlOGkRCJxE=; b=hbZs8F6YQqZye1+0avLfpScbbo3ZTs5h3EXardfvHyZpl5W62Ow6IfcaoZBRwW7MBKtBpuBedC/Q/aTSk0t+jGfTagy13cW0FVUK/jbR7TUmmbkXzEJcuOfC0n9HZIHTLeaxwa9kjwK7Clm1iVVt3HnwRJ37wGc6Q6K4MVD6jL93yEbkA1IX+9trm7D6HR5ExYC8lOLvjq92htOe9w24PS8lSzsxIuECggmoZgwtuOmI4MKJUKCbK35EQfmY1LRxdZDFIhOTg8qT8PdEu8tsT3vlg5/8TydafRwxM+17g5jIkvOcMFegzSeCy8a6Sf5LSN5j0uo/CYoEzv9OGcCqEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.com; dmarc=pass action=none header.from=live.com; dkim=pass header.d=live.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H2tivp2GTe3AODk37dMXfHLRzJL3WCloMRlOGkRCJxE=; b=qWy6Ut4u/tbHt5BE0oHaIVsVXj3ZmhCb+KoJnm3A5x//mPGXNX562kPlOz0Ln0pKf8CQwxVngbYohTAOY/FQbOpBRC6l/nal2wFQ8/peQ9V1MQCEcQnCBye0Aflkbgc9/Nal31DJRTELWkR6PyFBuuQiK88UX5z0mghyqxxa1fZXWM78zoYbqhM2sXq0mArxwQkaVD6RhyZAYy7P2NBtNcMTCNYd7XXEe5HIlD080zRnwDatmyNNWeZuutuBFFxMVOMpGLBHJ49iddaojl7iGN+F9gREiVl0AId38Qdfi4+5A/w4oI6dbwbN00U72QGBJHbepS44uQY8WhLun+TR5A== Received: from DM6NAM10FT059.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::40) by DM6NAM10HT156.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::334) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Wed, 1 Apr 2020 12:27:21 +0000 Received: from DM6PR11MB3531.namprd11.prod.outlook.com (2a01:111:e400:7e86::46) by DM6NAM10FT059.mail.protection.outlook.com (2a01:111:e400:7e86::327) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15 via Frontend Transport; Wed, 1 Apr 2020 12:27:21 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:091FAC6289E42055F829E1C0ABC848AAC39A94125DC3B59C5038A909F08DE75B;UpperCasedChecksum:83BAA32EE2220F0C620C15859EFE4A75B8D0DA7CC85FFB4DB88AC501592408AD;SizeAsReceived:9117;Count:50 Received: from DM6PR11MB3531.namprd11.prod.outlook.com ([fe80::c844:3598:abc4:cc3c]) by DM6PR11MB3531.namprd11.prod.outlook.com ([fe80::c844:3598:abc4:cc3c%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 12:27:21 +0000 Subject: Re: [PATCH] kthread: set kthread state to TASK_IDLE. To: Peter Zijlstra Cc: "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , liyueyi References: <20200401093904.GX20713@hirez.programming.kicks-ass.net> <20200401111217.GC20713@hirez.programming.kicks-ass.net> From: Yueyi Li Message-ID: Date: Wed, 1 Apr 2020 20:27:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <20200401111217.GC20713@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: HK2PR0401CA0012.apcprd04.prod.outlook.com (2603:1096:202:2::22) To DM6PR11MB3531.namprd11.prod.outlook.com (2603:10b6:5:61::21) X-Microsoft-Original-Message-ID: <461a0710-6bb6-ead4-5547-9bf7d6ba1769@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.6] (123.123.4.113) by HK2PR0401CA0012.apcprd04.prod.outlook.com (2603:1096:202:2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20 via Frontend Transport; Wed, 1 Apr 2020 12:27:18 +0000 X-Microsoft-Original-Message-ID: <461a0710-6bb6-ead4-5547-9bf7d6ba1769@live.com> X-TMN: [crgSFpb+6MmX2byfO7XtMQIJRdvZ8pp0] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 489820e0-ea73-45cd-013c-08d7d6380635 X-MS-TrafficTypeDiagnostic: DM6NAM10HT156: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HC7+9lJySebkLqJ95egMGB3jXbzRylzxqiTufXo4vLgRb7NMV5O2xPenN5YUZS1Edoxe0bQmYx9zMxfqxFUiAiUpRDTxUkLUfFY53Rck+QhqWbR+UcFfdAU/fM42GkWVOHZWAPlQxD0CfviqsVG5scVldPf/YQYz7/Iy60caU3pZ2s9sNH4rMq7GbBywR2fb X-MS-Exchange-AntiSpam-MessageData: z5NYoVp1e+MEVR+tXbLH4yO/gI2d1jGx235iELTHRib4NaJ03+4TJATRqP3xpsBQmMl4t3iVsgS0+gP5KSjCdZc/gXe+Cz/zZNKlMhrgj2/1vNgGZggdR58FslCQeQ1tnIYMYcbMw+j/H2AdZQMQFQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 489820e0-ea73-45cd-013c-08d7d6380635 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 12:27:21.0801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT156 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/1 19:12, Peter Zijlstra wrote: > > 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! > Oh~, Sorry about top-posting and....thanks for your answer!