Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3009428rwd; Mon, 29 May 2023 04:35:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4B+09kVqabUDyyeEQWZ86b3mc9fXVPtg1WkhFce80XBf8IAURgHCxEZWa5KQxmmsJ/eiLw X-Received: by 2002:a05:6a00:2d83:b0:641:39cb:1716 with SMTP id fb3-20020a056a002d8300b0064139cb1716mr14831957pfb.20.1685360125285; Mon, 29 May 2023 04:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685360125; cv=none; d=google.com; s=arc-20160816; b=WWeoFm+8jvzR/DaGQUWv8CWFhEoPetSESchWQtlA+JV2hIPgUq6PKaPoE65LyG80LM 6kAwdyMsx+jpo2BvsK2LiHOrE9d+yJK+1rvYHQxMeP/xmdcyJWR4KSYzekCz4WS0jBsM 4moR+hTGBKtr18U75BgxJzalaj1tVMxsz69nIE14qCImYEkhyCf2/dI3cxEgGsI9utgP F3yZPk7GGYJCN8klzocvXMfscApCqVOGr0q55g5B2ZWgBexEMIw/tKGRe5tGaZBRNkI/ fLjS/wLDCl91FviodCLzBDML7sTAFUCysUqNtKt1SOho4IFAVOE5OlB230eZwRrLIv4A m59A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lKtwwKgdOHzbmoD1T/tHoH3aQvqf/6iMtVklqd9So0E=; b=b/KDLI+A1JCaF7G9o13SmIYsDfmO+31zHSNyYNIT0HqTqySyhO5jjndWgyZUffNEk+ VEXQUNn6jb0dyHDNSKIs/PGWWhCLA/u3QMjHX1SXqlpADG2vvmfZ/jg6SRYSokYD7ESr 90bKhahQHKqHwPjrysbxThgkAGT/A1bBz1OTt3LLZKuPb6z9OqmDBZbFqi1Gy4DDhGSx 9CUF2ZyZDk4Qyc38SI9AoXpmnbdsz6wG0wX79WbC6izbWrrON3+m9QN9DUotALq6UKcH uOomDqvwvylq/Suw7S7cdx7HqwMywpzyu/1U4gwywUyxERZgNeETXX8Iv1apys8s33WB wi9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hU9T1WEY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u74-20020a62794d000000b00648628d30f5si6544871pfc.379.2023.05.29.04.35.11; Mon, 29 May 2023 04:35:25 -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=@redhat.com header.s=mimecast20190719 header.b=hU9T1WEY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230388AbjE2LUz (ORCPT + 99 others); Mon, 29 May 2023 07:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjE2LUw (ORCPT ); Mon, 29 May 2023 07:20:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B784DD8 for ; Mon, 29 May 2023 04:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685359205; h=from:from:reply-to:subject:subject: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=lKtwwKgdOHzbmoD1T/tHoH3aQvqf/6iMtVklqd9So0E=; b=hU9T1WEY4Og5ZjjkmmJQ6nv+DDmeSjIxB4e3Skb/HxrmN4BU/OvK84GMlMA2rw8GrP1ejy /F+drlBRm+mx3eGOMU3veWhm0OqsvMMMlaauxVrmY9DCst2zH6Nt6BC/eb5kjYV+BI7hJb wYyxtZu3ynR80CD2qRHNqpkr33VvtD4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-629-RwJkRKDPN2qUEFaFuOyK3Q-1; Mon, 29 May 2023 07:20:02 -0400 X-MC-Unique: RwJkRKDPN2qUEFaFuOyK3Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 05FFA185A78F; Mon, 29 May 2023 11:20:02 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.99]) by smtp.corp.redhat.com (Postfix) with SMTP id 64375492B00; Mon, 29 May 2023 11:19:59 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 29 May 2023 13:19:43 +0200 (CEST) Date: Mon, 29 May 2023 13:19:39 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Linus Torvalds , Mike Christie , linux@leemhuis.info, nicolas.dichtel@6wind.com, axboe@kernel.dk, 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 Subject: Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression Message-ID: <20230529111859.GA15193@redhat.com> References: <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> <87y1lcxwcj.fsf@email.froward.int.ebiederm.org> <87cz2mrtnk.fsf@email.froward.int.ebiederm.org> <87mt1pmezu.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mt1pmezu.fsf@email.froward.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 05/27, Eric W. Biederman wrote: > > Looking forward I don't see not asking the worker threads to stop > for the coredump right now causing any problems in the future. > So I think we can use this to resolve the coredump issue I spotted. But we have almost the same problem with exec. Execing thread will wait for vhost_worker() while vhost_worker will wait for .release -> vhost_task_stop(). And even O_CLOEXEC won't help, do_close_on_exec() is called after de_thread(). Or suppose that vhost_worker's sub-thread forks a child with CLONE_FILES... If we want CLONE_THREAD, I think vhost_worker() should exit after get_signal() returns SIGKILL. Perhaps it should "disable" vhost_work_queue() somehow and flush the pending works on ->work_list before exit, I dunno. But imo it should not wait for the final fput(). Oleg.