From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA84C77B7E for ; Thu, 25 May 2023 15:31:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241796AbjEYPa7 (ORCPT ); Thu, 25 May 2023 11:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241791AbjEYPa4 (ORCPT ); Thu, 25 May 2023 11:30:56 -0400 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F02B1A4 for ; Thu, 25 May 2023 08:30:53 -0700 (PDT) Received: from in02.mta.xmission.com ([166.70.13.52]:37406) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1q2CvS-000r5n-Fi; Thu, 25 May 2023 09:30:50 -0600 Received: from ip68-110-29-46.om.om.cox.net ([68.110.29.46]:35938 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1q2CvR-00FA7J-65; Thu, 25 May 2023 09:30:50 -0600 From: "Eric W. Biederman" To: Oleg Nesterov Cc: Mike Christie , linux@leemhuis.info, nicolas.dichtel@6wind.com, axboe@kernel.dk, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com, sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com, brauner@kernel.org References: <20230522025124.5863-1-michael.christie@oracle.com> <20230522025124.5863-4-michael.christie@oracle.com> <20230522123029.GA22159@redhat.com> <20230522174757.GC22159@redhat.com> <20230523121506.GA6562@redhat.com> <87bkib6nxr.fsf@email.froward.int.ebiederm.org> <20230524141022.GA19091@redhat.com> <87ttw1zt4i.fsf@email.froward.int.ebiederm.org> <20230525115512.GA9229@redhat.com> Date: Thu, 25 May 2023 10:30:04 -0500 In-Reply-To: <20230525115512.GA9229@redhat.com> (Oleg Nesterov's message of "Thu, 25 May 2023 13:55:13 +0200") Message-ID: <87y1lcxwcj.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1q2CvR-00FA7J-65;;;mid=<87y1lcxwcj.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.110.29.46;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX1/R72iCqGKqDUSGxzLbRgsNGaK/j3KlzUI= X-SA-Exim-Connect-IP: 68.110.29.46 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Nesterov writes: > On 05/24, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > Yes, but probably SIGABRT/exit doesn't really differ from SIGKILL wrt >> > vhost_worker(). >> >> Actually I think it reveals that exiting with SIGABRT will cause >> a deadlock. >> >> coredump_wait will wait for all of the threads to reach >> coredump_task_exit. Meanwhile vhost_worker is waiting for >> all of the other threads to reach exit_files to close their >> file descriptors. > > Indeed, I didn't think about this. > > > So why do we actually need CLONE_THREAD ? Can't vhost_worker() be a kernel thread? > > kthread_create() won't be convenient, but how about kernel_thread() ? it inherits > mm/cgroups/rlimits/etc, kthread_stop() should work just fine. Basically with no patches that is where Linus's kernel is. User complained about the new thread showing up in ps. So the exploration of how we could use CLONE_THREAD instead of what is currently merged began. Eric