Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3829913iog; Tue, 28 Jun 2022 03:46:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vt7gYSfOn6bGj0Ga/ZjSNUvSJs6KnVo5LOiXFojBzlquFJchuEUZCCCnprEmq48KAkwBNz X-Received: by 2002:a05:6402:516b:b0:435:8f7b:b6f7 with SMTP id d11-20020a056402516b00b004358f7bb6f7mr22351423ede.291.1656413199860; Tue, 28 Jun 2022 03:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656413199; cv=none; d=google.com; s=arc-20160816; b=bvFkAFOo1rlpdcgLbv4C8MPAm/8VbOOrUbz8EghfSkiiTi7sdDwpF1wz97YAzw7zlG 05VPl+Ry9izrMyJSxZjX/z3V7zYvmDsHB08ej4Pi+TnQsj0GiHOqcTllzIIrhlGB+IF0 3Zlg5/WIu8JSTCGUJtGGWctVCA8a2grwgM1DJVwQEBPGJw6If2aN7fI7HV42KGLS+BUE tK8WfksRu6vyf0WQnT3rdPhi6CL4qS9+LiklAI7NehZCpft7lzqFPt86uJGJDUa2JALv Dt7QoQGPpw/dhCi9tzqXL15oo/8uta3S1xtL74k6scjF3edupxoE6CPuldYoWDl1f855 sH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nv3GhukGgUnIZkRzen+HbLRhRFVrkufiUI5WwB64rbs=; b=01aQ7B6DNeQW1xXc7sWQ9rHIo1nZN3py9Wa1WUNRWpRBugDpzBygy6dxZmk16TVDKG hQswYnsG7eZ/RbWepPZ/JoQDioB2SqhgH5bQxn0jygCoBFrLaESB1u7CrEQ+DG/k96Us DV/i14CjmZl61VDzAGyFfV5xq/1i0c/kTxeiDGCE8clWF1A5ABTaoM6ZZ/aSgEJhhSuv R+FEiq26+YNm4W0ABDQDNcvxTr5rdXPuX52C6U1GwzQdiL+/AtfhXcB0wbVNfJ63ztzx YTQlMs+n4r7zNVcVZEr/6cVhGoPhG/qVg1xjDbDvJ1MAxZAFJED6E0JYc1gYLuTAFZIe Hqqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RSlMJQSz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m22-20020a509996000000b0043579ad55f1si14441988edb.94.2022.06.28.03.46.14; Tue, 28 Jun 2022 03:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RSlMJQSz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344031AbiF1Jvz (ORCPT + 99 others); Tue, 28 Jun 2022 05:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344491AbiF1Jvn (ORCPT ); Tue, 28 Jun 2022 05:51:43 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE8F2BB3D for ; Tue, 28 Jun 2022 02:51:43 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id B553A1FD50; Tue, 28 Jun 2022 09:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1656409901; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nv3GhukGgUnIZkRzen+HbLRhRFVrkufiUI5WwB64rbs=; b=RSlMJQSz9U3bUE9NtANP5s04nyAIJC/RBPA2K885jLaum9DkoL33xRmQ7yZXu8y7CfXNwf 756oL5sJzyB2HEFUyZdVks8wcHFsvIPC4WlK3cb3ra4hE2SVVvfeWMRpdvE5zHwuIEMCfw 2LRmR8cCYfXhlVwB7PHceJQ7DkRdq4c= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 563C72C141; Tue, 28 Jun 2022 09:51:41 +0000 (UTC) Date: Tue, 28 Jun 2022 11:51:37 +0200 From: Petr Mladek To: Linus Torvalds Cc: Tejun Heo , Lai Jiangshan , Michal Hocko , Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Andrew Morton , Oleg Nesterov , "Eric W. Biederman" Subject: Re: re. Spurious wakeup on a newly created kthread Message-ID: References: <20220622140853.31383-1-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 2022-06-25 10:01:35, Linus Torvalds wrote: > On Fri, Jun 24, 2022 at 10:00 PM Tejun Heo wrote: > For example, the reason that quoted patch cannot be right is that this > code pattern: > > while (wait_for_completion_interruptible(&worker->ready_to_start)) > ; > > is not valid kernel code. EVER. There is absolutely no way that can be correct. > > Either that code can take a signal, or it cannot. If it can take a > signal, it had better react to said signal. If it cannot, it must not > use an interruptble sleep - since now that loop turned into a > kernel-side busy-loop. I agree that the code is ugly and does not make sense. JFYI, I did it this way because I wanted to calm down the hung task detector. kthreads ignore signals so that I did not think about this aspect. I though that I saw this trick somewhere. Do not ask me why I wanted to calm down the hung task detector. I quess that I felt overloaded and wished a calm day or something like this. I agree that it does not make much sense. Best Regards, Petr