Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5886771rwd; Wed, 24 May 2023 08:04:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NpT2GTbfdNNTAkMQvnxpRwweDioYVIkDQn08OKoHT/Bxq0+HQevWODrAYSqqReYpADqib X-Received: by 2002:a17:902:e547:b0:1ad:df75:45e0 with SMTP id n7-20020a170902e54700b001addf7545e0mr20286159plf.39.1684940659347; Wed, 24 May 2023 08:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684940659; cv=none; d=google.com; s=arc-20160816; b=lMtjJqbg2UyDvwjLKU5PY8irdpeci+bnKxnqDzI3oM3ASD4SC9bDURBvAMryIacnV3 VMAqfqjXzu9WWcU5bnxZultDoZFigbYXEqK2t0KojC3KAqDFYHVIsBnVcLkh7xFgL4lt T7yBBvZgRM5VTk6CwJE+4Wj8pL4EA2lo+SipGUUFXUZWrOTiNleHgo6NypMHq5+ETzm9 VcZUSB93GZ7Vb2z/KJz9RvfW8kKWYyfNMqFZGfiGEI5GdPY033TvJsj1szlQfDbvf+th TrtEdgVw7AjGkINIt+owMXJtMNDhtaA8u17ZqxFDkJmTFcW1j7PAVedI+4VB72czDNDc RFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=4VZTmzQxA979TTM8/zsrA/3jHPLmQJGYt8MDPgAXfLA=; b=tE/58KbB73HTg58x8Lg3M5j9nVF3dLdFVxaFJ/tsRqZClhtJi2Onc10hGw+Guaf44i Dr45JcJRQ2vHJpUPbu2YvLg5zGzfSDar02aQpG/cCo9ggvZeX6fm+izNaPqiYF5WE9ki Rxz6gsUfyo0G3bsTf/khOGdHEqwi/amymz1U4yV+qrHZg39snacmrL+To8MVdFbP+waQ xFnsjtSxDtsZ2bQSNPPkjWOE2aXqot/0aOxQ/+Sbl3a3udKZSt9ooa05QDJMbYwDdjeJ nqbysA0/qMf064KtOh1ydfq2n2UIsUWScYU0p3kR1VUVrZpjttYkcY8LpIxJlvUSGAz1 oqtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a170902f7d600b001ab18790b0fsi8458325plw.95.2023.05.24.08.04.05; Wed, 24 May 2023 08:04:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236057AbjEXOpV (ORCPT + 99 others); Wed, 24 May 2023 10:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236032AbjEXOpP (ORCPT ); Wed, 24 May 2023 10:45:15 -0400 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CE501A4 for ; Wed, 24 May 2023 07:45:07 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:32916) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1q1pjc-007WwM-J3; Wed, 24 May 2023 08:45:04 -0600 Received: from ip68-110-29-46.om.om.cox.net ([68.110.29.46]:53910 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1q1pjb-00BGTu-L9; Wed, 24 May 2023 08:45:04 -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> Date: Wed, 24 May 2023 09:44:29 -0500 In-Reply-To: <20230524141022.GA19091@redhat.com> (Oleg Nesterov's message of "Wed, 24 May 2023 16:10:23 +0200") Message-ID: <87ttw1zt4i.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=1q1pjb-00BGTu-L9;;;mid=<87ttw1zt4i.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.110.29.46;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX1/h3a+xGe9HgY6D1YHRegHcTvlq0mGfsXU= X-SA-Exim-Connect-IP: 68.110.29.46 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa08 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 367 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (2.9%), b_tie_ro: 9 (2.4%), parse: 0.79 (0.2%), extract_message_metadata: 3.1 (0.8%), get_uri_detail_list: 1.01 (0.3%), tests_pri_-2000: 3.4 (0.9%), tests_pri_-1000: 2.5 (0.7%), tests_pri_-950: 1.45 (0.4%), tests_pri_-900: 1.25 (0.3%), tests_pri_-200: 1.02 (0.3%), tests_pri_-100: 3.5 (0.9%), tests_pri_-90: 95 (25.9%), check_bayes: 92 (25.1%), b_tokenize: 6 (1.6%), b_tok_get_all: 7 (2.0%), b_comp_prob: 2.2 (0.6%), b_tok_touch_all: 72 (19.6%), b_finish: 1.21 (0.3%), tests_pri_0: 226 (61.6%), check_dkim_signature: 0.54 (0.1%), check_dkim_adsp: 12 (3.2%), poll_dns_idle: 9 (2.6%), tests_pri_10: 2.4 (0.7%), tests_pri_500: 8 (2.3%), rewrite_mail: 0.00 (0.0%) 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 in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Nesterov writes: > On 05/23, Eric W. Biederman wrote: >> >> I want to point out that we need to consider not just SIGKILL, but >> SIGABRT that causes a coredump, as well as the process peforming >> an ordinary exit(2). All of which will cause get_signal to return >> SIGKILL in this context. > > 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. So it looks like the final pieces of work will actually need to be moved into to vhost_xxx_flush or vhost_xxx_release to avoid the exiting threads from waiting on each other, instead of depending upon the vhost_worker to do the work. Which gets back to most of your other questions. >> It is probably not the worst thing in the world, but what this means >> is now if you pass a copy of the vhost file descriptor to another >> process the vhost_worker will persist, and thus the process will persist >> until that copy of the file descriptor is closed. > > Hadn't thought about it. > > I am fighting with internal bugzillas today, will try to write another > email tomorrow. > > But before that, I would like to have an answer to my "main" question in > my previois email. Otherwise I am still not sure I understand what exactly > we need to fix. Let me repeat your "main" question just for clarity here. If a signal comes in after the signal_pending check but before the "work->fn(work)" call is "work->fn(work)" expected to run correctly with signal_pending() or fatal_signal_pending returning true? Eric