Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1463541rwd; Sat, 27 May 2023 18:45:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZVg6UeRWBgo6P8KwDZF1NSMpvuXQWZMScPG9eHmlYKnya7hvtssfbTA/d0TCQ+57rxSxY X-Received: by 2002:a05:6a00:150a:b0:64c:b460:c47b with SMTP id q10-20020a056a00150a00b0064cb460c47bmr10162343pfu.15.1685238317011; Sat, 27 May 2023 18:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685238316; cv=none; d=google.com; s=arc-20160816; b=EtHm5FYrjqtKD0sw20X6twpg3Cda+U2NgqmFGzsRq8B6Ne8YHDQz8jUGPTjbkZWt4d K9Y01PJIg5i2hv7xXjM6jOIXJTgpPuW9H5Hl8QtHonr0mudGz99b8iiA+JPE41yJrbA5 sxAW5x3hIviVZK/aXWpGONjJQ6T26Qk/GqOHdM9iZ3GHXTUdzAgeknnhsIIZBTb1RimE D/sM9WIXU06wP9fzpFEjBmHGAokT5IGm+29uGZ91QN9JGxumw9bZ5hE0E+oXQ3b46dgb Yk3gHYMHjse0r78y8xgfqkCqbsvakoXddkOr8vL0HPIQJWmlkZSmEvyxgOe6IboP57CQ gwOw== 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=4TzKO0rvW0d9NZszYo0XBaFqNCKj0tobuD7yGxkjrj0=; b=WycdLGv7dMJoqYakZewFdkon6M9ZexgIGkxzs5eYzNBWUx8qGK+jlpk+vAq1LQSoRN PXt5WV72+DJs4Ybq4FfSWqp6axHjELVscDmsABBa8ZCvjtuX6Mt3niGdMhKWd3UWPav0 E7dBfBsj1aRdW9pxiXcCObyBuNVT5QX8ND6irEHGtsFgy+whNzsO66qk90xv7emSPujX AO/lXHxuzgMdCSa2cbpLZoq+ljhbdqZXbjp/MAi5MYtdwtSX1MfpcFUMmbupvyIKwzWQ N44j2GbY0E7aivOS2xCczhnNR8V15JIpa2DxXczU1ue3qfpZQ8BrI94p/QIk/qYwO3FY Jm2g== 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 f2-20020a633802000000b005034a5a0a58si3194985pga.434.2023.05.27.18.45.03; Sat, 27 May 2023 18:45:16 -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 S229451AbjE1Blk (ORCPT + 99 others); Sat, 27 May 2023 21:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjE1Blj (ORCPT ); Sat, 27 May 2023 21:41:39 -0400 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA12D8 for ; Sat, 27 May 2023 18:41:39 -0700 (PDT) Received: from in02.mta.xmission.com ([166.70.13.52]:38252) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1q35Pd-004hje-8d; Sat, 27 May 2023 19:41:37 -0600 Received: from ip68-110-29-46.om.om.cox.net ([68.110.29.46]:55318 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 1q35Pb-003vjS-Tg; Sat, 27 May 2023 19:41:36 -0600 From: "Eric W. Biederman" To: Mike Christie Cc: Oleg Nesterov , 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> Date: Sat, 27 May 2023 20:41:29 -0500 In-Reply-To: (Mike Christie's message of "Thu, 25 May 2023 11:15:59 -0500") Message-ID: <87a5xpkzau.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=1q35Pb-003vjS-Tg;;;mid=<87a5xpkzau.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+V2Qg3ULEu3+aeUbHP6A32iBYl7ldKMoo= 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, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Mike Christie X-Spam-Relay-Country: X-Spam-Timing: total 721 ms - load_scoreonly_sql: 0.10 (0.0%), signal_user_changed: 14 (2.0%), b_tie_ro: 12 (1.7%), parse: 1.60 (0.2%), extract_message_metadata: 5 (0.7%), get_uri_detail_list: 1.58 (0.2%), tests_pri_-2000: 5 (0.7%), tests_pri_-1000: 4.0 (0.5%), tests_pri_-950: 1.95 (0.3%), tests_pri_-900: 1.59 (0.2%), tests_pri_-200: 1.28 (0.2%), tests_pri_-100: 5 (0.7%), tests_pri_-90: 458 (63.5%), check_bayes: 455 (63.1%), b_tokenize: 8 (1.1%), b_tok_get_all: 228 (31.6%), b_comp_prob: 3.4 (0.5%), b_tok_touch_all: 212 (29.4%), b_finish: 0.89 (0.1%), tests_pri_0: 200 (27.8%), check_dkim_signature: 0.53 (0.1%), check_dkim_adsp: 3.0 (0.4%), poll_dns_idle: 1.25 (0.2%), tests_pri_10: 2.2 (0.3%), tests_pri_500: 7 (1.0%), 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 in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mike Christie writes: > On 5/23/23 7:15 AM, Oleg Nesterov wrote: >> >> Now the main question. Whatever we do, SIGKILL/SIGSTOP/etc can come right >> before we call work->fn(). Is it "safe" to run this callback with >> signal_pending() or fatal_signal_pending() ? > > The questions before this one I'll leave for the core vhost devs since > they know best. Let me ask a clarifying question: Is it only the call to schedule() in vhost_worker that you are worried about not sleeping if signal_pending() or fatal_signal_pending()? Is there concern that the worker functions aka "work->fn()" will also have killable or interruptible sleeps that also will misbehave. We can handle schedule() in vhost_worker without problem. If a worker function has interruptible or killable sleeps that will turn into busy waits or worse not sleeping long enough that seems like a problem. There is no way to guarantee that the outer loop of vhost_worker will protect the worker functions from signal_pending() or fatal_signal_pending() becoming true. Eric